Fix a rule that failed to sync with Shopify
When you save a Live or Test rule, ShipWith stores it and sends all active rules for that Function input to Shopify. If Shopify does not receive them, your stored rules are not deleted.
How to tell that a sync failed
The rule page shows a red banner:
This rule is not running at checkout Your rule is saved, but it could not be sent to Shopify. Contact us and we'll fix it for you.
Select Contact us in the banner to open a chat. ShipWith also records the error, so we can see what went wrong.
No banner means Shopify received the latest saved rule. Off rules are never sent to Shopify, so they never show this banner and never run at checkout.
What happens at checkout after a failure
The saved rule remains in ShipWith, including the changes that could not sync. Checkout does not use those changes yet.
- If this Function input synced before, checkout keeps its previously synced behavior.
- If this Function input has never synced, checkout keeps the behavior it had without that ShipWith Function input.
- Checkout starts using the corrected configuration after you fix the cause and select Save again, and the banner no longer appears.
Common causes
Rules larger than 10,000 bytes
Shopify Functions cannot use a configuration larger than 10,000 bytes. ShipWith stops the sync instead of sending a configuration that Shopify would ignore. Long ZIP/postal code, City, or Province code lists are the usual cause.
To reduce the size:
- Save long postal code lists once in Settings > Postcode lists. Then use is in list in your rules instead of pasting the codes into every rule. Each list is stored once, however many rules use it.
- Remove duplicate or unnecessary values. Use wildcards such as
902*instead of listing every code. - Where the same condition has many alternatives, use one is one of condition with one value per line instead of many separate conditions or rules.
- If another Function input supports all of an independent rule's conditions, you can move that rule there. Open the rule's Advanced card in the sidebar, select the pencil, and pick the input in Change function input. Inputs that do not support the rule's conditions are greyed out under Doesn't support your conditions.
Do not move rules between Function inputs merely to reduce size. Different inputs support different conditions, and Shopify does not guarantee priority order across inputs.
Multiple attribute keys in one Function input
For each Function input, Shopify's Function query can read:
- one cart attribute key; and
- one cart-line attribute key.
Sync fails when active rules in the same Function input require more than one cart attribute key or more than one cart-line attribute key. Cart attributes and cart-line attributes have separate one-key limits.
Open the active rules that use the affected Function input and compare their attribute conditions. Then either:
- change those conditions to use one shared key;
- make rules that use the extra key inactive; or
- move an independent rule to another Function input with the rule's Advanced card (Change function input). You can only pick an input that supports all of the rule's conditions.
A rule uses a postcode list that was deleted
If a rule's condition points at a postcode list that no longer exists, the sync for that Function input fails. Pick another list in the condition, or remove the condition, then select Save.
After the fix
Select Save and confirm that the banner is gone. Then test both a matching and a non-matching checkout. Check every delivery group that the rule could affect.
If the banner stays after you save, select Contact us in the banner.
For the complete procedure, see Test your shipping rules at checkout.
