Transactions and Earn Webhooks
Stay Attuned to Criptan Account Events for Automated Integration Responses.
Why to use webhooks
When developing Criptan integrations, you may desire your applications to promptly capture events happening within your Criptan accounts. This enables your backend systems to respond with appropriate actions
You can subscribe to the events by going to your settings page and adding a new webhook subscription. Every part of the API has it own set of webhooks, described in its own reference.
Verification
Every Criptan webhook request includes an x-signature
header. This header contains the SHA256 HMAC signature of the raw request payload, computed using your webhook shared secret as the key. You can obtain your shared webhook secret from your settings page.
Make sure that you verify the webhook signature before acting on it inside your system!!
Using Typescript, you can verify a webhook like this:
We send amount as strings for both fiat and cryptocurrency amount for consistency. Bear in mind that cryptocurrency payments can (and will) be numbers larger than what many programming languages can support safely. As an example, an ETH payment will have a 256bits number for the amount, so you will need to treat those numbers with cautions to avoid rounding errors.
Last updated