API reference
Webhooks and events
Manage endpoints, read the event history and resend events. Details in the guide →
- GET/v1/webhook-endpointsList webhook endpoints
- POST/v1/webhook-endpointsAdd a webhook endpoint (the signing secret is returned once)
- GET/v1/webhook-endpoints/{id}Retrieve a webhook endpoint
- PATCH/v1/webhook-endpoints/{id}Update a webhook endpoint
- DELETE/v1/webhook-endpoints/{id}Delete a webhook endpoint
- POST/v1/webhook-endpoints/{id}/rotate-secretRotate the signing secret (old secret keeps signing for 24 h)
- GET/v1/eventsList events
- POST/v1/events/{id}/resendRe-deliver an event to all matching endpoints
/v1/webhook-endpointsList webhook endpoints
readKey: live or testResponses
- 200 OKJSON response
curl https://hisarpay.com/v1/webhook-endpoints \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/webhook-endpointsAdd a webhook endpoint (the signing secret is returned once)
webhooksKey: live onlyRequest body
urlstring (url)required≤ 2048 chars
eventsarray<string>optionalValues:
invoice.paidinvoice.overpaidinvoice.partialinvoice.expiredinvoice.cancelledinvoice.payment_receivedwithdrawal.completedwithdrawal.failedwithdrawal.rejectedtest.ping≤ 10 items
descriptionstringoptional≤ 200 chars
Responses
- 200 OKJSON response
curl -X POST https://hisarpay.com/v1/webhook-endpoints \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"url": "https://shop.example/webhooks/hisarpay",
"events": [
"invoice.paid",
"invoice.expired"
]
}'/v1/webhook-endpoints/{id}Retrieve a webhook endpoint
readKey: live or testPath parameters
idstring (uuid)requiredThe record id.
Responses
- 200 OKJSON response
curl https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/webhook-endpoints/{id}Update a webhook endpoint
webhooksKey: live onlyPath parameters
idstring (uuid)requiredThe record id.
Request body
urlstring (url)optional≤ 2048 chars
eventsarray<string>optionalValues:
invoice.paidinvoice.overpaidinvoice.partialinvoice.expiredinvoice.cancelledinvoice.payment_receivedwithdrawal.completedwithdrawal.failedwithdrawal.rejectedtest.ping≤ 10 items
descriptionstringoptional≤ 200 chars
enabledbooleanoptional
Responses
- 200 OKJSON response
curl -X PATCH https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'/v1/webhook-endpoints/{id}Delete a webhook endpoint
webhooksKey: live onlyPath parameters
idstring (uuid)requiredThe record id.
Responses
- 200 OKEmpty response
curl -X DELETE https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/webhook-endpoints/{id}/rotate-secretRotate the signing secret (old secret keeps signing for 24 h)
webhooksKey: live onlyPath parameters
idstring (uuid)requiredThe record id.
Responses
- 200 OKJSON response
curl -X POST https://hisarpay.com/v1/webhook-endpoints/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b/rotate-secret \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/eventsList events
readKey: live or testQuery parameters
typestringoptionalOnly events of this type.
Values:
invoice.paidinvoice.overpaidinvoice.partialinvoice.expiredinvoice.cancelledinvoice.payment_receivedwithdrawal.completedwithdrawal.failedwithdrawal.rejectedtest.pinglimitintegeroptionalPage size.
1–100
beforestring (date-time)optionalnext_before from the previous response, for the next page.
pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Responses
- 200 OKJSON response
curl "https://hisarpay.com/v1/events?limit=20" \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/events/{id}/resendRe-deliver an event to all matching endpoints
At most 30 resends per minute per account; more answer rate_limited.
webhooksKey: live onlyPath parameters
idstring (uuid)requiredThe record id.
Responses
- 200 OKJSON response
curl -X POST https://hisarpay.com/v1/events/0b6a3f52-3c1d-4a7e-8f4b-1d2c3e4f5a6b/resend \
-H "Authorization: Bearer $HISARPAY_API_KEY"