Guides

How to implement the "StatusChangeNotification" API

API Order management

This api is called by OmniChat whenever an order status change happens. The request is made by passing the following payload:

{
    "order": {
        "objectId": "string",
        "items": "OmniChatSchema.Item[]",
        "notes": [],
        "boletoInstructions": {},
        "creditCardInstructions": {},
        "status": "OmniChatSchema.OrderStatus",
        "discountMode": "'ABSOLUTE' | 'PERCENTAGE'",
        "discount": "number",
        "freightCost": "number",
        "canAcceptBoleto": "boolean",
        "canAcceptCreditCard": "boolean",
        "customer": "OmniChatSchema.Customer",
        "retailer": "OmniChatSchema.Retailer",
        "salesPerson": "OmniChatSchema.User",
        "pickUpInStore": "boolean",
        "statusTracking": "string",
        "shippingAddress": "OmniChatSchema.Address",
        "createdAt": "Date",
        "updatedAt": "Date",
        "retailerOrderId": "number",
        "statusChanges": "StatusChange[]"
    },
    "statusChange": {
        "status": "'ORDER_GATEWAY_PROVISIONED' | 'COLLECT_PAYMENT' | 'WAITING' | 'PAID' | 'PACKAGED' | 'SHIPPED' | 'PARTIALLY_SHIPPED' | 'DELIVERED' | 'NOT_PAID' | 'PARTIAL_PAID' | 'OVER_PAID' | 'CANCELLED' | 'REVERTED' | 'ERROR'",
        "responsible": "string",
        "message": "string",
        "updatedAt": "Date"
    }
}