Webhooks
Receive real-time updates about service purchase status
Overview
Webhooks allow you to receive real-time notifications about the status of service purchases. When you configure a webhook URL in your dashboard, Chipi Pay will send POST requests to that URL whenever the status of a transaction changes.
Webhook URL Configuration
Set your webhook URL in the Services Settings section of your dashboard.
Webhook Payload
Event Types
The type of webhook event
Available Events
sku-transaction.completed
- SKU Transaction has been completed successfullysku-transaction.failed
- SKU Transaction has failed
Status Values
Current status of the SKU Transaction
Available Statuses
PENDING
- SKU Transaction is being processedCOMPLETED
- SKU Transaction has been completed successfullyERROR
- SKU Transaction has failed (check errorMessage for details)
Response Requirements
Your webhook endpoint must return a 200 OK
status code to acknowledge receipt of the webhook.
Important: Your webhook endpoint must respond within 30 seconds or the delivery will be considered failed. Chipi Pay will attempt to deliver the webhook up to 3 times before giving up.
Best Practices:
- Process webhooks asynchronously when possible
- Return a 200 status immediately upon receipt
- Implement idempotency to handle duplicate deliveries
- Log all webhook events for debugging
Security
To verify that webhooks are coming from Chipi Pay, you can:
- Check the IP address of the request
- Verify the webhook signature (coming soon)
- Validate the webhook payload structure
Example Webhook Handler
Retry Logic
If your webhook endpoint is unavailable or returns an error status code, Chipi Pay will retry the webhook delivery.
After 3 failed attempts, the webhook will be marked as failed and no further retries will be attempted.
Testing Webhooks
You can test your webhook endpoint using tools like:
- webhook.site - Temporary webhook URLs for testing
- ngrok - Expose local endpoints to the internet
- Postman - Mock webhook requests
Make sure your webhook endpoint is publicly accessible and can handle POST requests with JSON payloads.