POST
/
webhooks

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Defines a webhook rule to an external server. The callback URL will receive a POST request with the related object's (e.g. Purchase for purchase.* webhooks) data in body when any of the events (see the description of events field below) it is configured to listen for are triggered. The payload object will additionally include an "event_type" field to indicate which event type (see the Webhook.events field) triggered the webhook.

Note that, as well as with the rest of dataset, test and live Webhooks are separate; test webhooks will not handle events caused by live Purchases, and vice-versa.

callback
string
required
Maximum length: 500
events
enum<string>[]
required

List of events to trigger webhook callbacks for. Either this or all_events is required.

Available options:
purchase.created,
purchase.paid,
purchase.payment_failure,
purchase.pending_execute,
purchase.pending_charge,
purchase.cancelled,
purchase.hold,
purchase.captured,
purchase.pending_capture,
purchase.released,
purchase.pending_release,
purchase.preauthorized,
purchase.pending_recurring_token_delete,
purchase.recurring_token_deleted,
purchase.subscription_charge_failure,
purchase.pending_refund,
payment.refunded,
billing_template_client.subscription_billing_cancelled,
payout.pending,
payout.failed,
payout.success
title
string
required

Arbitrary title of webhook

Maximum length: 100
all_events
boolean
default:
false

Specifies this webhook should trigger on all event types. Either this or events is required.

public_key
string

PEM-encoded RSA public key for authenticating webhook or callback payloads

Response

201 - application/json

Defines a webhook rule to an external server. The callback URL will receive a POST request with the related object's (e.g. Purchase for purchase.* webhooks) data in body when any of the events (see the description of events field below) it is configured to listen for are triggered. The payload object will additionally include an "event_type" field to indicate which event type (see the Webhook.events field) triggered the webhook.

Note that, as well as with the rest of dataset, test and live Webhooks are separate; test webhooks will not handle events caused by live Purchases, and vice-versa.

callback
string
required
Maximum length: 500
events
enum<string>[]
required

List of events to trigger webhook callbacks for. Either this or all_events is required.

Available options:
purchase.created,
purchase.paid,
purchase.payment_failure,
purchase.pending_execute,
purchase.pending_charge,
purchase.cancelled,
purchase.hold,
purchase.captured,
purchase.pending_capture,
purchase.released,
purchase.pending_release,
purchase.preauthorized,
purchase.pending_recurring_token_delete,
purchase.recurring_token_deleted,
purchase.subscription_charge_failure,
purchase.pending_refund,
payment.refunded,
billing_template_client.subscription_billing_cancelled,
payout.pending,
payout.failed,
payout.success
title
string
required

Arbitrary title of webhook

Maximum length: 100
all_events
boolean
default:
false

Specifies this webhook should trigger on all event types. Either this or events is required.

created_on
integer

Object creation time

id
string
public_key
string

PEM-encoded RSA public key for authenticating webhook or callback payloads

type
string

Object type identifier

updated_on
integer

Object last modification time