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

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

merchantId
string

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

metadata
object

Optional custom metadata

Example:
{ "environment": "production" }

Response

Webhook endpoint created successfully

id
string
required

Unique identifier for the webhook endpoint

merchantId
string
required

The merchant ID this webhook belongs to

url
string
required

The URL where webhook events are sent

events
string[]
required

Array of event types subscribed to

active
boolean
required

Whether the webhook endpoint is active

createdAt
string<date-time>
required

When the webhook endpoint was created

updatedAt
string<date-time>
required

When the webhook endpoint was last updated

metadata
object

Custom metadata attached to the webhook endpoint

Example:
{ "environment": "production" }
deletedAt
string<date-time>

When the webhook endpoint was deleted (soft delete)