Webhooks

Create webhook

Creates a new webhook

Required permissions:

  • developer:manage_webhook
post/webhooks

Request body

api_version'v1' | 'v2' | 'v5'

The different API versions

child_resource_eventsboolean nullable

Whether or not to send events for child resources. For example, if the webhook is created for a Company, enabling this will only send events from the Company's sub-merchants (child companies).

enabledboolean nullable

Whether or not the webhook is enabled.

eventsWebhookEvent[] nullable

The events to send the webhook for.

resource_idstring nullable

The resource to create the webhook for. By default this will use current company

urlstring required

The URL to send the webhook to.

Example request

{
  "url": "https://example.com/path"
}

Response

A successful response

api_version'v1' | 'v2' | 'v5' required

The different API versions

child_resource_eventsboolean required

Whether events are sent for child resources. For example, if the webhook is on a company, enabling this sends events only from the company's sub-merchants (child companies).

created_atstring date-time required

The datetime the webhook was created.

enabledboolean required

Whether this webhook endpoint is currently active and receiving events.

eventsWebhookEvent[] required

The list of event types this webhook is subscribed to.

idstring required

The unique identifier for the webhook.

resource_idstring required

The ID of the resource (company or product) this webhook is attached to.

testable_eventsWebhookEvent[] required

The subset of subscribed event types that support sending test payloads.

urlstring required

The destination URL where webhook payloads are delivered via HTTP POST.

webhook_secretstring required

The secret key used to sign webhook payloads for verification. Include this in your HMAC validation logic.

Example response

{
  "created_at": "2023-12-01T05:00:00.401Z",
  "id": "hook_xxxxxxxxxxxxx",
  "url": "https://example.com/path",
  "webhook_secret": "whsec_abc123def456"
}

Changes