Skip to Content

Currency

Provides information about a currency, such as its name, symbol, ISO code, and formatting details.

Type Definition

type Currency { id: Int name: String symbol: String isoCode: String }

Fields

FieldTypeNullableDescriptionRelated Types
idIntYesUnique identifier for this currency.-
nameStringYesDisplay name of this currency.-
symbolStringYesCurrency symbol (e.g., €, $).-
isoCodeStringYesISO 4217 code for this currency.-

Relationships

The Currency type is referenced by the following objects in the API:

  • CartPaymentMethod.currency: Represents the currency used in a cart payment method.
  • Country.currency: Represents the currency associated with a country.
  • Customer.currency: Represents the preferred currency of a customer.

These relationships allow you to retrieve currency details when querying cart payment methods, countries, or customers.

Usage Examples

Basic Query

{ currency { id name symbol isoCode } }

Field Selection

{ currency { name symbol } }

Nested Queries

Querying a customer’s preferred currency details:

{ customer(id: 12345) { id currency { name isoCode symbol } } }

Querying the currency associated with a cart payment method:

{ cartPaymentMethod(cartId: "eyJhbGciOiJIUzI1NiJ9...") { id currency { id name symbol isoCode } } }

Filtering and Sorting

The Currency type itself does not support filtering or sorting directly as it is typically nested within other objects. To filter or sort by currency, apply filters on the parent objects such as Country or Customer where applicable.

Example: Filtering customers by currency ISO code (assuming the API supports this on the Customer type):

{ customers(filter: { currencyIsoCode: "USD" }, sort: { field: "id", direction: ASC }) { edges { node { id currency { name symbol isoCode } } } } }

Implements

The Currency type does not implement any interfaces.

Connections

There are no direct connection fields on the Currency type. It is used as a nested object within other types.

  • CartPaymentMethod
  • Country
  • Customer

These types include the currency field referencing the Currency object.

Best Practices

  • Always select only the fields you need from the Currency object to optimize query performance.
  • Use the isoCode field for consistent currency identification across systems.
  • When querying nested currency data, consider the parent object’s filtering and pagination capabilities.
  • Cache currency data where possible, as currency details rarely change frequently.

Notes

  • All fields in the Currency type are optional and may return null if the information is unavailable.
  • The API currently requires no authentication; however, this may change in future versions.
  • Since Currency is a lightweight object, including it in queries generally has minimal performance impact.
  • No computed or derived fields exist on this type.
  • No field arguments are defined for the Currency type.
Last updated on