createCurrency
Requires at least one of the permissions settings:currency:create or settings:tenant:update.
Adds a currency to the organization, creating the platform-wide currency record first when it does not exist. A currency already in the organization is refused. The first currency, or one flagged as base, becomes the base currency. Requires permission to create currencies or update tenant settings.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CreateCurrency($input: CreateCurrencyInput!) {
createCurrency(input: $input) {
id
code
name
type
createdAt
decimalPlaces
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateCurrency($input: CreateCurrencyInput!) {\n createCurrency(input: $input) {\n id\n code\n name\n type\n createdAt\n decimalPlaces\n }\n}",
"variables": {
"input": {
"code": "string",
"name": "string",
"symbol": "string"
}
}
}
EOF
Variables:
{
"input": {
"code": "string",
"name": "string",
"symbol": "string"
}
}
Response:
{
"data": {
"createCurrency": {
"id": "id",
"code": "string",
"name": "string",
"type": "COMMODITY",
"createdAt": "2025-01-15T00:00:00Z",
"decimalPlaces": 0
}
}
}
createCurrency(
input: CreateCurrencyInput!
): Currency!
Arguments
createCurrency.input ● CreateCurrencyInput! non-null input
The currency code and whether it is the base currency.
Type
Currency object
A currency the organization can use.