If you used our previous method for integrating orders, you can still find their documentation in Order Logs and How to collect orders from sales channels. The previous method, however, will not be maintained. If you are integrating orders for the first time, we recommend you use the instructions in this article.
The order flow describes the status, possibilities, and actions throughout the life cycle of an order. With the flow, retailers can also track the mapped order status on the platform. Learn more in Order flow and status.
It’s important to note that when sending a request to update the order status, if the order is not currently in the correct status at VTEX to advance to the requested one, an error will be returned. That means that the connector has to manage when a status should be updated or not. For example:
- If the order is in the
waiting-for-manual-authorization
status at VTEX, that means the order has a price divergence, and we need to wait for the seller to either reject this order (cancel) or authorize it. Sending an order approval while the order is in this status will fail (with a codeEOI011
) since the seller hasn’t authorized the integration of the order yet. - In this case, it’s recommended for the connector to try to approve the order at a later time, after receiving the error from Channel Order API, and keep trying until the seller takes action and the status change.
- Another option is to use Order hooks and feeds from our OMS VTEX module. That way the connector can know when the order status was updated and the approval can be sent.
API Reference: Update order status
Use the request example below to update the status of an order. The description and requirement of each of the fields present in the request body are found in our Update Order Status API Reference.
Request body
_10{_10 "marketplaceOrderId": string,_10 "connectorName": string,_10 "connectorEndpoint": string,_10 "marketplaceOrderStatus": string_10}
Order Notification Results
- Error
- EOI000 - Unknown error
- EOI001 - Unmapped error
- EOI008 - Cannot approve an order that is not integrated yet
- EOI009 - Order out of valid status to approve
- Success
- SOI002 - Order approved
Response
_11{_11 "marketplaceOrderId": "123456789",_11 "accountName": null,_11 "code": "SOI003",_11 "flow": "ApproveOrder",_11 "success": true,_11 "operationId": null,_11 "errors": null,_11 "fields": null,_11 "message": "Order successfully enqueued"_11}
Notification
_14{_14 "marketplaceOrderId": "123456789",_14 "accountName": "connections",_14 "code": "SOI002",_14 "flow": "ApproveOrder",_14 "success": true,_14 "operationId": "ca254d31-c547-4693-9532-72e060264a88",_14 "errors": null,_14 "fields": {_14 "mainOrderId": "MKP-123456789",_14 "franchiseOrderId": null_14 },_14 "message": "Order approved successfully"_14}