Fiat Webhooks
Note: all numeric values, amounts, and identifiers in the examples are illustrative and provided for demonstration purposes only.
Overview
Fiat Module uses Crypto-Cash webhooks, which are sent to the merchant after a transaction status changes. They work only if thewebhookUrl parameter is configured on the Fiat API key. If webhookUrl is not set, webhooks are not sent.
The notification URL of the payment provider and thewebhookUrlon the Fiat API key are different things. ThewebhookUrlon the Fiat API key is the address to which Crypto-Cash sends its events to the merchant.
Key parameters
| Parameter | Value |
|---|---|
| Crypto-Cash webhook target | webhookUrl configured on the Fiat API key |
| HTTP method | POST |
| Delivery | Asynchronous |
| Data format | application/json |
How webhooks work
Crypto-Cash webhooks
Crypto-Cash webhooks are sent after payment events. They work only ifwebhookUrl is configured on the Fiat API key.
When a transaction status changes, the system creates a payment event and asynchronously sends a webhook to the configured webhookUrl. If webhookUrl is not configured, the webhook is not sent.
HTTP format:
signature field in the payload body. The merchant uses the Fiat API key to verify that the webhook was sent by Crypto-Cash and has not been modified.
The webhook payload and signature are stored for audit and history.
Event types
| Event | When it is sent | Type |
|---|---|---|
payment::created | Transaction created | Intermediate |
payment::waiting | Status changed to Waiting | Intermediate |
payment::paid | Status changed to Paid | Final |
payment::failed | Status changed to Fail | Final |
payment::canceled | Status changed to Canceled | Final |
payment::created, payment::waiting) mean that the transaction is in progress and further status changes are possible.
Final events (payment::paid, payment::failed, payment::canceled) mean that the transaction has reached a terminal state:
| Final event | Meaning |
|---|---|
payment::paid | Cryptocurrency was successfully sent to the wallet address |
payment::failed | The payment was not completed |
payment::canceled | The payment was canceled |
What the merchant should check
When receiving a Crypto-Cash webhook:- Verify the
signaturefield using the Fiat API key (see the “Webhook signature” section). - Read
event.event_typeto determine the event. - Read
event.data— it contains the full transaction state. - Process the event depending on whether it is intermediate or final.
The id field is unique for each webhook delivery. Use it for deduplication on your side.
Crypto-Cash webhook signature
Each Crypto-Cash webhook contains asignature field in the payload body.
The signature is generated from the webhook identifier and content:
signature field, and verify it using the Fiat API key.
The verification method depends on the Fiat API key type:
ED25519— verify the receivedsignatureusing the Fiat APIpublicKey.LEGACY— reconstruct the expected signature value using the Fiat APIprivateKeyand compare it with the received one.