KashuDocs

Webhook endpoints

The webhook endpoints endpoints of the Kashu API, with their parameters, objects, errors and examples. The guide explains how they fit together.

EndpointWhat it does
POST /v1/webhook_endpointsCreate a webhook endpoint. The response is the only place its signing secret appears.
GET /v1/webhook_endpointsList the webhook endpoints of the calling key's mode, newest first.
GET /v1/webhook_endpoints/{id}Retrieve a webhook endpoint.
POST /v1/webhook_endpoints/{id}Update a webhook endpoint: its URL, description and event types, or disable and enable it.
DELETE /v1/webhook_endpoints/{id}Delete a webhook endpoint. Kashu sends it nothing more.
POST /v1/webhook_endpoints/{id}/rollReplace the endpoint's signing secret at once. The response is the only place the new secret appears.

The webhook endpoint object

FieldTypeAbout
idstringAn id that starts we_.
objectstringAlways "webhook_endpoint".
urlstring
descriptionstring or null
enabled_eventsarray of enumOne of *, customer.created, customer.updated, payment.created, payment.updated, payment.requires_action, payment.requires_capture, payment.succeeded, payment.failed, payment.canceled, refund.created, refund.succeeded, refund.failed, subscription.created, subscription.updated, subscription.canceled, dispute.created, dispute.updated, checkout.session.completed, checkout.session.expired.
statusenumOne of enabled, disabled.
disabled_reasonenum or nullOne of requested, failing.
api_versionenumOne of 2026-11-06.
secretstring
secret_last4string
livemodeboolean
createdintegerUnix seconds.
{
  "id": "we_1a2B3c4D5e6F7g8H9i0J1k2L",
  "object": "webhook_endpoint",
  "url": "https://shop.example.com/kashu/webhooks",
  "description": "Order 1001",
  "enabled_events": [
    "customer.created"
  ],
  "status": "enabled",
  "disabled_reason": null,
  "api_version": "2026-11-06",
  "secret_last4": "aaaa",
  "livemode": false,
  "created": 1762473600
}

The deleted webhook endpoint object

FieldTypeAbout
idstringAn id that starts we_.
objectstringAlways "webhook_endpoint".
deletedbooleanAlways true.
{
  "id": "we_1a2B3c4D5e6F7g8H9i0J1k2L",
  "object": "webhook_endpoint",
  "deleted": true
}

POST /v1/webhook_endpoints

Create a webhook endpoint. The response is the only place its signing secret appears.

Scope
webhook_endpoints:write
Keys
Secret, or restricted with the scope below.
Idempotency-Key
Optional. Without one, Kashu makes one and returns it. See Idempotency.
Answers
201 with the Webhook endpoint.

Parameters

NameInTypeRequiredAbout
Idempotency-KeyheaderstringOptionalOptional. When absent, Kashu mints one and returns it. Up to 255 characters.
Kashu-VersionheaderstringOptionalThe API version to answer in. Defaults to the key's pinned version.

Request body

FieldTypeRequiredAbout
urlstringRequiredUp to 2048 characters.
enabled_eventsarray of enumRequiredOne of *, customer.created, customer.updated, payment.created, payment.updated, payment.requires_action, payment.requires_capture, payment.succeeded, payment.failed, payment.canceled, refund.created, refund.succeeded, refund.failed, subscription.created, subscription.updated, subscription.canceled, dispute.created, dispute.updated, checkout.session.completed, checkout.session.expired. Up to 20 items.
descriptionstringOptionalUp to 200 characters.

Errors

Examples

curl https://api.kashupay.com/v1/webhook_endpoints \
  -H "Authorization: Bearer $KASHU_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://shop.example.com/kashu/webhooks","enabled_events":["customer.created"]}'
const webhookEndpoint = await kashu("POST", "/v1/webhook_endpoints", {
  "url": "https://shop.example.com/kashu/webhooks",
  "enabled_events": [
    "customer.created"
  ]
});
console.log(webhookEndpoint.status);

GET /v1/webhook_endpoints

List the webhook endpoints of the calling key's mode, newest first.

Scope
webhook_endpoints:read
Keys
Secret, or restricted with the scope below.
Idempotency-Key
Not used. A read changes nothing.
Answers
200 with a list of Webhook endpoint, newest first.

Parameters

NameInTypeRequiredAbout
limitqueryintegerOptionalAt least 1. Up to 100. Defaults to 10.
cursorquerystringOptional
Kashu-VersionheaderstringOptionalThe API version to answer in. Defaults to the key's pinned version.

Errors

Examples

curl "https://api.kashupay.com/v1/webhook_endpoints?limit=3" \
  -H "Authorization: Bearer $KASHU_SECRET_KEY"
const list = await kashu("GET", "/v1/webhook_endpoints?limit=3");
console.log(list.has_more);

GET /v1/webhook_endpoints/{id}

Retrieve a webhook endpoint.

Scope
webhook_endpoints:read
Keys
Secret, or restricted with the scope below.
Idempotency-Key
Not used. A read changes nothing.
Answers
200 with the Webhook endpoint.

Parameters

NameInTypeRequiredAbout
idpathstringRequiredAn id that starts we_.
Kashu-VersionheaderstringOptionalThe API version to answer in. Defaults to the key's pinned version.

Errors

Examples

curl https://api.kashupay.com/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L \
  -H "Authorization: Bearer $KASHU_SECRET_KEY"
const webhookEndpoint = await kashu("GET", "/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L");
console.log(webhookEndpoint.status);

POST /v1/webhook_endpoints/{id}

Update a webhook endpoint: its URL, description and event types, or disable and enable it.

Scope
webhook_endpoints:write
Keys
Secret, or restricted with the scope below.
Idempotency-Key
Optional. Without one, Kashu makes one and returns it. See Idempotency.
Answers
200 with the Webhook endpoint.

Parameters

NameInTypeRequiredAbout
idpathstringRequiredAn id that starts we_.
Idempotency-KeyheaderstringOptionalOptional. When absent, Kashu mints one and returns it. Up to 255 characters.
Kashu-VersionheaderstringOptionalThe API version to answer in. Defaults to the key's pinned version.

Request body

FieldTypeRequiredAbout
urlstringOptionalUp to 2048 characters.
enabled_eventsarray of enumOptionalOne of *, customer.created, customer.updated, payment.created, payment.updated, payment.requires_action, payment.requires_capture, payment.succeeded, payment.failed, payment.canceled, refund.created, refund.succeeded, refund.failed, subscription.created, subscription.updated, subscription.canceled, dispute.created, dispute.updated, checkout.session.completed, checkout.session.expired. Up to 20 items.
descriptionstring or nullOptionalUp to 200 characters.
disabledbooleanOptional

Errors

Examples

curl https://api.kashupay.com/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L \
  -H "Authorization: Bearer $KASHU_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"disabled":false}'
const webhookEndpoint = await kashu("POST", "/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L", {
  "disabled": false
});
console.log(webhookEndpoint.status);

DELETE /v1/webhook_endpoints/{id}

Delete a webhook endpoint. Kashu sends it nothing more.

Scope
webhook_endpoints:write
Keys
Secret, or restricted with the scope below.
Idempotency-Key
Optional. Without one, Kashu makes one and returns it. See Idempotency.
Answers
200 with the Deleted webhook endpoint.

Parameters

NameInTypeRequiredAbout
idpathstringRequiredAn id that starts we_.
Idempotency-KeyheaderstringOptionalOptional. When absent, Kashu mints one and returns it. Up to 255 characters.
Kashu-VersionheaderstringOptionalThe API version to answer in. Defaults to the key's pinned version.

Request body

Send no body, or an empty JSON object.

Errors

Examples

curl https://api.kashupay.com/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L \
  -X DELETE \
  -H "Authorization: Bearer $KASHU_SECRET_KEY"
const deleted = await kashu("DELETE", "/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L");
console.log(deleted.id);

POST /v1/webhook_endpoints/{id}/roll

Replace the endpoint's signing secret at once. The response is the only place the new secret appears.

Scope
webhook_endpoints:write
Keys
Secret, or restricted with the scope below.
Idempotency-Key
Optional. Without one, Kashu makes one and returns it. See Idempotency.
Answers
200 with the Webhook endpoint.

Parameters

NameInTypeRequiredAbout
idpathstringRequiredAn id that starts we_.
Idempotency-KeyheaderstringOptionalOptional. When absent, Kashu mints one and returns it. Up to 255 characters.
Kashu-VersionheaderstringOptionalThe API version to answer in. Defaults to the key's pinned version.

Request body

Send no body, or an empty JSON object.

Errors

Examples

curl https://api.kashupay.com/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L/roll \
  -X POST \
  -H "Authorization: Bearer $KASHU_SECRET_KEY"
const webhookEndpoint = await kashu("POST", "/v1/webhook_endpoints/we_1a2B3c4D5e6F7g8H9i0J1k2L/roll");
console.log(webhookEndpoint.status);