Integration
Read on how to deal with our webhooks
After the Subscription API has been setup the webhooks is ready to use. Webhooks will be fired when any event listed is triggered from our end. We will trigger a POST request to the URL provided on the Subscription API.
Webhooks Request
When an event is created on our end we POST following details as part of the webhook to the URL mentioned on Subscription API.
HEADER x-raas-webhook-signature : d2b730bba0de481fb079fff1478435231a9b410005ee599e67428930b7f340c3 x-raas-event : transaction_completed POST PAYLOAD
Webhook PayLoad Request For Receiver Profile Edit
Webhook Details
x-raas-webhook-signature
We generate a signature using the secret mentioned on Subscription API.
x-raas-event
Event Name
persisted_object_id
Webhook unique identifier
event_name
Event name. Same as that of header x-raas-event
resource_id
Id of resource for which the event was generated. If transaction_completed is triggered the resource_id will be transaction id.You can fetch the particular resource using the resource_id.
sender_id
If sender related resources are triggered as part of event then sender_id will be sent as part of the payload.
subscription_id
Subscription Id for which this event was generated.
receiver_id
If receiver related resources are triggered as part of an event then receiver_id will be sent as part of the payload. This is only visible in the receiver profile edit webhook.
timestamp
Timestamp when the webhook is posted
Securing Webhooks
We allow you to set secret as part of the Subscription API. Secret used on Subscription API will be used to create hash which will be sent as part of the webhooks request i.e. x-raas-webhook-signature and is a SHA256 HMAC hash of the request body with the key being your webhooks secret. You can validate the webhooks request by generating the same SHA256 HMAC hash and comparing it to the x-raas-webhook-signature sent with the payload. This step is optional but we highly recommend you to do so.
Responding to Webhooks
When you receive the webhooks events, you can respond back with following HTTP Status after the processing has been completed on your end.
2xx HTTP
This will acknowledge that the webhooks event was successfully captured and no further webhooks event will be generated from our end.
409 Conflict
If this HTTP code is returned from your end, we will trigger the webhooks on fixed interval until a success response is received from your end.
Rest of HTTP Codes
Any other response during webhooks response including 3xx codes will be marked as failure. Consecutive Webhooks Failures will pause the subscriptions for which the webhooks failed. You will have to update the paused subscriptions if you want to receive further webhooks on that subscription.
Retry Case
If a webhooks is not successfully received for any reason, we will continue trying to send the webhooks 10 more times every hour.
Duplicate Events
Subscriptions endpoints may occasionally receive the same event more than once. We advise you to properly handle such cases on your end.
Along with the webhooks, we recommend polling of our service.
Last updated