Managing webhook subscriptions via the API

In addition to the web app control panel, you can create and manage webhook subscriptions programmatically through the public API using your API key.

📘

Authentication

All endpoints below require your API key. Add the token as the Authorization header value directly, with no Bearer prefix (the same way as the rest of the public API — see Starting with the API). For example: Authorization: <your-token>.

❗️

Supported events

The public API currently supports two events: invoice_status (event ID 6) and payment_status_changed (event ID 1). The selectedEvents field accepts an array of these event IDs.

List available events

Returns the webhook events you can subscribe to via the public API.

GET /api/v1/webhooks/events

Example response

{
  "events": [
    {
      "id": 6,
      "name": "invoice_status",
      "description": "status of the invoice and details of the invoice"
    },
    {
      "id": 1,
      "name": "payment_status_changed",
      "description": "status changes for payments, including direct payments"
    }
  ]
}

Create a webhook subscription

POST /api/v1/webhooks/subscriptions

Request body

NameTypeDescriptionRequired
urlstringThe HTTPS URL that will receive webhook deliveriesyes
secretstringA secret used to generate the HMAC SHA-256 signature for delivered payloadsno
selectedEventsnumber[]Event IDs to subscribe to (6 = invoice_status, 1 = payment_status_changed)yes
isActivebooleanWhether the subscription is activeyes

Example request

{
  "url": "https://your-app.com/webhooks/snaprefund",
  "secret": "your-secret-key",
  "selectedEvents": [6],
  "isActive": true
}

Example response

{
  "id": 1,
  "url": "https://your-app.com/webhooks/snaprefund",
  "isSecretExists": true,
  "isActive": true,
  "selectedEvents": [6]
}

List your webhook subscriptions

GET /api/v1/webhooks/subscriptions

Returns a paginated list of the webhook subscriptions belonging to your account.

Get a webhook subscription by ID

GET /api/v1/webhooks/subscriptions/{id}

Update a webhook subscription

PUT /api/v1/webhooks/subscriptions/{id}

Accepts the same body as create. Use this to change the url, rotate the secret, toggle isActive, or update selectedEvents.

Delete a webhook subscription

DELETE /api/v1/webhooks/subscriptions/{id}

Example response

{
  "message": "Webhook subscription deleted successfully",
  "deletedSubscription": {
    "id": 1,
    "url": "https://your-app.com/webhooks/snaprefund"
  }
}