Webhooks
Webhooks API Documentation
Introduction
Welcome to the Ayor Webhook API documentation. This guide helps third-party developers integrate with our webhook system to receive real-time event notifications securely and reliably.
Webhook Overview
Webhooks allow your system to receive automated event notifications (such as order.created) from Ayor. They are delivered as HTTPS POST requests to your specified endpoint. Events are pushed using Google Pub/Sub.
Event Types
You can subscribe to the following event types:
order.createdorder.updatedorder.confirmedorder.shippedorder.deliveredorder.cancelledproduct.out_of_stocksubscription.renewedsubscription.expiredintegration.faileddomain.connected
Integration Guide
Payload Format
Each webhook event is delivered as a Pub/Sub message structured like this:
Decoded Payload Example
The data field contains a base64-encoded JSON object. After decoding, here is a sample payload for order.created:
Payload Schema (Field Reference)
Each event includes a JSON payload with the following fields:
event_id
string
Unique identifier of the event
event_type
string
Type of event (e.g., order.created)
user_id
string
ID of the user (merchant)
timestamp
string (ISO 8601)
Time the event was generated
order_id
string
Unique ID of the order
display_id
integer
Merchant-facing order reference number
confirmation_status
string
Status of order confirmation
Pending, Confirmed, Callback, Cancelled
delivery_status
string or null
Status of delivery, if available
CREATED, IN_TRANSIT, PENDING, DELIVERED, CANCELLED, RETURNED
total_price
decimal
Total order amount including products and delivery
delivery_price
decimal
Delivery fee
currency
string
Currency code (e.g., DZD)
payment_method
string
Payment method used
cod, stripe
payment_status
string
Status of the payment
pending, completed, failed
is_stop_desk
boolean
Whether the order is a stop-desk pickup
shipping_id
string or null
Shipping provider ID or tracking ref
client_note
string or null
Customer-provided message
created_at
string (ISO 8601)
Timestamp of order creation
updated_at
string (ISO 8601)
Timestamp of last update to the order
client_info object
full_name
string
Customer full name
phone_number
string
Customer phone number
email
string or null
Customer email
state
string
Customer state/region
city
string
Customer city
custom_fields array
Each field added by the merchant to their landing page:
field_id
integer
ID of the custom form field
field_name
string
Name of the custom field
custom_title
string
Label used on the landing page
value
string
Submitted value
item_id
string or null
Internal reference to the form entry
order_lines array
One entry per product ordered:
product_id
string
ID of the product ordered
product_name
string
Name of the product variant
variant_name
string
Variant description (e.g., size, color)
quantity
integer
Number of units ordered
unit_price
decimal
Price per unit
reduced_price
decimal or null
Discounted price if applicable
total_price
decimal
Final price (unit × quantity or discounted total)
sku
string
Product SKU
shipping_id
string or null
Product-specific shipping ID
bundle_lines array
Empty array if no bundles were ordered.
shop_info object
shop_id
string
Unique shop ID
shop_name
string
Store name
shop_subdomain
string
Store’s subdomain
landing_page_info object
landing_page_id
string
ID of the landing page
landing_page_title
string
Title shown on the landing page
Retry Behavior
If your endpoint responds with a non-
2xxstatus or times out, we retry the request using exponential backoff:1st retry: ~5 seconds after failure
Subsequent retries: delay doubles each time, up to 5 minutes between attempts
Each message is retried up to 5 times.
If all retries fail, the message is sent to a Dead Letter Queue (DLQ) and will not be redelivered automatically.
Best Practices
Respond quickly (<30s) with HTTP 2xx
Process asynchronously — don't block on business logic
Verify signature for authenticity
Use
event_idto ensure idempotencyExpect retries and duplicate deliveries
Support
For technical support, contact: islam@ayor.ai - amine@ayor.ai - akram@ayor.ai
Last updated: August 7, 2025
Last updated

