Webhook Events

Events that happen and are delivered to a webhook endpoint.

api_version
string

Duffel API version

Example: "v2"
created_at
datetime

The ISO 8601 datetime at which the webhook event was created

Example: "2020-04-11T15:48:11.642Z"
data
objectnullable

The webhook event data

id
string

Duffel's unique identifier for the webhook event

Example: "wev_0000A3tQSmKyqOrcySrGbo"
idempotency_key
string

Duffel's unique identifier for the related object

Example: "ord_0000ABd6wggSct7BoraU1o"
live_mode
boolean

The live mode that the webhook was created in. It will only receive events for that same live mode. For example, you won't receive order.created events for orders that you created in the sandbox, if your webhook is for live_mode: true.

Example: true
type
string

The type of the webhook event

Example: "order.created"

Trigger a re-delivery of an event to a webhook.

URL parameters

id
stringrequired

Duffel's unique identifier for the webhook event

Example: "wev_0000A3tQSmKyqOrcySrGbo"

Endpoint

POST https://api.duffel.com/air/webhooks/events/{id}/actions/redeliver

Request

curl -X POST --compressed "https://api.duffel.com/air/webhooks/events/{id}/actions/redeliver" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

No response body

Retrieves a webhook event by its ID.

URL parameters

id
stringrequired

Duffel's unique identifier for the webhook event

Example: "wev_0000A3tQSmKyqOrcySrGbo"

Endpoint

GET https://api.duffel.com/air/webhooks/events/{id}

Request

curl -X GET --compressed "https://api.duffel.com/air/webhooks/events/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"data": {
"type": "order.created",
"live_mode": true,
"idempotency_key": "ord_0000ABd6wggSct7BoraU1o",
"id": "wev_0000A3tQSmKyqOrcySrGbo",
"created_at": "2020-04-11T15:48:11.642Z",
"api_version": "v2"
}
}

Retrieve a paginated list of webhook events

Query parameters

limit
integer

The maximum number of records to return per page. Defaults to 50. May be set to any integer between 1 and 200. For more information on how to paginate through records, see the Pagination section.

Example: 1
Default value: 50
before
string

A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
after
string

A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
created_at
object

Filters the returned webhook events by creation datetime.

type
string

Filters webhook events by their type.

Example: "order.created"
delivery_success
boolean

Webhook events will be included if they have a successful delivery.

Example: true

Endpoint

GET https://api.duffel.com/air/webhooks/events

Request

curl -X GET --compressed "https://api.duffel.com/air/webhooks/events?limit=1&before=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&after=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&created_at=undefined&type=order.created&delivery_success=true" \
-H "Accept: application/json" \
-H "Accept-Encoding: gzip" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"meta": {
"limit": 50,
"after": "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
},
"data": [
{
"type": "order.created",
"live_mode": true,
"idempotency_key": "ord_0000ABd6wggSct7BoraU1o",
"id": "wev_0000A3tQSmKyqOrcySrGbo",
"created_at": "2020-04-11T15:48:11.642Z",
"api_version": "v2"
}
]
}