webhookWebhooks

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.created check

  • order.updated check

  • order.confirmed clock

  • order.shipped clock

  • order.delivered clock

  • order.cancelled clock

  • product.out_of_stock clock

  • subscription.renewed clock

  • subscription.expired clock

  • integration.failed clock

  • domain.connected clock


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:

Field
Type
Required
Description
Allowed Values

event_id

string

square-check

Unique identifier of the event

event_type

string

square-check

Type of event (e.g., order.created)

user_id

string

square-check

ID of the user (merchant)

timestamp

string (ISO 8601)

square-check

Time the event was generated

order_id

string

square-check

Unique ID of the order

display_id

integer

square-check

Merchant-facing order reference number

confirmation_status

string

square-check

Status of order confirmation

Pending, Confirmed, Callback, Cancelled

delivery_status

string or null

square-x

Status of delivery, if available

CREATED, IN_TRANSIT, PENDING, DELIVERED, CANCELLED, RETURNED

total_price

decimal

square-check

Total order amount including products and delivery

delivery_price

decimal

square-check

Delivery fee

currency

string

square-check

Currency code (e.g., DZD)

payment_method

string

square-check

Payment method used

cod, stripe

payment_status

string

square-check

Status of the payment

pending, completed, failed

is_stop_desk

boolean

square-check

Whether the order is a stop-desk pickup

shipping_id

string or null

square-x

Shipping provider ID or tracking ref

client_note

string or null

square-x

Customer-provided message

created_at

string (ISO 8601)

square-check

Timestamp of order creation

updated_at

string (ISO 8601)

square-check

Timestamp of last update to the order

client_info object

Field
Type
Required
Description

full_name

string

square-check

Customer full name

phone_number

string

square-check

Customer phone number

email

string or null

square-x

Customer email

state

string

square-check

Customer state/region

city

string

square-check

Customer city

custom_fields array

Each field added by the merchant to their landing page:

Field
Type
Required
Description

field_id

integer

square-check

ID of the custom form field

field_name

string

square-check

Name of the custom field

custom_title

string

square-x

Label used on the landing page

value

string

square-check

Submitted value

item_id

string or null

square-x

Internal reference to the form entry

order_lines array

One entry per product ordered:

Field
Type
Required
Description

product_id

string

square-check

ID of the product ordered

product_name

string

square-check

Name of the product variant

variant_name

string

square-check

Variant description (e.g., size, color)

quantity

integer

square-check

Number of units ordered

unit_price

decimal

square-check

Price per unit

reduced_price

decimal or null

square-x

Discounted price if applicable

total_price

decimal

square-check

Final price (unit × quantity or discounted total)

sku

string

square-check

Product SKU

shipping_id

string or null

square-x

Product-specific shipping ID

bundle_lines array

Empty array if no bundles were ordered.

shop_info object

Field
Type
Required
Description

shop_id

string

square-check

Unique shop ID

shop_name

string

square-check

Store name

shop_subdomain

string

square-check

Store’s subdomain

landing_page_info object

Field
Type
Required
Description

landing_page_id

string

square-check

ID of the landing page

landing_page_title

string

square-check

Title shown on the landing page


Retry Behavior

  • If your endpoint responds with a non-2xx status 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_id to ensure idempotency

  • Expect 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