Currencies
Access currency reference data
Currencies
Access currency reference data including currency codes and precision information.
List Currencies
Get a list of all supported currencies.
Endpoint
GET /api/v1/currenciesAuthentication: Bearer token required
All records are returned in a single response. No pagination or query parameters are supported.
Response
[
{
"id": 1,
"name": "US Dollar",
"currency": "USD",
"precision": 2
},
{
"id": 2,
"name": "Euro",
"currency": "EUR",
"precision": 2
},
{
"id": 3,
"name": "Japanese Yen",
"currency": "JPY",
"precision": 0
}
]Currency Object
| Field | Type | Description |
|---|---|---|
| id | number | Unique currency identifier |
| name | string | Currency display name |
| currency | string | ISO 4217 currency code |
| precision | number | Number of decimal places |
Examples
curl -X GET "{{host}}/api/v1/currencies" \
-H "Authorization: Bearer your_access_token"<?php
function getCurrencies($accessToken) {
$ch = curl_init('{{host}}/api/v1/currencies');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $accessToken
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
?>Get Currency by ID
Get details for a specific currency.
Endpoint
GET /api/v1/currencies/{id}Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | number | Yes | Currency ID |
Response
{
"id": 1,
"name": "US Dollar",
"currency": "USD",
"precision": 2
}Error Responses
404 Not Found
{
"error": {
"name": "NotFoundError",
"code": "NOT_FOUND",
"message": "Currency not found"
}
}500 Internal Server Error
{
"error": {
"name": "InternalServerError",
"code": "INTERNAL_SERVER_ERROR",
"message": "Error retrieving currency"
}
}Examples
curl -X GET "{{host}}/api/v1/currencies/1" \
-H "Authorization: Bearer your_access_token"<?php
function getCurrencyById($accessToken, $currencyId) {
$ch = curl_init("{{host}}/api/v1/currencies/{$currencyId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $accessToken
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 404) {
throw new Exception("Currency not found: {$currencyId}");
}
return json_decode($response, true);
}
?>Error Responses
401 Unauthorized
{
"error": {
"name": "UnauthorizedError",
"code": "UNAUTHORIZED",
"message": "Invalid or expired access token"
}
}500 Internal Server Error
{
"error": {
"name": "InternalServerError",
"code": "INTERNAL_SERVER_ERROR",
"message": "Could not retrieve currencies"
}
}Next Steps
- Learn about Countries that support each currency
- Explore Products and their currency requirements
- Understand Charges Calculation with multi-currency support