Bylink Order Sync for Shopify
Keeps Business Central sales orders in step with Shopify when an order is cancelled or edited.
What it does
- Order cancellation. When an imported Shopify order is cancelled and has a sales order, a job queue entry checks for blockers. If nothing blocks it, the sales order is deleted. Otherwise the blocker is recorded and reported.
- Order edit sync. When an edited order is imported again, the app compares it with the version the sales order was built from (lines, quantities, prices, shipping address). If something changed, the order is marked Edit Pending, and the next run of Sync Orders from Shopify rebuilds the sales order under the same number.
Setup per shop
- Shopify custom app scopes:
read_orders,write_orders. Admin API credentials set up (see Getting started). - Create an order metafield definition in Shopify for the sync status, and the matching row in Shopify Metafield Definitions (owner type Order, Enabled).
- Shopify Shop Card, group Order Sync: choose it in Sync Error Metafield Key. The card shows a notification while reporting is not configured.
- Set Edit Notify Email to receive an e-mail for blocked edits. Leave it blank for no e-mail. An e-mail account must be set up for the Default scenario.
- Optional: Address Read Tag. When set, the shipping address is read again only for orders with that tag.
- Switch on Shopify Order Cancellation and Shopify Order Edit Sync in the Feature Flags part.
- After switching on edit sync, run Store Order Edit Baselines on the Shop Card once, so that open orders created earlier are compared from then on.
- Before switching on cancellation, look for orders that are already cancelled in Shopify but still have a sales order. They will be cancelled the next time they are imported.
Blockers
A blocked order is not changed. The reason is one sentence.
- Cancellation and rebuild are blocked when any quantity on the sales order is shipped, or a posting number is already assigned.
- An edit of an order that is invoiced or fulfilled is refused.
You see the blocker on the Shopify Orders list and card (Cancel Blocker, Edit Pending, Edit Blocker), in the order metafield in Shopify, and for edits in the notification e-mail. The full Business Central error text stays in Business Central; Shopify and the e-mail get a fixed text.
Failed rebuild
The order stays Edit Pending and is tried again at every sync. If the shipping address cannot be read from Shopify, the order is held and read again at the next sync; a 401 or 403 from Shopify is logged as an error, so check the credentials.
Job queue
Give the job queue entry for Sync Orders from Shopify and the cancellation entries the same Job Queue Category Code, so they do not run at the same time. A user who cannot schedule tasks (for example a delegated admin) leaves the cancellation entry On Hold; run Process Cancellation from the Shopify Order card instead.
Permissions
Shpfy Order Sync BYL for the user who runs the sync and the job queue entries.
Shpfy Admin API BYL for whoever sets up the shop.
Go-live check
In a sandbox, edit one order in Shopify (address and a quantity), run Sync Orders from Shopify, and check that the sales order was rebuilt under the same number. Then cancel one order in Shopify, sync, and check that the sales order is gone.