BETA: Please note that the current endpoints are considered beta. It is possible there may be changes before these endpoints are finalised.

Webhooks

List subscriptions

List all webhooks

get /organizations/{organizationId}/webhooks

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID

Responses

200: OK response.Webhook[]
[
  {
    "events": [
      "customer.created",
      "customer.updated"
    ],
    "id": "Rerum voluptatibus veritatis voluptates voluptas iure et.",
    "ref": "my_webhook",
    "url": "https://externalapp.com/hookcallback"
  },
  {
    "events": [
      "customer.created",
      "customer.updated"
    ],
    "id": "Rerum voluptatibus veritatis voluptates voluptas iure et.",
    "ref": "my_webhook",
    "url": "https://externalapp.com/hookcallback"
  },
  {
    "events": [
      "customer.created",
      "customer.updated"
    ],
    "id": "Rerum voluptatibus veritatis voluptates voluptas iure et.",
    "ref": "my_webhook",
    "url": "https://externalapp.com/hookcallback"
  }
]
404: not_found: Not Found response.

Create or Update a subscription

Set webhook

put /organizations/{organizationId}/webhooks/{webhookRef}

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
webhookRefstringpath

Request Body

WebhookPayload
{
  "events": [
    "customer.created",
    "customer.updated"
  ],
  "secret": "yRtqyP5eoWRkvC68fYe9",
  "url": "https://externalapp.com/hookcallback"
}

Responses

200: OK response.Webhook
{
  "events": [
    "customer.created",
    "customer.updated"
  ],
  "id": "Deleniti delectus animi dolor iusto rerum.",
  "ref": "my_webhook",
  "url": "https://externalapp.com/hookcallback"
}

Delete a subscription

Delete webhook

delete /organizations/{organizationId}/webhooks/{webhookRef}

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
webhookRefstringpath

Responses

204: No Content response.

Models

Webhook

An organization webhook

NameTypeDescription
idstring(optional)
refstring
urlstring
eventsstring[]Events to subscribe to on this webhook

WebhookPayload

NameTypeDescription
secretstring(optional)
urlstring
eventsstring[]Events to subscribe to on this webhook

In this article