Skip to main content
POST
Create Webhook
Subtotal Connector tool: create_webhook

Access

Call this endpoint with your API key, or with a Subtotal Connector OAuth token that includes webhooks:write. A token without webhooks:write receives 403 insufficient_scope. Partner app tokens don’t include it.

Example

A new webhook starts paused unless the request sets is_active to true, as in this example. Use event_types names from Event types; an unknown name returns a 422 that lists the valid names.
signing_secret is returned only in this response and can’t be read back. Store it now and use it to verify webhook signatures. If you lose it, delete the webhook and create a new one.

URL requirements

  • https, on port 443, with no username or password in the URL.
  • The host must resolve, and only to public IP addresses. A host that resolves to a private, loopback, link-local or other non-public address is rejected.

Errors

Headers

authorization
string | null
x-api-key
string | null

Body

application/json
name
string
required

Unique per account.

Required string length: 1 - 64
url
string
required

HTTPS URL on port 443 that receives the events.

Maximum string length: 256
event_types
string[]
required

Event names to subscribe to, e.g. purchase.created.

Minimum array length: 1
is_active
boolean
default:false

Start delivering immediately. By default the webhook is created paused.

receive_simulated_events
boolean
default:false
purchase_date_start
string<date> | null
purchase_date_end
string<date> | null

Response

Successful Response

webhook_id
string
required
name
string
required
url
string
required
is_active
boolean
required
event_types
string[]
required

Subscribed event names, e.g. purchase.created.

receive_simulated_events
boolean
required

Also deliver events from the simulator.

purchase_date_start
string<date> | null
required

Only purchases on or after this date; null = unbounded.

purchase_date_end
string<date> | null
required

Only purchases on or before this date; null = unbounded.

created_at
string<date-time>
required
signing_secret
string
required

Verifies the X-Subtotal-Signature header. Shown only in this response; store it now.