How to implement the "OrderProvisioning" API
API Order management
As it is an asynchronous api, only the return (status 200) is mandatory, after all its processes have been performed correctly.
The structure that will be sent to the remote API is described below:
{
"objectId": "ORDER_ID",
"eventType": "ORDER_UPDATE",
"retailerOrderId": "SEQUENCE_ORDER_ID",
"isInternational": false,
"canAcceptBoleto": true,
"canAcceptCreditCard": true,
"canAcceptDebitCard": true,
"canAcceptPix": true,
"coupon": "CUPOM",
"salesChannel": "Instagram",
"campaign": "Campaign",
"team": {
"objectId": "RTE2587",
"name": "Team",
"externalId": "padrao-1234"
},
"giftCard": "GiftGift",
"discount": 10,
"discountMode": "ABSOLUTE",
"deliveryTime": "1 dia útil",
"shippingMethod": "SEDEX",
"freightCost": 10,
"freeShipping": false,
"paymentAccountSelected": "ID_CONTA_SELECIONADA",
"orderAccountSelected": "ID_CONTA_SELECIONADA",
"customer": {
"objectId": "ID_CUSTOMER",
"name": "João",
"lastName": "Medeiros",
"gender": "Male",
"businessAccount": false,
"taxDocumentnumber": "00055544465",
"email": "[email protected]",
"phoneNumber": "999999999",
"phoneAreaCode": "41",
"phoneCountryCode": "55",
"birthDate": "2023-10-09",
"businessStateTaxId": "PASS",
"businessTaxId": "TRED98E",
"businessName": "MyBussines"
},
"shippingAddress": {
"addressLine1": "STREET",
"addressLine2": "COMPLEMENT",
"number": "213",
"suburb": "SUBURB",
"zip": "CEP",
"recipient": "RECIPIENT_NAME",
"addressState": "STATE",
"city": "CITY",
"country": "COUNTRY"
},
"items": [
{
"objectId": "ID_ITEM",
"quantity": 5,
"price": 10,
"externalId": "987941TRE",
"sellerId": "SELLER888",
"isGift": true,
"shippingMethod": "PAC",
"productReference": "654987321",
"weight": 5,
"height": 5,
"length": 5,
"width": 5,
"variantId": "ID_VARIANTE"
}
],
"salesPerson": {
"objectId": "OMNICHAT_SALESPERSON_ID",
"name": "John",
"lastName": "Doe",
"salesPersonCode": "SALESPERSON_CODE",
"externalId": "YOUR_ID"
}
}
Based on the information received, you can perform various tasks, such as:
• Reservation of stock items
• Create the order
• Validate customer data
• Validate shipping (availability of product delivery to the informed zip code)
After the order is provisioned in your system, it must have its status changed to “ORDER_GATEWAY_PROVISIONED” if your configuration uses OmniChat checkout, so that OmniChat can proceed with the order (See how to perform this procedure in How to change an OmniChat order status). If you use your own checkout, you must use the OmniChat provisioning api (See how to perform this procedure in How to use your own checkout).
Updated 11 months ago