Notify Order Storage Failure
When the daemon cannot successfully insert or update an order received from Talk2Sync, it must notify Talk2Sync of the failure and provide details about the error.
This notification allows Talk2Sync to register the failed order transaction and continue managing the synchronization process.
1. Notify the Storage Failure
Send a POST request using the _id of the affected order:
POST https://api.talk2sync.com/api/adapters/custom/reverse/connection/{{your key}}/pull/orders/{{_id}}/failed
Replace {{_id}} with the identifier of the order that could not be processed.
2. Request Body
The request body must contain the general error description and the specific reasons for the failure:
{
"error": "could not pull order",
"reasons": [
{
"message": "custom error string message",
"code": 400
}
]
}
The error field provides a general description of the failure, while reasons contains the specific errors encountered during processing.
Each reason includes:
message— Description of the specific problem.code— Error code associated with the problem.
3. Wait for the Transaction to Complete
The failure notification should return HTTP 200 OK.
After receiving a successful response, the daemon must wait until Talk2Sync finishes processing the order transaction before requesting another order.
Check the order readyfornext status:
GET https://api.talk2sync.com/api/adapters/custom/reverse/connection/{{your key}}/pull/orders/readyfornext
The response should have a structure similar to:
{
"ready": false
}
or:
{
"ready": true
}
ready: false
Talk2Sync is still processing the failed transaction. The daemon must wait and query the endpoint again.
ready: true
The transaction has completed and the daemon can proceed with the next order.
Process
Next Steps
- Review Get Next Order to Pull to retrieve the next order.
- Review Notify Order Storage Success for successful storage operations.
- Review Set Finish Order Pulls to finalize the order download.