Skip to main content

Create Webhook

POST 

https://api.goodsdelivery.io/v1/webhooks

Authorization: x-api-key

name: x-api-keytype: apiKeyscopes: brandin: 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

Body

required

Create a webhook for Goods to send updates about deliveries/returns to.

    url urlrequired

    Where should we send notifications to.

    brandId stringrequired

    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.

    scopes string[]required

    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[]
  • Array [
  • key stringrequired
    value stringrequired
  • ]

Responses

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.

Schema
    success booleanrequired
    object objectrequired
    id stringrequired

    Webhook ID

    url urlrequired

    Where should we send notifications to.

    brandId stringrequired

    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.

    scopes string[]required

    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[]
  • Array [
  • key stringrequired
    value stringrequired
  • ]
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"
}
]
}'
Request Collapse all
Base URL
https://api.goodsdelivery.io/v1
Auth
Body required
{
"url": "string",
"brandId": "string",
"scopes": [
"DELIVERY_STATUS_UPDATED"
],
"additionalHeaders": [
{
"key": "string",
"value": "string"
}
]
}
ResponseClear

Click the Send API Request button above and see the response here!