API Reference
Webhook Endpoints
A webhook endpoint is a URL on your server that LuniPay calls when events happen. Register one per environment, store the signing secret, and verify every request.
Webhook endpoints are scoped per livemode — a test-mode endpoint never receives live events, and vice versa. LuniPay signs every delivery with HMAC-SHA256 over `timestamp.payload` and sends it as `LuniPay-Signature: t=...,v1=...`. Failed deliveries retry with exponential backoff over ~10.5 hours.
The webhook_endpoint object
idstringUnique identifier, prefixed with `we_`.
objectstringAlways `"webhook_endpoint"`.
livemodebooleanWhether this endpoint receives test or live events.
urlstringYour HTTPS URL that receives POST deliveries.
descriptionstringnullableInternal label for the dashboard.
enabled_eventsarrayList of event types this endpoint subscribes to. Use `["*"]` to receive everything.
is_activebooleanPause deliveries without deleting the endpoint.
signing_secretstringThe `whsec_…` secret used to verify request signatures. **Only returned once — on create.** Store it immediately.
createdintegerCreation timestamp (unix).
updatedintegerLast-updated timestamp (unix).
{
"id": "we_01JRZKC5PRGHKV82AW7XNMFD9H",
"object": "webhook_endpoint",
"livemode": false,
"url": "https://example.com/webhooks/lunipay",
"description": "Production webhook receiver",
"enabled_events": [
"checkout.session.completed",
"payment.succeeded",
"payment.failed"
],
"is_active": true,
"signing_secret": "whsec_shown_once_on_create_only",
"created": 1713100800,
"updated": 1713100800
}Endpoints
- POST
/v1/webhook-endpointsCreate a webhook endpointRegisters a new webhook endpoint. The signing secret is returned once.
- GET
/v1/webhook-endpoints/:idRetrieve a webhook endpointFetches a webhook endpoint by id. Does not return the signing secret.
- PATCH
/v1/webhook-endpoints/:idUpdate a webhook endpointUpdates url, enabled events, description, or active state.
- GET
/v1/webhook-endpointsList webhook endpointsReturns all webhook endpoints registered for the current livemode.
- DELETE
/v1/webhook-endpoints/:idDelete a webhook endpointPermanently deletes a webhook endpoint.