Webhook endpoints

Manage the URLs that receive your webhooks from code.

The webhook endpoint object

idstring
Starts with we_.
objectstring
Always webhook_endpoint.
livemodeboolean | null
true live only, false test only, null both modes.
urlstring
HTTPS URL we POST events to.
enabled_eventsstring[]
Event types to send. Empty means all.
statusenum
enabled or disabled.
descriptionstring | null
Your note.
created_attimestamp
When it was created.
secretstring
Signing secret. Only in the create response; store it then.
A webhook endpoint
{
  "id": "we_9Ab1Cd3Ef5Gh7Ij9Kl1Mn3",
  "object": "webhook_endpoint",
  "livemode": null,
  "url": "https://shop.example.com/webhooks/klink-pay",
  "enabled_events": [
    "payment.succeeded",
    "payment.failed",
    "refund.succeeded"
  ],
  "status": "enabled",
  "description": "Order fulfilment",
  "created_at": "2026-11-27T09:00:00Z"
}

Create a webhook endpoint

POST/v1/webhook_endpoints

Body

urlstringrequired
HTTPS URL.
enabled_eventsstring[]
Default: all events.
livemodeboolean | null
Which mode to listen to; null for both.
descriptionstring
Your note.
Request
curl https://sandbox-api.klinkpay.net/v1/webhook_endpoints \
  -X POST \
  -H "Authorization: Bearer kp_test_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://shop.example.com/webhooks/klink-pay",
    "enabled_events": [
      "payment.succeeded",
      "payment.failed",
      "refund.succeeded"
    ],
    "description": "Order fulfilment"
  }'
Response (secret shown once)
{
  "id": "we_9Ab1Cd3Ef5Gh7Ij9Kl1Mn3",
  "object": "webhook_endpoint",
  "livemode": null,
  "url": "https://shop.example.com/webhooks/klink-pay",
  "enabled_events": [
    "payment.succeeded",
    "payment.failed",
    "refund.succeeded"
  ],
  "status": "enabled",
  "description": "Order fulfilment",
  "created_at": "2026-11-27T09:00:00Z",
  "secret": "whsec_…"
}
Requires webhook_endpoints:write on restricted keys. Rotating a secret, editing and the delivery log are in the dashboard.

List webhook endpoints

GET/v1/webhook_endpoints

Requires webhook_endpoints:read. Secrets are never included.

Request
curl https://sandbox-api.klinkpay.net/v1/webhook_endpoints \
  -H "Authorization: Bearer kp_test_…"
Response
{
  "object": "list",
  "data": [
    {
      "id": "we_9Ab1Cd3Ef5Gh7Ij9Kl1Mn3",
      "object": "webhook_endpoint",
      "livemode": null,
      "url": "https://shop.example.com/webhooks/klink-pay",
      "enabled_events": [
        "payment.succeeded",
        "payment.failed",
        "refund.succeeded"
      ],
      "status": "enabled",
      "description": "Order fulfilment",
      "created_at": "2026-11-27T09:00:00Z"
    }
  ],
  "has_more": false
}

Delete a webhook endpoint

DELETE/v1/webhook_endpoints/:id

Stops all deliveries to the endpoint.

Request
curl https://sandbox-api.klinkpay.net/v1/webhook_endpoints/we_9Ab1Cd3Ef5Gh7Ij9Kl1Mn3 \
  -X DELETE \
  -H "Authorization: Bearer kp_test_…"