The Force sync API lets your own system trigger the same push as forcing a sync in the Synkro app. Synkro sends the current values from the store in the request URL to its connected stores, even if Synkro thinks they are already in sync.

You can force sync:

Inventory is synced along your location connections. By default, Synkro syncs from every active location in the store that has a location connection.

Force sync product inventory

Force sync the inventory levels of every variant of a single product.

POST /api/stores/{store_name}/products/{product_id}/inventory/force_sync

product_id is the Shopify ID of a product in the store store_name.myshopify.com.

A single request can sync at most 10,240 variant inventory levels, which is the product’s number of variants multiplied by the number of locations synced from (for example, 2,048 variants from 5 locations). To sync a larger product, make several requests which each sync from fewer location_ids, or use the full store force sync.

Parameters

destination_stores optional A list of the connected stores to sync to, given as their myshopify.com URLs, e.g. ["example-2.myshopify.com"]. Each store must be connected to the same Synkro user account. Defaults to all connected stores.

location_ids optional A list of the Shopify location IDs to sync inventory from. Each location must belong to the store store_name. Defaults to all active locations which have a location connection to one of the destination stores.

Example

The following example cURL request force syncs the inventory of product 1234567890 from the store example.myshopify.com to the store example-2.myshopify.com.

Request

curl --location 'https://api.synkro-app.com/api/stores/example/products/1234567890/inventory/force_sync' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Synkro-Access-Token: synkro_at_*******' \
--data '{
    "destination_stores": ["example-2.myshopify.com"]
}'

Successful response 202

{
  "message": "Syncing inventory for 3 variant(s) from 2 location(s) in 6 sub-operation(s)"
}

The inventory syncs run in the background shortly after the response is returned.

Force sync store inventory

Force sync the inventory levels of every product in the store.

POST /api/stores/{store_name}/inventory/force_sync

Parameters

destination_stores optional A list of the connected stores to sync to, given as their myshopify.com URLs, e.g. ["example-2.myshopify.com"]. Each store must be connected to the same Synkro user account. Defaults to all connected stores.

location_ids optional A list of the Shopify location IDs to sync inventory from. Each location must belong to the store store_name. Defaults to all active locations which have a location connection to one of the destination stores.

Example

The following example cURL request force syncs the inventory of every product in the store example.myshopify.com from the location 123456789 to all connected stores.

Request

curl --location 'https://api.synkro-app.com/api/stores/example/inventory/force_sync' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Synkro-Access-Token: synkro_at_*******' \
--data '{
    "location_ids": [123456789]
}'

Successful response 202

{
  "job_id": "3f1c7a52-8d4e-4b9a-9c2f-6e0d1b7a4c18",
  "message": "Syncing inventory for all products from 1 location(s)"
}

A full store sync runs in the background and can take a while for large stores. Use the returned job_id with the Job API to follow its progress.

Sync already in progress 409

Each store can run one full store sync at a time. If a full store sync is already in progress for the store, the request is rejected and the response includes the job_id of the sync in progress:

{
  "job_id": "3f1c7a52-8d4e-4b9a-9c2f-6e0d1b7a4c18",
  "message": "A full store inventory sync is already in progress for this store"
}

Force sync product prices

Force sync the price and/or compare at price of every variant of a single product to its child products in the connected stores.

POST /api/stores/{store_name}/products/{product_id}/force_sync

product_id is the Shopify ID of a product in the store store_name.myshopify.com.

Prices only sync to child products of this product. Each destination store’s syncable product properties and price rules still apply, the same as a regular sync.

Parameters

attributes required A list of the variant attributes to sync: price and/or compare_at_price.

destination_stores optional A list of the connected stores to sync to, given as their myshopify.com URLs, e.g. ["example-2.myshopify.com"]. Each store must be connected to the same Synkro user account. Defaults to all connected stores.

Example

The following example cURL request force syncs the price and compare at price of product 1234567890 from the store example.myshopify.com to the store example-2.myshopify.com.

Request

curl --location 'https://api.synkro-app.com/api/stores/example/products/1234567890/force_sync' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Synkro-Access-Token: synkro_at_*******' \
--data '{
    "attributes": ["price", "compare_at_price"],
    "destination_stores": ["example-2.myshopify.com"]
}'

Successful response 202

{
  "message": "Syncing price, compare_at_price for 3 variant(s)"
}

The price syncs run in the background shortly after the response is returned.

Force sync store prices

Force sync the price and/or compare at price of every synced variant in the store to its child variants in the connected stores.

POST /api/stores/{store_name}/products/force_sync

Parameters

attributes required A list of the variant attributes to sync: price and/or compare_at_price.

destination_stores optional A list of the connected stores to sync to, given as their myshopify.com URLs, e.g. ["example-2.myshopify.com"]. Each store must be connected to the same Synkro user account. Defaults to all connected stores.

Example

The following example cURL request force syncs the price of every product in the store example.myshopify.com to all connected stores.

Request

curl --location 'https://api.synkro-app.com/api/stores/example/products/force_sync' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Synkro-Access-Token: synkro_at_*******' \
--data '{
    "attributes": ["price"]
}'

Successful response 202

{
  "job_id": "8a2d4e61-5b7c-4f3e-a1d9-2c6f0e8b3a57",
  "message": "Syncing price for all products"
}

A full store sync runs in the background and can take a while for large stores. Use the returned job_id with the Job API to follow its progress.

Price sync already in progress 409

Each store can run one full store price sync at a time, alongside one full store inventory sync. If a full store price sync is already in progress for the store, the request is rejected and the response includes the job_id of the sync in progress:

{
  "job_id": "8a2d4e61-5b7c-4f3e-a1d9-2c6f0e8b3a57",
  "message": "A full store force sync is already in progress for this store"
}

Errors

All four endpoints return a 400 Bad Request response with a message explaining the problem when a store in destination_stores is not connected to your Synkro user account.

The inventory endpoints also return a 400 Bad Request response when:

  • A location in location_ids does not belong to the store.
  • No location_ids were given, and the store has no active locations with a location connection to the destination stores.
  • A product force sync would sync more than 10,240 variant inventory levels (the product’s number of variants multiplied by the number of locations).

The price endpoints also return a 400 Bad Request response when attributes is missing, empty, or includes an attribute other than price or compare_at_price.

The product endpoints return a 404 Not Found response when the product doesn’t belong to the store store_name.myshopify.com.

{
  "message": "These destination stores are not connected to your Synkro account: example-3.myshopify.com"
}
{
  "message": "Syncing 2049 variant(s) from 5 location(s) exceeds the limit of 10240 variant inventory levels per request. Provide fewer location_ids, or use the full store force sync."
}
{
  "message": "Provide at least one of these attributes: price, compare_at_price"
}

Need Help?

Contact our support team at support@synkro-app.com for assistance with the Force sync API.