Skip to main content
POST
/
api
/
canary
/
webhook-endpoints
Create Webhook Endpoint
curl --request POST \
  --url http://localhost:3000/api/canary/webhook-endpoints \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "events": [
    "<string>"
  ],
  "metadata": {
    "environment": "production"
  }
}
'
{
  "id": "webhook_001",
  "merchantId": "merchant_456",
  "url": "https://example.com/webhooks",
  "events": [
    "checkout.session.completed",
    "purchase.succeeded",
    "transfer.completed"
  ],
  "active": true,
  "metadata": {},
  "createdAt": "2025-01-15T10:30:00.000Z",
  "updatedAt": "2025-01-15T10:30:00.000Z"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Webhook endpoint details

url
string
required

The URL where webhook events will be sent

events
string[]
required

Array of event types to listen for

metadata
object
required

Optional custom metadata

Example:
{ "environment": "production" }
merchantId
string

The ID of the merchant whose balance is being requested. If omitted, defaults to the authenticated merchant.

Response

Webhook endpoint created successfully

id
string
required
merchantId
string
required
url
string
required
events
string[]
required
active
boolean
required
metadata
object
required
Example:
{ "environment": "production" }
createdAt
string<date-time>
required
updatedAt
string<date-time>
required