List Order by ID
When performance is a priority, you can return a lightweight list containing only order IDs and their last_updated timestamps. This allows Talk2sync to efficiently identify which orders require synchronization before requesting their complete information.
Return a Lightweight Order List
Instead of returning the complete order objects for every record, respond to the same request URL with a list containing the order identifiers and their last update timestamps.
Offset-Based Pagination
If your endpoint supports numeric offset pagination, use the offset parameter:
GET https://www.example.com/your/endpoint/url?offset=0&sortorder=desc&jobid=123
T2SKey: {{API KEY}}
The response should follow a structure similar to:
{
"paging": {
"pageSize": 20,
"itemsTotal": 2,
"offset": 0
},
"orders": [
{
"_id": "75554554546",
"orderid": "75554554546",
"last_updated": 1517360038797
},
{
"_id": "75554554546",
"orderid": "75554554546",
"last_updated": 1517360038797
}
]
}
The lightweight response should provide, at minimum:
_id: The order identifier.orderid: The order ID used by the source system.last_updated: The timestamp indicating when the order was last updated.paging: Pagination information required to process the returned list.
Cursor-Based Pagination
If numeric offsets are not available for your pagination strategy, use a cursor through the next parameter:
GET https://www.example.com/your/endpoint/url?next=YXNkaWhhc3BvZGhpYXM&sortorder=desc&jobid=123
T2SKey: {{API KEY}}
The cursor value represents the position from which the next page should be retrieved.
Retrieve the Complete Order
Once Talk2sync determines that an order needs to be crawled, your endpoint must provide a way to retrieve the complete order using its ID.
Use the order ID together with the jobid:
GET https://www.example.com/your/endpoint/url?id=75554554546&jobid=123
T2SKey: {{API KEY}}
The complete response can contain the order's status, dates, totals, items, buyer information, shipments, ratings, feedback, and messages.
Complete Order Response
{
"_id": "75554554546",
"orderid": "75554554546",
"last_updated": 1517360038797,
"status": "paid",
"dateCreated": "",
"dateClosed": "",
"total": {
"amount": 350,
"currency": "USD"
},
"orderItems": [
{
"id": "7778545",
"variation_id": "0",
"quantity": 1,
"unitPrice": 350,
"currencyId": "USD"
}
],
"buyer": {
"id": "4578889",
"email": "testbuyer@example.com",
"phone": "88888888",
"firstName": "John",
"lastName": "Doe",
"billingaddress": {
"addressline": "",
"zipcode": "",
"city": "",
"state": "",
"country": ""
},
"shipmentaddress": {
"addressline": "",
"zipcode": "",
"city": "",
"state": "",
"country": ""
}
},
"shipments": [
{
"id": "123",
"shiptracknum": "TRK-1203912",
"shipitems": ["4578889"],
"shiptype": "Fedex",
"shipstatus": "shipping"
}
],
"rating": 2.5,
"feedback": "",
"messages": [
{
"message_id": "",
"date_created": 0,
"from": "",
"message": ""
}
]
}
Recommended Flow
The integration can use the following two-step approach:
- List orders: Return only the order IDs and
last_updatedtimestamps. - Identify changes: Talk2sync uses the lightweight information to determine which orders require synchronization.
- Retrieve order details: Request the complete order using its ID.
- Process the order: Use the complete response to synchronize the order data.
Next Steps
- Review List Orders for the general order listing endpoint.
- Review List Order by ID for retrieving an individual order.
- Review Add or Update Order when implementing order synchronization.