Webhooks
Webhooks allow your application to receive real-time HTTP notifications when events occur in ZenFlow. Instead of polling the API, webhooks push data to your server as soon as something happens.How It Works
- Subscribe to one or more topics (events)
- When an event occurs, ZenFlow sends a POST to your URL
- Your server responds with
2xxto acknowledge receipt - If delivery fails, ZenFlow retries with exponential backoff
Subscribe to Webhooks
To receive notifications, create a webhook specifying your URL and the events you’re interested in:Available Topics
Orders
order/created
order/created
Triggered when a new order is created in ZenFlow.Payload:
| Field | Type | Description |
|---|---|---|
order_id | integer | Internal order ID |
order_tenant_id | string | Order ID in your system |
state_id | integer | Current state ID |
state_name | string | State name |
warehouse_id | integer | Assigned warehouse ID |
items_count | integer | Number of line items |
total_quantity | integer | Total units |
source | string | Origin: api, integration, manual |
source_integration | string | Source integration (if applicable) |
order/updated
order/updated
Triggered when order details are modified (state, items, etc).Payload:
| Field | Type | Description |
|---|---|---|
previous_state_id | integer | Previous state |
previous_state_name | string | Previous state name |
updated_fields | array | Fields that were modified |
order/cancelled
order/cancelled
Triggered when an order is cancelled.Payload:
| Field | Type | Description |
|---|---|---|
cancellation_reason | string | Cancellation reason |
cancelled_by | string | User who cancelled |
order/completed
order/completed
Triggered when an order completes fulfillment (picked and ready for shipping).Payload:
| Field | Type | Description |
|---|---|---|
items_picked | integer | Lines picked |
total_quantity_picked | integer | Total units picked |
picked_by | string | Operator who picked |
duration_minutes | integer | Picking time |
Products
product/created
product/created
Triggered when a new product is created.Payload:
product/updated
product/updated
Triggered when product details are modified.Payload:
product/deleted
product/deleted
Triggered when a product is deleted.Payload:
Stock
stock/updated
stock/updated
Triggered when a product’s stock level changes at a location.Payload:
| Field | Type | Description |
|---|---|---|
quantity | integer | New quantity |
previous_quantity | integer | Previous quantity |
change | integer | Difference (+ or -) |
reason | string | Reason for change |
reference_id | string | Reference ID (order, adjustment, etc) |
reason values:order_fulfillment- Order pickingmanual_adjustment- Manual adjustmentstock_receipt- Goods receipttransfer- Location transferreturn- Returninventory_count- Inventory count
stock/low_alert
stock/low_alert
Triggered when a product’s stock falls below the configured minimum threshold.Payload:
| Field | Type | Description |
|---|---|---|
current_quantity | integer | Current stock |
minimum_threshold | integer | Configured minimum threshold |
suggested_reorder | integer | Suggested reorder quantity |
stock/movement_created
stock/movement_created
Triggered when a stock movement is recorded (receipt, dispatch, transfer).Payload:
| Field | Type | Description |
|---|---|---|
type | string | Type: receipt, dispatch, transfer, adjustment |
from_location | string | Source location (null if receipt) |
to_location | string | Destination location (null if dispatch) |
Picking Flows
flow/started
flow/started
Triggered when an operator starts a picking flow.Payload:
flow/completed
flow/completed
Triggered when a picking flow completes successfully.Payload:
flow/cancelled
flow/cancelled
Triggered when a picking flow is cancelled.Payload:
Payload Structure
All payloads follow this base structure:| Field | Type | Description |
|---|---|---|
id | string | Unique event ID (use for idempotency) |
event | string | Event topic |
created_at | string | ISO 8601 timestamp |
data | object | Event-specific payload |
Verifying Webhooks
Always verify webhook signatures to ensure requests come from ZenFlow.Signature Format
ZenFlow includes a signature in theX-Webhook-Signature header:
t: Unix timestamp when the webhook was sentv1: HMAC-SHA256 signature
Verification Process
Retry Policy
If webhook delivery fails, ZenFlow retries with exponential backoff:| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 1 second |
| 3 | 2 seconds |
| 4 (final) | 4 seconds |
- Your server returns a non-2xx status code
- Connection times out (30 seconds default)
- SSL/TLS errors occur
Best Practices
Respond Quickly
Return 200 immediately, process async
Handle Duplicates
Use event ID for idempotency
Verify Signatures
Always validate webhook signatures
Use HTTPS
Only use HTTPS webhook URLs



