Endpoints
Webhook Integration
Learn how to integrate webhooks to receive real-time payment status updates from Fapshi.
A webhook is an API endpoint made available to external applications that can be called to notify your application whenever a significant event occurs. This allows your app to react or respond immediately to these events.
You can set a webhook URL per service on your Fapshi dashboard. When set, a POST request will be sent to this webhook URL whenever the status of a payment changes to:

- SUCCESSFUL — when a payment attempt completes successfully
- FAILED — when a payment attempt fails (usually on operator networks like MTN Mobile Money or Orange Money)
- EXPIRED — when a payment link expires after 24 hours without successful payment
How Webhooks Work

- Payment Initiated: Your external application initiates a payment by calling one of Fapshi’s payment endpoints (e.g., initiate-pay or direct-pay).
- Payment Processed: Fapshi Server processes the payment transaction. This includes handling the payment flow, communicating with payment operators, and updating the transaction status.
- Webhook Sent: When the payment status changes to SUCCESSFUL, FAILED, or EXPIRED, Fapshi Server automatically sends a POST request to your configured webhook URL with the updated transaction details.
- Webhook Received: Your external application receives the webhook notification and can process it accordingly (e.g., update your database, send notifications, trigger other workflows).
Your server should respond quickly to webhook requests to avoid timeouts, ideally with a 200 status code. Fapshi sends only one webhook request per event, regardless of whether your server responds or not.
Webhook Security
You can authenticate the origin of a webhook request by setting a webhook secret on the Fapshi dashboard. When a secret is configured, every webhook request includes a header calledx-wh-secret whose value is the secret you set on the dashboard. Comparing the value in this header to the secret you configured tells you whether the request came from Fapshi.
As a security measure, the dashboard does not let you view or determine whether a webhook secret has already been set for a service.
Webhook Payload Format
Response
200 - application/json
Acknowledgement of webhook receipt
Transaction ID of the payment.
Transaction status
Available options:
CREATED, PENDING, SUCCESSFUL, FAILED, EXPIRED Payment method
Available options:
mobile money, orange money, fapshi Name of the service in use
Type of transaction
Available options:
Collection, Payout Transaction amount
Amount received when Fapshi fees have been deducted
Client name
Client email
URL to redirect after payment
The transaction ID on your application
ID of the client on your application
The webhook you defined for your service
Typically appears when a payout via fapshi fails
Transaction ID with the payment operator
Date when the payment was initiated
Date when the payment was made