Skip to main content

What are webhooks?

FossaPay sends an HTTP POST request to your configured webhook URL when an event occurs. Webhooks let your server react to checkout payments, deposits, payouts, and other asynchronous activity without continuously polling the API.

Webhook envelope

Delivery headers

Verify signatures

FossaPay currently signs the serialized data object—not the full webhook envelope—with your webhook secret:
The result is encoded as lowercase hexadecimal. Verify it before acknowledging or processing the event.

Node.js example

Python example

The signature input is exactly JSON.stringify(body.data). Do not include eventId, eventType, or timestamp in the signed value. In languages other than JavaScript, serialize compact JSON with the same property order received in data.

Safe processing

Return an HTTP 2xx response as soon as the signature and basic envelope are valid. Move database updates, emails, and third-party calls to an asynchronous job.
Store eventId with a unique database constraint. If the event has already been processed, return 2xx without repeating fulfillment or crediting.
Use the event’s checkout or transaction identifiers and current status. Your handler should tolerate retries and events arriving later than expected.
If a checkout or payout webhook is delayed, retrieve the resource by its FossaPay ID or your merchant reference before taking action.
Failed webhook deliveries are retried up to five times. X-Retry-Count is included on retries.

Local testing

FossaPay cannot deliver webhooks directly to localhost. Expose your local server through a secure HTTPS tunnel and configure the public URL in the dashboard.

Next steps

Webhook Events

View event names and payloads

Checkout Guide

Integrate one-time NGN checkouts

Payouts Guide

Send from your business master wallet