Create Webhook
POSThttps://api.goodsdelivery.io/v1/webhooks
Authorization: x-api-key
name: x-api-keytype: apiKeyscopes: brand
in: header
You can create webhooks to receive notifications about specific events related to objects like deliveries and returns. After creating a webhook, your configured endpoint will start receiving POST requests. This allows your application to execute code and/or trigger actions, instead of making periodic API calls.
When consuming webhook notifications, it is required that you respond with a status code of 200
. We use this response as confirmation that the notification has reached your endpoint. If a webhook notification receives a response with a status code other than 200
, we will disable the webhook after a number of re-attempts.
Currently we have released so you can create webhooks on the following events:
- DELIVERY_STATUS_UPDATED
- RETURN_STATUS_UPDATED
- ETA_AND_COORDINATES
- DELIVERY_CREATED
- RETURN_CREATED
Request
- application/json
Body
required
Create a webhook for Goods to send updates about deliveries/returns to.
Where should we send notifications to.
ID of the related brand. If provided, only notifications related to this brand will be send out. For non-internal uses, the responses will be limited by brandId associated with authenticated account.
Possible values: [DELIVERY_STATUS_UPDATED
, RETURN_STATUS_UPDATED
, DELIVERY_CREATED
, RETURN_CREATED
, ETA_AND_COORDINATES
]
What types of events do we want to subscribe to.
additionalHeaders object[]
Responses
- 201
- 400
If the webhook request is valid, a 201 response will include the ID of the requested webhook, along with its scope and brand.
If the webhook request is invalid, an error response will be provided that explains the specific problem. For example, webhooks must use HTTPS, the specified domain cannot be used as a webhook endpoint, or the specified scope is not valid.
- application/json
- Schema
- Example (from schema)
- Example
Schema
object objectrequired
{
"success": true,
"object": {
"id": "string",
"url": "string",
"brandId": "string",
"scopes": [
"DELIVERY_STATUS_UPDATED"
],
"additionalHeaders": [
{
"key": "string",
"value": "string"
}
]
}
}
{
"success": true,
"object": {
"id": "AEYZkzx5htgbitz3x456",
"url": "https://your-domain.com/goodsWebhook",
"brandId": "HDYZkzx5htgbitz3x4ij",
"scopes": [
"DELIVERY_STATUS_UPDATED"
],
"additionalHeaders": [
{
"key": "authorization",
"value": "Bearer dnweiuhfsknfsuiehfweiafbuise"
}
]
}
}
Bad request
- application/json
- Schema
- Example (from schema)
Schema
Human readable error message.
Machine readable error message.
More help on the error here.
{
"message": "string",
"code": "string",
"more": "string"
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://api.goodsdelivery.io/v1/webhooks' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-api-key: <API_KEY_VALUE>' \
--data-raw '{
"url": "string",
"brandId": "string",
"scopes": [
"DELIVERY_STATUS_UPDATED"
],
"additionalHeaders": [
{
"key": "string",
"value": "string"
}
]
}'