updateCurrency
Requires permission platform:currency:manage.
Edits a currency's master record. Currencies are shared by every organization, so this needs the platform permission to manage currencies, which only platform administrators hold.
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 UpdateCurrency($id: String!, $input: UpdateCurrencyInput!) {
updateCurrency(id: $id, 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 UpdateCurrency($id: String!, $input: UpdateCurrencyInput!) {\n updateCurrency(id: $id, input: $input) {\n id\n code\n name\n type\n createdAt\n decimalPlaces\n }\n}",
"variables": {
"id": "string",
"input": {}
}
}
EOF
Variables:
{
"id": "string",
"input": {}
}
Response:
{
"data": {
"updateCurrency": {
"id": "id",
"code": "string",
"name": "string",
"type": "COMMODITY",
"createdAt": "2025-01-15T00:00:00Z",
"decimalPlaces": 0
}
}
}
updateCurrency(
id: String!
input: UpdateCurrencyInput!
): Currency!
Arguments
updateCurrency.id ● String! non-null scalar
The ID of the currency.
updateCurrency.input ● UpdateCurrencyInput! non-null input
The fields to change.
Type
Currency object
A currency the organization can use.