End-to-end workflow · Guides
Orders and incremental synchronization
Creating web-store orders, preventing duplicates, paginated exports, and processing changed orders.
A reliable integration separates the initial load, the change stream, and reconciliation. externalOrderId connects the SelSup order to your system.
Web stores, order management, and delivery systems01
Create a web-store order
Map store products to SelSup productId before creating orders. Do not resolve products by a mutable display name during checkout.
Send the external order number in externalOrderId and check it in your database before retrying. organizationId is particularly important in multi-organization accounts.
Include productId, quantity, and the price required by your sales-channel logic for every item.
After a network timeout, search for the externalOrderId first. Do not blindly create again because the first request may have committed before its response was lost.
{
"type": "RETAIL",
"organizationId": 1,
"externalOrderId": "SHOP-12345",
"products": [
{
"productId": 1422585,
"quantity": 2,
"price": 1000
}
]
}
02
Initial order export
Read orders in fixed-size pages. Use count=true only when progress reporting or final-count reconciliation needs total.
Persist both the SelSup id and externalOrderId. Commit every processed page atomically before moving to the next page.
- 1
Capture the export boundary
Save the start time so changes occurring during the full scan are picked up by the incremental pass.
- 2
Process every page
Avoid parallel pages from the same range when sorting and underlying records can change.
- 3
Run the change pass
After the full load, request orders modified since the saved boundary with a small overlap.
Related API endpoints
GET/api/order/findSearch orders
03
Process changes without gaps
Use the modifiedDate filter when present in the current search contract. Advance the cursor only after the complete page has been processed successfully.
Overlap time windows by a few minutes and deduplicate by id and modifiedDate. This protects against write delays and clock differences.
Replace the local order representation because status, address, items, marking codes, or related data may all change.
Store the cursor in UTC using the exact API precision. Do not round seconds or use server-local time without an offset.
GET /api/order/find?modifiedDate=2026-08-09T10:00:00Z&page=1&limit=100
Authorization: YOUR_API_TOKEN
Related API endpoints
GET/api/order/findIncremental searchGET/api/order/{orderId}Load an order by ID
04
Handle failures and discrepancies
- 1
Validate before sending
Check the organization, order type, warehouse, marketplace, quantity, and price for every item.
- 2
Separate transient and permanent errors
Invalid data needs correction, while a network failure needs a controlled retry after checking the outcome.
- 3
Reconcile periodically
Compare statuses and order contents for an overlapping period independently from the main change flow.
Branch on error. localMessage is localized for the token owner and can change.