Invoice Callbacks
First, read general information about callbacks: Callbacks (Webhooks).
We will send a callback on the following events:
deposit_completed
This event happens when we receive a deposit from the customer and successfully transfer this money to your account.
Since we receive a deposit in the channel from your customer, we will send a callback to your server. Here is an example of callbacks by their status:
{
"type": "invoice",
"event": "deposit_completed",
"data": {
"id": "018ab31d-5678-726b-9bd8-86f6c0692fe9",
"number": 135164,
"price_currency": "ETH",
"price_amount": 0.01,
"pay_currency": "ETH",
"pay_amount": 0.01,
"exchange_rate": null,
"exchange_rate_expires_at": "",
"address": "0xd3a4e206A02f95778989B15f0dECa89E1E96F5DB",
"address_tag": null,
"address_uri": "ethereum:0xd3a4e206A02f95778989B15f0dECa89E1E96F5DB?amount=0.01",
"paid_amount": 0.01,
"paid_amount_minus_fee": 0.008,
"transaction_hash": "0x7b91b346397a50859ed6d91bfeb49aa552b08946d7140dd6d823c2beaa42322c",
"transaction_risk_score": 7,
"received_currency": "ETH",
"received_amount": 0.008,
"conversion_exchange_rate": null,
"fees": {
"processing_invoice": {
"currency": "ETH",
"amount": 0.002
}
},
"fiat_amounts": {
"EUR": {
"paid_amount": 15.18,
"fee_amount": 3.04
},
"USD": {
"paid_amount": 16.28,
"fee_amount": 3.26
},
"UAH": {
"paid_amount": 601.4,
"fee_amount": 120.28
},
"KZT": {
"paid_amount": 7716.79,
"fee_amount": 1543.36
}
},
"external_id": null,
"customer_external_id": "111111",
"external_data": null,
"name": null,
"description": null,
"redirect_url": null,
"failure_redirect_url": null,
"created_at": "2023-09-20T15:02:38.000000Z",
"expires_at": "2023-09-20T15:32:38.000000Z",
"status": "paid",
"status_context": null
},
"timestamp": 1695222259
}Below are explanations for some specific fields:
paid_amount: the amount transferred by the client.paid_amount_minus_fee: the client's amount after deducting fees.For
received_amount:In integrations without auto-conversion to USDT, this value will be the same as
paid_amount_minus_fee.In integrations with auto-conversion, it will be the amount of
paid_amount_minus_feeconverted to USDT, minus the auto-conversion fee.
The amount in
fiat_amountsmay not match the amount specified in the invoice. This is because the invoice amount is calculated at the exchange rate at the time of invoice creation, while the amount infiat_amountsis calculated at the time of receiving the payment from the client.The difference between fiat/crypto and crypto/crypto pairs is that the
exchange_ratefield is not applicable for crypto/crypto pairs.
Callback Examples with Auto Conversion
If your project has enabled the auto conversion feature, received_currency and receivied_amount will contain USDT values. Here is an example:
{
"type": "invoice",
"event": "deposit_completed",
"data": {
"id": "018ab31d-5678-726b-9bd8-86f6c0692fe9",
"number": 135164,
"price_currency": "ETH",
"price_amount": 0.01,
"pay_currency": "ETH",
"pay_amount": 0.003,
"exchange_rate": null,
"exchange_rate_expires_at": "",
"address": "0xd3a4e206A02f95778989B15f0dECa89E1E96F5DB",
"address_tag": null,
"address_uri": "ethereum:0xd3a4e206A02f95778989B15f0dECa89E1E96F5DB?amount=0.01",
"paid_amount": 0.003,
"paid_amount_minus_fee": 0.0028,
"transaction_hash": "0x7b91b346397a50859ed6d91bfeb49aa552b08946d7140dd6d823c2beaa42322c",
"transaction_risk_score": 7,
"received_currency": "USDTTRC20",
"received_amount": 5.629329,
"conversion_exchange_rate": 1896.31663326,
"fees": {
"processing_invoice": {
"currency": "ETH",
"amount": 0.002
},
"conversion": {
"currency": "USDTTRC20",
"amount": 0.002
}
},
"fiat_amounts": {
"USD": {
"paid_amount": 5.71,
"fee_amount": 0.05
},
"EUR": {
"paid_amount": 5.33,
"fee_amount": 0.04
},
"UAH": {
"paid_amount": 205.77,
"fee_amount": 1.65
},
"KZT": {
"paid_amount": 2675.83,
"fee_amount": 21.41
}
},
"external_id": null,
"customer_external_id": "111111",
"external_data": null,
"name": null,
"description": null,
"redirect_url": null,
"failure_redirect_url": null,
"created_at": "2023-09-20T15:02:38.000000Z",
"expires_at": "2023-09-20T15:32:38.000000Z",
"status": "paid",
"status_context": null
},
"timestamp": 1695222259
}Auto-conversion. The key distinction when the "auto-conversion" feature is activated lies in the
received_currencyfield. In this scenario, the particular stablecoin to which all deposits are converted is consistently specified in this field. Furthermore, a conversion fee is incurred, details of which are outlined in thefees.conversionfield.
Last updated