Listen to webhook events
Swipelux provides webhook notifications to keep your service updated about order status changes.
Implementation
Implement a webhook handler
Implement a webhook endpoint handler that can receive POST requests from Swipelux.
For starters, we've prepared example implementations for Node.js, Python, and PHP.
Verify the webhook payload
To ensure webhook payload authenticity, we sign it using JWT (JSON Web Token).
If you're using one of the example implementations, then you can skip this step as they already include the verification logic.
You can verify the signature using our public key available at https://api.swipelux.com/api/merchants/webhookKeys
.
Handle the webhook payload
Once the payload is verified, you can handle the webhook payload as you see fit.
Use orderId
or externalId
to locate the order in your system and update its status based on the webhook payload.
The payload is a JSON object that contains the following fields:
Prop | Type | Default |
---|---|---|
status | enum(PROCESSING, SUCCESS, FAILED) | - |
externalId? | string | - |
orderId | string | - |
eventTs | number | - |
Start receiving webhook events
Once you've implemented the webhook handler and deployed it somewhere, set up a webhook endpoint URL in the Merchant Panel to start receiving events from us.
Ensure the endpoint is publicly accessible and properly configured.