Webhook Endpoints
Register HTTPS endpoints that receive signed event notifications. Ching retries failed deliveries up to 3 times before giving up.
Use cases: Fulfill orders when a charge succeeds, provision access on subscription.created, or revoke access on subscription.canceled.
POST
/v1/webhooksRegister a webhook endpoint and receive the signing secret. Store the secret - it is only returned on creation.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
url | string | required | HTTPS URL that will receive POSTed events. |
events | array | required | Event types to subscribe to (e.g. ["charge.succeeded", "subscription.canceled"]). Use ["*"] to receive every event. |
Request
curl -X POST "https://api.ching.co.il/v1/webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "example_url",
"events": []
}'Response
Response
{
"success": true,
"data": {
"url": "https://example.com/webhooks/ching",
"events": [
"charge.succeeded",
"subscription.canceled"
],
"secret": "whsec_3n7mF0QbxoYRh9u7Gch6hUQwY4oiWyV0",
"active": true,
"livemode": false
}
}GET
/v1/webhooksList all webhook endpoints registered for the current mode.
Request
curl -X GET "https://api.ching.co.il/v1/webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true,
"data": [
{
"id": 1,
"url": "https://example.com/webhooks/ching",
"events": [
"charge.succeeded"
],
"active": true,
"livemode": false,
"created": "2026-04-19T08:00:00.000Z"
}
]
}DELETE
/v1/webhooks/:idDelete a webhook endpoint.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The webhook endpoint id. |
Request
curl -X DELETE "https://api.ching.co.il/v1/webhooks/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true
}