Managing webhooks
Creating webhooks
To create a webhook via the API:
GraphQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mutation {
webhookCreate(
input: {
url: "https://example.com/webhooks/zonos"
type: ORDER_CREATED
status: ENABLED
}
) {
id
url
type
status
}
}
Edit webhook details
To edit an existing webhook via the API:
GraphQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mutation {
webhookUpdate(
input: {
id: "webhook-id"
url: "https://example.com/webhooks/zonos"
type: ORDER_CREATED
status: ENABLED
}
) {
id
url
type
status
}
}
View webhook logs
To view webhook logs via the API:
GraphQL
1
2
3
4
5
6
7
8
9
10
11
12
13
query {
webhookLogs(first: 20, after: "yyyyyyy", filter: { type: ORDER_CREATED }) {
edges {
node {
id
type
url
createdAt
responseStatus
}
}
}
}
Event types
Zonos supports the following event types that you can subscribe to:
Webhook Type | Description |
---|---|
ORDER_CREATED | Triggered when a new order is created |
ORDER_CANCELED | Triggered when an order is canceled |
ORDER_STATUS_CHANGED | Triggered when an order's status changes |
SHIPMENT_CREATED | Triggered when a new shipment is created for an order |
SHIPMENT_CANCELED | Triggered when a shipment is canceled |
Listen to events with webhooks
Real-time event notifications for your Zonos integration.Webhooks provide a way for Zonos to proactively notify your external systems whenever certain events take place. When the subscribed event occurs, Zonos will send an HTTP POST request to the webhook URL you specify. The request body will contain the event details, allowing your system to handle the event programmatically.
Webhooks are useful for integrating Zonos with other platforms, triggering automated workflows, and keeping data in sync across systems in real-time. For example, you could use webhooks to: