Skip to main content

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.

BlockchainCurrencyPaywayDecimal places
BitcoinBTCbtc_btc8
LitecoinLTCltc_ltc8
PolygonMATICmatic_polygon18
PolygonUSDTusdt_polygon6
PolygonBUSDbusd_polygon18
TRONTRXtrx_trc206
TRONUSDTusdt_trc206
EthereumETHeth_erc2018
EthereumUSDTusdt_erc206
Binance Smart ChainBNBbnb_bep2018
Binance Smart ChainUSDTusdt_bep2018

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
}