Skip to main content

Webhook Events

Overview

Presto uses webhooks to send real-time notifications to your system when specific events occur, such as order creation, cancellation, or completion. This allows your application to react immediately to changes without needing to constantly poll API endpoints.

Setup

To receive webhooks, you must provide a publicly accessible HTTPS URL (your serviceUrl) to your Presto Partner Manager during the onboarding process. Presto will send POST requests with JSON payloads to this URL when events occur.

Security

  • HTTPS Required: Your receiving endpoint must use HTTPS.
  • Signature Verification: Verify that incoming webhook requests genuinely originate from Presto using the signature included in the request headers.
  • IP Whitelisting: Consider whitelisting Presto's webhook source IP addresses as an additional security layer.

Request Headers

All webhook requests include the following headers:

HeaderValueDescription
AuthorizationBearer {API_KEY}Your API key for authentication
Acceptapplication/jsonIndicates the request expects JSON responses
X-OriginproductIdentifies the source system sending the webhook (always product)

Receiving Webhooks

  • Acknowledge Promptly: Your endpoint should respond quickly with a successful HTTP status code (200 OK, 204 No Content) to acknowledge receipt.
  • Handle Failures: Implement logic to handle potential retries if your endpoint fails to respond.
  • Idempotency: Design your webhook handler to be idempotent to avoid processing the same event multiple times.

Webhook Event Types

Presto will send a POST request to your configured serviceUrl with an event field identifying the type and a body field with the relevant payload.

Order Created Event

Event Type: order_created

Sent when a new order is created and assigned to your vendor/store.

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the newly created order.
itemsarray[object]List of items included in the order.
items[].idintegerPresto's internal ID for the item.
items[].order_item_idintegerThe unique identifier for this item within the order (order item id).
items[].quantityintegerQuantity of this item ordered.
items[].pricenumberPrice per unit of this item at the time of order.
service_chargenumberAny applicable service charge.
delivery_chargenumberAny applicable delivery charge.
subtotalnumberThe total cost of items before charges/discounts.
totalnumberThe final total amount for the order.
customer_idintegerThe unique identifier for the customer (user) who placed the order.
delivery_methodintegerIdentifier for the delivery method (1 for delivery, 2 for pickup).
payment_methodstringPayment method key used for the order (e.g., cash, wallet).
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_created",
"body": {
"order_reference": 959,
"items": [
{"id": 35361, "order_item_id": 35361, "quantity": 1, "price": 10.5}
],
"service_charge": 0,
"delivery_charge": 10,
"subtotal": 108.5,
"total": 118.5,
"customer_id": 3456,
"delivery_method": 1,
"payment_method": "cash",
"vendor_id": 789
}
}

Order Accepted Event

Event Type: order_accepted

Sent when an order is accepted by the vendor/store.

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the accepted order.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_accepted",
"body": {
"order_reference": 959,
"vendor_id": 789
}
}

Order Ready Event

Event Type: order_ready

Sent when the order is marked as ready for pickup by the vendor/store.

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the order.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_ready",
"body": {
"order_reference": 959,
"vendor_id": 789
}
}

Order Cancelled Event

Event Type: order_cancelled

Sent when an order is cancelled, either by the customer, Presto support, or due to timeout.

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the cancelled order.
reasonstring(Optional) Reason for cancellation, if available.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_cancelled",
"body": {
"order_reference": 959,
"vendor_id": 789
}
}

Order Updated Event

Event Type: order_updated

Sent when details of an existing order are updated before it is finalized.

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the updated order.
itemsarray[object]The updated list of items in the order.
items[].idstringinteger
items[].quantityintegerQuantity of this item ordered.
items[].pricenumberPrice per unit of this item at the time of update.
service_chargenumberAny applicable service charge.
delivery_chargenumberAny applicable delivery charge.
subtotalnumberThe total cost of items before charges/discounts.
totalnumberThe final total amount for the order.
wallet_amountnumberAmount paid using wallet (if applicable).
customer_idintegerThe unique identifier for the customer (user) who placed the order.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_updated",
"body": {
"order_reference": 232911,
"items": [
{"id": 60728, "quantity": 2, "price": 100}
],
"service_charge": 0,
"delivery_charge": 10,
"subtotal": 108.5,
"total": 118.5,
"wallet_amount": 0,
"customer_id": 3456,
"vendor_id": 789
}
}

Driver Arrived at Vendor Event

Event Type: driver_arrived_at_vendor

Sent when the delivery driver arrives at the vendor/store to pick up the order.

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the order.
driver_idintegerThe unique identifier for the driver.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "driver_arrived_at_vendor",
"body": {
"order_reference": 232911,
"driver_id": 12345,
"vendor_id": 789
}
}

Order Picked Up Event

Event Type: order_picked_up

Sent when the order has been picked up by the driver from the vendor/store.

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the order.
driver_idintegerThe unique identifier for the driver.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_picked_up",
"body": {
"order_reference": 232911,
"driver_id": 12345,
"vendor_id": 789
}
}

Order Returned Event

Event Type: order_returned

Sent when an order is returned to the vendor/store (e.g., failed delivery).

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the order.
driver_idintegerThe unique identifier for the driver.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_returned",
"body": {
"order_reference": 232911,
"driver_id": 12345,
"vendor_id": 789
}
}

Order Completed Event

Event Type: order_completed

Sent when an order is successfully completed (delivered to the customer).

Payload Fields

FieldTypeDescription
order_referenceintegerThe unique identifier for the completed order.
driver_idintegerThe unique identifier for the driver.
wallet_amountnumberAmount paid using wallet.
cash_amountnumberAmount paid in cash.
payment_methodstringPayment method used (e.g., cash, wallet).
totalnumberThe final total amount for the order.
city_idintegerThe city identifier for the vendor.
vendor_idintegerThe unique identifier for the vendor/store.

Example

{
"event": "order_completed",
"body": {
"order_reference": 974,
"driver_id": 12345,
"wallet_amount": 10,
"cash_amount": 20,
"payment_method": "cash",
"total": 30,
"city_id": 1,
"vendor_id": 789
}
}

Summary Table of All Events

Event TypeDescription
order_createdNew order assigned to your vendor/store
order_acceptedOrder accepted by vendor/store
order_readyOrder ready for pickup
order_cancelledOrder was cancelled
order_updatedOrder details updated
order_completedOrder delivered to customer
driver_arrived_at_vendorDriver arrived at vendor/store
order_picked_upOrder picked up by driver
order_returnedOrder returned to vendor/store