Get Currencies
About
The currencies query retrieves currency information from your store with support for pagination and detailed field access. This query is essential for:
- Displaying available currency options for store visitors
- Building currency selector/switcher interfaces
- Retrieving currency formatting details (symbol, position, separators)
- Managing multi-currency pricing configurations
- Formatting prices correctly based on currency settings
The query supports cursor-based pagination and allows you to fetch all currencies with full field access.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
first | Int | No | Number of currencies to retrieve from the start (forward pagination). Max: 100. |
after | String | No | Cursor to start after for forward pagination. |
last | Int | No | Number of currencies to retrieve from the end (backward pagination). Max: 100. |
before | String | No | Cursor to start before for backward pagination. |
Possible Returns
| Field | Type | Description |
|---|---|---|
edges | [CurrencyEdge!]! | Array of currency edges containing currencies and cursors. |
edges.node | Currency! | The actual currency object with id, code, name, symbol, and other fields. |
edges.cursor | String! | Pagination cursor for this currency. Use with after or before arguments. |
pageInfo | PageInfo! | Pagination metadata object. |
pageInfo.hasNextPage | Boolean! | Whether more currencies exist after the current page. |
pageInfo.hasPreviousPage | Boolean! | Whether currencies exist before the current page. |
pageInfo.startCursor | String | Cursor of the first currency on the current page. |
pageInfo.endCursor | String | Cursor of the last currency on the current page. |
totalCount | Int! | Total number of currencies available. |
Currency Fields
| Field | Type | Description |
|---|---|---|
id | String! | Unique identifier in format /api/shop/currencies/{id} |
_id | Int! | Numeric identifier for the currency |
code | String! | ISO 4217 currency code (e.g., "USD", "EUR", "INR") |
name | String! | Display name of the currency (e.g., "US Dollar", "Euro") |
symbol | String! | Currency symbol (e.g., "$", "€", "₹") |
decimal | String | Number of decimal places for the currency (e.g., "2") |
groupSeparator | String | Thousands group separator character (e.g., ",") |
decimalSeparator | String | Decimal separator character (e.g., ".") |
currencyPosition | String | Position of currency symbol relative to the amount: "left", "left_with_space", "right", "right_with_space", or null (use system default) |
Common Use Cases
Display All Available Currencies
graphql
query GetAllCurrencies {
currencies {
edges {
node {
id
code
name
symbol
}
}
}
}Build Currency Selector
graphql
query GetCurrenciesForSelector {
currencies {
edges {
node {
code
name
symbol
currencyPosition
}
}
}
}Get Currency Formatting Details
graphql
query GetCurrencyFormatting {
currencies {
edges {
node {
code
symbol
decimal
groupSeparator
decimalSeparator
currencyPosition
}
}
totalCount
}
}Get Currencies with Pagination
graphql
query GetCurrenciesWithPagination($first: Int!) {
currencies(first: $first) {
edges {
cursor
node {
id
code
name
symbol
}
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
totalCount
}
}Error Handling
Missing Currencies Configuration
json
{
"data": {
"currencies": {
"edges": [],
"pageInfo": {
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": null,
"endCursor": null
},
"totalCount": 0
}
}
}Invalid Pagination Parameters
json
{
"errors": [
{
"message": "Argument \"first\" must be between 1 and 100"
}
]
}Invalid Cursor
json
{
"errors": [
{
"message": "Invalid cursor provided"
}
]
}Best Practices
- Cache Currencies - Currencies change infrequently; implement client-side caching
- Use Formatting Fields - Always use
decimal,groupSeparator,decimalSeparator, andcurrencyPositionfor correct price formatting - Request Only Needed Fields - Reduce payload by selecting specific fields
- Display Symbol Correctly - Use
currencyPositionto place symbol on the correct side of the amount - Paginate When Needed - For systems with many currencies, use pagination
- Use Variables - Use GraphQL variables for dynamic currency queries
Related Resources
- Get Currency - Retrieve a single currency by ID
- Get Channel - Channel includes base currency and supported currencies
- Pagination Guide - Cursor pagination documentation
- Shop API Overview - Overview of Shop API resources

