Get Coins

Returns the list of coins and networks you can currently accept, with their display names and icons. Use it to build a coin picker or keep your checkout in sync — it reflects exactly what a customer would be offered on the payment page, so networks that are temporarily unavailable are already left out.

POSThttps://payid19.com/api/v1/get_coins

Request parameters

public_keystringREQUIRED
Your public API key.
private_keystringREQUIRED
Your private API key.

Response

The message field is a JSON array of the coins you can accept. Each entry describes one coin on one network — for example USDT appears once for each of TRC20, ERC20 and BEP20.

namestring
Coin code — USDT, USDC, BTC, ETH, BNB, TRX, LTC.
long_namestring
Display name — USD Tether, Bitcoin, Ethereum, and so on.
networkstring
The network for this entry, e.g. TRC20, ERC20, BEP20. Pair it with name as name-network (e.g. USDT-TRC20) when a parameter elsewhere wants a specific network.
iconstring
URL of the coin icon, ready to display in your UI.
decimalsinteger
Number of decimal places used when showing an amount in this coin.
{
  "status": "success",
  "message": [
    {"name":"USDT","long_name":"USD Tether","network":"TRC20","icon":"https://cdn.payid19.com/img/USDTTRC20.svg","decimals":2},
    {"name":"BTC","long_name":"Bitcoin","network":"BTC","icon":"https://cdn.payid19.com/img/BTC.svg","decimals":6}
  ]
}
This endpoint lists what you can accept but not the price. To get the amount a customer would pay in each coin for a given price, use get_estimate.

Example request

curl -X POST https://payid19.com/api/v1/get_coins \
  -d public_key=YOUR_PUBLIC_KEY \
  -d private_key=YOUR_PRIVATE_KEY
<?php
$post = [
    'public_key'  => 'YOUR_PUBLIC_KEY',
    'private_key' => 'YOUR_PRIVATE_KEY',
];

$ch = curl_init('https://payid19.com/api/v1/get_coins');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
$result = curl_exec($ch);
curl_close($ch);

$response = json_decode($result);
if ($response->status == 'error') {
    echo is_array($response->message) ? $response->message[0] : $response->message;
} else {
    foreach ($response->message as $coin) {
        echo $coin->name . ' on ' . $coin->network . PHP_EOL;
    }
}
const axios = require('axios');

axios.post('https://payid19.com/api/v1/get_coins', {
    public_key:  'YOUR_PUBLIC_KEY',
    private_key: 'YOUR_PRIVATE_KEY',
})
.then(({ data }) => {
    if (data.status === 'error') return console.error([].concat(data.message)[0]);
    data.message.forEach(coin => console.log(coin.name, 'on', coin.network));
})
.catch(err => console.error(err.message));
import requests

response = requests.post('https://payid19.com/api/v1/get_coins', data={
    'public_key':  'YOUR_PUBLIC_KEY',
    'private_key': 'YOUR_PRIVATE_KEY',
})

result = response.json()
if result['status'] == 'error':
    msg = result['message']
    print(msg[0] if isinstance(msg, list) else msg)
else:
    for coin in result['message']:
        print(coin['name'], 'on', coin['network'])