Ad hoc webhooks How to secure your callback endpoints
When sending a payment , creating a local withdrawal or ordering a conversion you can provide us a webhook (callback) URI - callbackUri. We will call it when a payment or withdrawal status changes.
We recommend API clients to generate and add ?signature=ASecretPerPaymentKey query to your callbackUri to make sure it's Flash Payments calling your webhook endpoint. For example:
Copy
https://my-webhooks.example.com/flash-payments?signature=oZaDlmfXbdXSKCnuWrvos2ImVBFX2Ru5 To avoid storing the signatures in a database we recommend generating them on the fly using a strong hash function or any kind of cryptography.
Example
You would need to implement two functions.
Function to generate "signature".
Function to verify the "signature".
Node.js pseudo code to generate a signature in your integration code.
The code above creates a callbackUri and externalId variables. Use both of them when creating a transfer in Flash Payments API.
Node.js pseudo code of your webhook HTTP request handler.