question

Dhanaraj avatar image
Dhanaraj asked ·

How to sync created new orders using API with Order app programmatically

Sync created new orders using API with Order app using Sync programmatically with out clicking sync button.
OrdersREST API
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Chanel avatar image
Chanel answered ·
You can't force a sync through the Web API, but the devices will sync on their own when a new order is created, deleted or modified. In my experience, I've seen a new API-created-order appear on a device within about 5 to 10 seconds.
3 comments Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the response. In my case I am trying to add lineItem using https://apisandbox.dev.clover.com/v3/merchants/54... --header "Authorization: Bearer <api_token>" body '{"state": "open"}'.

And https://apisandbox.dev.clover.com/v3/merchants/5... 4A5TAV9T30STR/line_items --header "Authorization: Bearer <api_token>" body '{"item":{"id":"HBY71TPJXMP54"}}
Each time when order created I need to sync the order app in emulator.
0 Likes 0 · ·

Hi @Dhanaraj, I updated your comment to remove the API token. Please be mindful that API tokens should not be shared publicly for either Sandbox or our Production environments.

0 Likes 0 · ·

It looks like emulators are a special case. Testing it out myself, it looks like the emulator "syncs" whenever you interact with it. So, once you've created the order, you will have to force a sync using the button in the top right corner or navigate away from the Order List and come back (which will also force a sync).

0 Likes 0 · ·

Welcome to the
Clover Developer Community