Specifying the transaction amount
Table of accuracy of amounts [/amount]
The table below shows the recommended number of decimal places in the amount and shop_amount parameters when creating operations.
| Blockchain | Currency | Payway | Decimal places |
|---|---|---|---|
| Bitcoin | BTC | btc_btc | 8 |
| Litecoin | LTC | ltc_ltc | 8 |
| Polygon | MATIC | matic_polygon | 18 |
| Polygon | USDT | usdt_polygon | 6 |
| Polygon | BUSD | busd_polygon | 18 |
| TRON | TRX | trx_trc20 | 6 |
| TRON | USDT | usdt_trc20 | 6 |
| Ethereum | ETH | eth_erc20 | 18 |
| Ethereum | USDT | usdt_erc20 | 6 |
| Binance Smart Chain | BNB | bnb_bep20 | 18 |
| Binance Smart Chain | USDT | usdt_bep20 | 18 |
Attention! Not all decimal numbers can be accurately represented using binary notation. It is recommended to use decimal data types (for example: decimal.Decimal type in Python) to work with amounts.
If you specify the amount parameter with more decimal places than supported — the Qostiq system will return in response the rounded value of the receive/write-off amount.
Example request with rounded amount:
{
"amount": 0.100000889,
"amount_type": "ps_amount",
"payway": "usdt_erc20",
"shop_currency": "USDT",
"shop_id": 6,
"now": 1659081383,
"sign": "e60d8f25564f7191cc170557a34102228307b0b267eeba7ee0cc5732bbb2f235"
}
Example response:
{
"data": {
"payee_currency": "USDT",
"payee_receive": "0.100001",
"shop_currency": "USDT",
"shop_write_off": "0.10300103"
},
"error_code": 0,
"message": "Ok",
"result": true
}