POST request to a URL you control. Your server receives the event, verifies its authenticity using the HMAC signature, and takes whatever action your application requires.
Create a webhook endpoint
Register a publicly reachable HTTPS URL with Borga and specify which event types you want to receive.The response includes a
secret (prefixed whsec_…). Store this secret securely — you will use it to verify the signature on every incoming delivery. Borga only shows the secret once at creation time.Webhook endpoints must be reachable over HTTPS. Borga will not deliver events to plain HTTP URLs or to localhost. During development, use a tunnel such as ngrok or a similar tool to expose a local server.
Verify webhook signatures
Borga signs every delivery with an HMAC-SHA256 signature computed from the raw request body and a timestamp. Verify the signature before processing any event to ensure the delivery genuinely came from Borga.Each delivery includes two headers:
Compute the expected signature and compare it to the one in the header:Also check that the timestamp is recent (within 5 minutes) to protect against replay attacks:
| Header | Description |
|---|---|
Borga-Timestamp | Unix timestamp (seconds) when Borga sent the delivery. |
Borga-Signature | HMAC-SHA256 of timestamp + "." + rawBody, hex-encoded. |
Node.js
Node.js
Handle events
Build a route in your application to receive deliveries, verify the signature, and dispatch on the event type.
Node.js (Express)
Retry failed deliveries
If your endpoint is down or returns a non-Borga also retries failed deliveries automatically on an exponential backoff schedule. Check the delivery log to see the current status.
2xx response, Borga marks the delivery as failed. You can trigger a manual retry from the API once your endpoint is back online.curl
List delivery history
Inspect past deliveries for a specific endpoint to debug failures or confirm that events were received.Each delivery record includes the event type, the HTTP response code your endpoint returned, and the response latency. Use this to diagnose endpoints that are timing out or returning errors.
curl
Event reference
The following events are available to subscribe to:| Event | When it fires |
|---|---|
payment.succeeded | A payment completed successfully and a charge was captured. |
payment.failed | A payment attempt was declined or encountered an error. |
invoice.paid | An invoice was marked paid, either by automatic charge or manual payment. |
subscription.created | A new subscription was created. |
subscription.canceled | A subscription was canceled, either immediately or at period end. |
Event object shape
Every delivery is aPOST with a JSON body in this shape:
data object is the full resource that triggered the event.
Manage existing endpoints
You can update or delete webhook endpoints at any time:List endpoints
Update events list
Delete endpoint
Next steps
- Accept a payment — build the payment flow that generates
payment.succeededevents - Subscriptions — trigger
subscription.createdandinvoice.paidevents with recurring billing - Accounting link — automatically sync invoices to your accounting software when
invoice.paidfires