How Webhooks Work
When a significant event occurs (such as a payment completion), Mobipurse sends an HTTP POST request to the webhook URL you’ve configured. Your server should acknowledge receipt by responding with a200 OK status code.
Setting Up Webhooks
You can configure your webhook URL in two ways:- Per-checkout basis: Include the
webhookURLparameter when creating a checkout - Global webhook: Set a default webhook URL in your dashboard under Settings → Webhooks
Webhook Priority
If a webhook URL is specified in the checkout creation request, it will be used. Otherwise, the global webhook URL from your dashboard settings will be used.Webhook Events
checkout.completed
This event is triggered when a customer successfully completes a payment. Event Payload:| Field | Type | Description |
|---|---|---|
event | String | The type of event. Will be “checkout.completed” for successful payments |
data.userId | String | The Mobipurse user ID of the merchant |
data.reference | String | The unique reference generated by Mobipurse for this transaction |
data.merchantsReference | String | Your merchant reference for this transaction |
data.status | String | The status of the payment. Can be “success”, “failed”, or “pending” |
data.amount | Number | The amount of the transaction in the lowest currency denomination |
data.customer.id | String | The unique ID of the customer who made the payment |
data.customer.phoneNumber | String | The customer’s phone number |
data.customer.name | String | The customer’s name |
