Events

All webhook events share the same payload structure -- the top-level category field tells you what event fired, and the payload object contains the order at the time of the event. The key field to watch is payload.status, which reflects the order's current state.

Events reference

Eventpayload.statusDescription
ORDER_CREATEDpreparingA new order has been placed and payment confirmed
ORDER_ASSIGNEDpreparingA rider has been assigned to collect the order
ORDER_AWAITING_PICKUPawaiting_pickupThe rider has arrived at your location and is waiting to collect
ORDER_PICKED_UPpickedThe rider has collected the order and is heading to the customer
ORDER_ARRIVED_AT_CUSTOMER_LOCATIONarrivedThe rider has arrived at the customer's location
ORDER_COMPLETEcompletedThe order has been successfully delivered
ORDER_ITEMS_UPDATEDacceptedAn item was unavailable and the customer has confirmed the vendor's suggested replacement

Item substitutions

When a vendor marks an item as unavailable and suggests a replacement, and the customer confirms the replacement, Chowdeck sends an ORDER_ITEMS_UPDATED event to your webhook URL.

The payload has the same structure as ORDER_CREATED. The items array reflects the current state of the order after substitution -- replaced items appear in the list, the original unavailable items do not.

There is no explicit flag on individual items to indicate they were substituted. To determine what changed, compare the items array against the original ORDER_CREATED payload, or inspect the timeline array for entries with action: "REPLACED_AN_ITEM".

{
  "category": "ORDER_ITEMS_UPDATED",
  "description": "The customer replaced some items",
  "payload": {
    "id": 1453,
    "reference": "testing119312",
    "status": "accepted",
    "items": [
      {
        "id": 2409,
        "item_id": 109,
        "name": "Chicken Suya",
        "description": "Grilled chicken suya",
        "reference": "menu-ref-xyz",
        "type": "item",
        "pack_id": 1,
        "quantity": 40,
        "price_per_quantity": 52000
      }
    ],
    "timeline": [
      {
        "action": "REPLACED_AN_ITEM",
        "description": "Vendor replaced an unavailable item",
        "created_at": "2022-11-25T17:10:00.000Z"
      }
    ]
  }
}

Payload field reference

Every event delivers the same order object in the payload field. Here's what each field means:

Order fields:

FieldTypeDescription
idintegerInternal order ID
referencestringYour order reference
statusstringCurrent order status — use this to track order progress
summarystringShort text summary of the order items
total_priceintegerTotal order amount in the smallest currency unit
delivery_priceintegerDelivery fee in the smallest currency unit
currencystringCurrency code (e.g. NGN)
sourcestringHow the order was placed (e.g. api)
classstringOrder type (e.g. delivery)
created_atstringISO 8601 timestamp when the order was created
updated_atstringISO 8601 timestamp of the last update
time_payment_confirmedstringISO 8601 timestamp when payment was confirmed
time_customer_received_orderstringISO 8601 timestamp when the customer received the order. null until delivered.
actual_delivery_timestringActual delivery duration. null until delivered.
driverobjectAssigned rider details. Empty object until a rider is assigned.

Customer fields (customer):

FieldTypeDescription
idintegerInternal customer ID
first_namestringCustomer's first name
last_namestringCustomer's last name
emailstringCustomer's email address
phonestringCustomer's phone number
country_codestringCustomer's country code

Items array (items[]):

FieldTypeDescription
idintegerMenu item ID
item_idintegerInternal item identifier
namestringItem name
descriptionstringItem description
referencestringMenu or menu group reference
typestringitem for standard items, group for variant/combo items
pack_idintegerPack this item belongs to
quantityintegerNumber of units ordered
price_per_quantityintegerPrice per unit in the smallest currency unit
variant_idintegerVariant ID — only present when type is group
variant_referencestringVariant reference — only present when type is group
variant_namestringVariant name — only present when type is group

Timeline array (timeline[]):

FieldTypeDescription
actionstringThe timeline action (e.g. ORDER_CREATED)
descriptionstringHuman-readable description of the action
created_atstringISO 8601 timestamp of when the action occurred

Address fields (customer_address, vendor_address):

FieldTypeDescription
idintegerInternal address ID
streetstringFull street address
pretty_namestringDisplay-friendly address string
citystringCity
statestringState
countrystringCountry
coordinate.xnumberLongitude
coordinate.ynumberLatitude

Vendor fields (vendor_information):

FieldTypeDescription
namestringVendor store name
referencestringVendor reference
webhook_urlstringConfigured webhook URL for the vendor

Sample payload

Here is a complete example of an ORDER_CREATED webhook:

{
  "category": "ORDER_CREATED",
  "description": "New order",
  "payload": {
    "id": 1453,
    "reference": "testing119312",
    "status": "preparing",
    "summary": "40 portions of Beef.",
    "total_price": 2130000,
    "delivery_price": 80000,
    "currency": "NGN",
    "source": "api",
    "class": "delivery",
    "created_at": "2022-11-25T17:03:40.000Z",
    "updated_at": "2022-11-25T17:03:55.000Z",
    "time_payment_confirmed": "2022-11-25T17:03:43.000Z",
    "time_customer_received_order": null,
    "actual_delivery_time": null,
    "driver": {},
    "customer": {
      "id": 70,
      "first_name": "Dave",
      "last_name": "Aluks",
      "email": "[email protected]",
      "phone": "08142272922",
      "country_code": null
    },
    "items": [
      {
        "id": 2408,
        "item_id": 108,
        "name": "Beef Suya",
        "description": "Pure beef meat",
        "reference": "menu-ref-abc",
        "type": "item",
        "pack_id": 1,
        "quantity": 40,
        "price_per_quantity": 50000
      }
    ],
    "timeline": [
      {
        "action": "ORDER_CREATED",
        "description": "Order created",
        "created_at": "2022-11-25T17:03:40.000Z"
      },
      {
        "action": "MADE_PAYMENT",
        "description": "Made payment using none",
        "created_at": "2022-11-25T17:03:42.000Z"
      },
      {
        "action": "VENDOR_ACCEPTED_ORDER",
        "description": "Vendor accepted the order",
        "created_at": "2022-11-25T17:03:46.000Z"
      }
    ],
    "customer_address": {
      "id": 531,
      "street": "33 Adisa Coker St, Ojodu, Lagos",
      "pretty_name": "33 Adisa Coker St, Ojodu, Lagos",
      "city": "Ojodu",
      "state": "Lagos",
      "country": "NG",
      "coordinate": {
        "x": 3.3393804,
        "y": 6.6568331
      }
    },
    "vendor_address": {
      "id": 531,
      "street": "33 Adisa Coker St, Ojodu, Lagos",
      "pretty_name": "33 Adisa Coker St, Ojodu, Lagos",
      "city": "Ojodu",
      "state": "Lagos",
      "country": "NG",
      "coordinate": {
        "x": 3.3393804,
        "y": 6.6568331
      }
    },
    "vendor_information": {
      "name": "Suya Spots",
      "reference": "vendor-ref-001",
      "webhook_url": "https://your-server.com/webhooks/chowdeck"
    }
  }
}

The payload structure is the same across all events. Only category, description, and payload.status change between events.



Did this page help you?