Page cover

Callback Examples

Callback schedule

The callback will be attempted on the following schedule:

1, 5, 10, 15, 20, 30, 60, 90, 120, 150, 180, 210, 240 minutes.

So, please keep in mind that the number of callback attempts is limited to 13 and the retries are executed in the predefined manner.

Deposit Callbacks

To provide authentication for the callback, Citron API signs the POST your api key and secret:

  1. X-Process-Key – Your public key

  2. X-Process-Signature – POST body, signed by your secret key HMAC-SHA512

Time

2023-04-25 12:29:13

Method

POST

Status

200

Format

application/json

Data sent:

{
    "id": "7626b35e-74ea-484a-bd0f-d0dae4db0f9f",
    "type": "deposit_exchange",
    "crypto_address": {
        "id": "81e4f44a-60bb-46dd-a0b1-f78607715f22",
        "currency": "BTC",
        "address": "bc1qvg...gc9l",
        "memo": null,
        "foreign_id": "test_user1"
    },
    "currency_sent": {
        "currency": "BTC",
        "amount": "0.00367652"
    },
    "currency_received": {
        "currency": "USDTT",
        "amount": "99.146193",
        "amount_minus_fee": "98.154731"
    },
    "transactions": [
        {
            "id": "d9c7f0e4-af7c-421c-b49c-cbec345133be",
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "deposit",
            "address": "bc1qvg...9gc9l",
            "tag": null,
            "amount": "0.00367652",
            "txid": "49c4f42b863718d...d8e38af4a6350c91731d",
            "riskscore": null,
            "confirmation": 3,
            "senders": ["TJR8sM1....h9xfX1H17cwP6Ce"]
        }
    ],
    "fees": null,
    "error": "",
    "risk": {},
    "status": "confirmed",
    "exchange": {
        "ticker": "BTCUSDT",
        "rate": "26967.40200000",
        "exchanged_amount": "99.14619280"
    }
}

Response received:

{
    "code": 0
}

"riskscore" is used for coin compliance analysis and to reveal and track malicious behavior. Available for deposits and deposits with exchange in BTC, ETH.

Withdrawal Callback

Time

2023-04-25 12:27:23

Method

POST

Status

200

Format

application/json

Data sent:

{
    "id": "d9c7f0e4-af7c-421c-b49c-cbec345133be",
    "foreign_id": "100:customerid",
    "type": "withdrawal",
    "crypto_address": {
        "id": "81e4f44a-60bb-46dd-a0b1-f78607715f22",
        "currency": "USDTT",
        "address": "TNRZHR...i1as",
        "memo": null
    },
    "currency_sent": {
        "currency": "USDTT",
        "amount": "2996.058802",
        "amount_minus_fee": "3011.039096"
    },
    "currency_received": {
        "currency": "USDTT",
        "amount": "2996.058802"
    },
    "transactions": [
        {
            "id": "81e4f44a-60bb-46dd-a0b1-f78607715f22",
            "currency": "USDTT",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "TNRZHRGNi6IbTuur7FcuXmXobohnZYiYas",
            "tag": null,
            "amount": "2996.058802",
            "txid": "15e698b4ffdf5463c7e7e31e54i3c95cddaaddc2de4414adca2d8e5b3d84d0f",
            "riskscore": null,
            "confirmations": 111
        }
    ],
    "fees": [
        {
            "type": "mining",
            "currency": "TRX",
            "amount": "27.600900"
        }
    ],
    "error": "",
    "status": "confirmed",
    "network_fee": "16.80594886",
    "network_fee_level": "avg",
    "risk": {
        "is_fraud": false,
        "alerts": [],
        "risk_level": null,
        "resource_name": "Binance.com",
        "resource_category": "exchange"
    }
}

Response received:

{
    "code": 0
}

JSON parameters for the Payment Terminal

A set of parameters is included in URL that will allow to redirect a user to the Payment Terminal.

Name
Description
Required
Type

client_id

This is a unique ID that’s generated on the side of Citron

Required

int

currency

ISO of a currency to receive funds in, example: BTC

Required

string

amount

Amount of funds to withdraw, example: "3500"

Optional

numeric

convert_to

In case you need on-the-fly exchange of all incoming funds (e.g. to EUR) specify this parameter as EUR or any other supported currency ISO, to see the list of available pairs check the method above

Optional

string

is_iframe

The parameter that allows you to get an iframe-link (false by default).

Optional

boolean

foreign_id

Unique foreign ID in your system, example: "164"

Required

string

url_back

A link that allows you to get a user back to your system

Optional

url

Last updated

Was this helpful?