NEWDiscoverShipGoal– turn cart progress into bigger baskets
All articles

Export and import shipping rules

Export Shopify shipping rules from ShipWith to back them up or copy them to another store. Importing the ShipWith JSON file adds copies of the rules; it does not replace, update, or merge existing rules.

ShipWith changes delivery options that Shopify already supplies. Importing a rule does not create shipping rates, change their prices, or offer shipping discounts.

Export rules

On the ShipWith Dashboard:

  1. In Shipping rules, select Export.
  2. Select the checkbox beside each rule to include. Use Select all shipping rules to select every rule.
  3. Select Export number, such as Export 3. Select Cancel instead if you do not want to export.
  4. Keep the downloaded file in a secure location. Its name uses the format shipwith-shipping-rules-YYYY-MM-DD.json.

The download is a JSON document with kind: "shipping-rules-export", schemaVersion: 2, the export time in exportedAt, and a rules array. Each exported rule contains its name, status, Function input, priority, run mode, conditions, and actions.

The file contains rule content only. It does not contain database IDs, the source shop, Shopify Delivery Customization IDs, sync status or errors, or created and updated timestamps. Those values do not transfer to another store. Schema version 2 identifies the current import format; do not change the schema version or edit the JSON unless you can preserve the expected structure and values.

Import rules

  1. On the ShipWith Dashboard, select Import beside Create shipping rule.
  2. In the file picker, choose a ShipWith JSON export file.
  3. Wait for the Rules imported banner. It reports how many rules were imported and confirms that they are inactive.

Import accepts a file smaller than 1 MB and no more than 100 rules at a time. If a backup contains more than 100 rules, create separate exports of up to 100 rules each. The file must be valid JSON in ShipWith's schema version 2 export format.

ShipWith validates the whole file before creating rules. If the JSON, document type, schema version, or any rule is invalid, no rules from that file are imported. After validation, the rules are created together as new rows for the Shopify store currently using ShipWith.

Every imported rule is forced to Off, even if its exported status was active. Existing rules remain unchanged. Duplicate rule names are allowed, so importing the same file more than once creates additional rules with the same names. Rule IDs, shop ownership, Shopify sync state, Shopify IDs, and timestamps are not copied.

Review, activate, sync, and test

Review every imported rule before it can affect checkout:

  1. Open an imported rule from Shipping rules. Use its name, Priority, Input, and Off status to distinguish it from an existing rule with the same name.
  2. Check the Rule name, Function input, Priority, conditions, action order, and delivery method title or handle targets. Rename duplicate rules if that makes them easier to identify.
  3. Set Status to Live, then select Save only when the rule is ready. Activate rules in small groups when several rules can affect the same delivery options.
  4. Under Shopify sync, wait for Status to become Synced. If it is Failed or Not synced, select Retry sync and wait for Synced. For help with the error, see Fix a rule that failed to sync with Shopify.
  5. Test a matching and a non-matching checkout. Inspect every delivery group and confirm that targeted options change while other options remain available.

Do not rely on an imported rule until it is active, saved, synced, and tested. Function input types and available shipping methods can differ between stores, so a rule that worked in the source store can need changes in the destination store.

Safe backup or migration workflow

  1. Export the source rules before making changes. Keep the original downloaded file unchanged as the rollback copy.
  2. If the destination already has rules, export those rules separately before importing. Label both files with the store and date outside the JSON file.
  3. Import into the destination store and confirm the Rules imported count. Do not import again just because the new rules are inactive; inactivity is expected.
  4. Review the imported rules against the destination store's rates and existing rules. Activate, save, sync, and test a small group at a time.
  5. Keep the backups until checkout tests pass. Delete superseded or accidental imported copies only after confirming which rows should remain.

Recover from an import error

  • Choose a JSON file to import. Select a non-empty .json export file.
  • Choose a JSON file smaller than 1 MB. Export fewer rules per file or reduce the file below the limit without changing its required structure.
  • Import up to 100 rules at a time. Create smaller source exports and import each file separately.
  • Choose a ShipWith shipping rules export file. Use an unmodified ShipWith schema version 2 export. A different JSON file, another schema version, or malformed JSON cannot be imported.
  • A rule-specific validation error appears. Correct the source rule in ShipWith and export it again. Because parsing is all-or-nothing, the failed attempt creates no rules from that file.

If Rules imported appears but the list contains unintended copies, do not activate them. Identify them by their inactive status and rule details, then delete those copies and import the correct file once. If an activated import causes an unexpected checkout result, set it back to Off, select Save, wait for Shopify sync to finish, and retest checkout before trying another import.