curl https://api.zbdpay.com/api/v1/currencies/GEMS \
-H "x-api-key: YOUR_API_KEY"
{
"success": true,
"message": "Currency retrieved.",
"data": {
"currency": "GEMS",
"type": "virtual",
"name": "Gems",
"precision": 2,
"convertible": true,
"icon_url": "https://cdn.zbdpay.com/virtual-currencies/gems.png",
"project_ids": ["prj_1", "prj_2"]
},
"error": null
}
Currencies
Get a Currency
Read one currency by its code.
GET
/
api
/
v1
/
currencies
/
{currency}
curl https://api.zbdpay.com/api/v1/currencies/GEMS \
-H "x-api-key: YOUR_API_KEY"
{
"success": true,
"message": "Currency retrieved.",
"data": {
"currency": "GEMS",
"type": "virtual",
"name": "Gems",
"precision": 2,
"convertible": true,
"icon_url": "https://cdn.zbdpay.com/virtual-currencies/gems.png",
"project_ids": ["prj_1", "prj_2"]
},
"error": null
}
Configuration
Header Parameters
string
required
Your ZBD API key.
Path Parameters
string
required
The currency code, for example
GEMS or USD.curl https://api.zbdpay.com/api/v1/currencies/GEMS \
-H "x-api-key: YOUR_API_KEY"
{
"success": true,
"message": "Currency retrieved.",
"data": {
"currency": "GEMS",
"type": "virtual",
"name": "Gems",
"precision": 2,
"convertible": true,
"icon_url": "https://cdn.zbdpay.com/virtual-currencies/gems.png",
"project_ids": ["prj_1", "prj_2"]
},
"error": null
}
Response
The currency is indata.
string
The currency code you use in every call. It can’t be changed.
string
fiat for real-world money, or virtual for a currency you defined.string
The display name users see.
integer
How many decimal places to show. Amounts are always whole numbers in the smallest unit, so with a precision of
2, 150 is shown as 1.50. Fiat follows its own standard, for example 2 for USD and 0 for JPY.boolean
Whether the currency can convert to real money and be cashed out.
string | null
An icon for a virtual currency, if you set one.
string[] | null
The projects a virtual currency is linked to. A currency linked to several projects is the same currency in each of them.
Errors
| HTTP | code | When |
|---|---|---|
401 | unauthorized | The API key is missing or invalid |
404 | currency_not_found | No currency with this code in your program |
Was this page helpful?