Create a Currency
POST/v2/currencies
This endpoint is for Administrator use only. Do not use this endpoint on your customer-facing frontends.
Request
- application/json
Body
data object
Possible values: >= 3 characters
and <= 3 characters
Specifies the currency code. Example YEN.
Indicates how many decimal places the currency is formatted to.
Indicates the decimal point character.
Specifies whether this is the default currency or not. Either true
or false
.
Specifies if this currency is available for products. Either true
or false
.
Specifies the exchange rate from the default currency.
Specifies how the price currency is displayed. For example, "¥{price}".
Indicates the thousand separator character.
Represents the type represents the object being returned.
Responses
- 201
- 400
- 422
Created
- application/json
- Schema
- Example (from schema)
Schema
data object
The unique identifier for this currency.
Represents the type represents the object being returned.
Specifies the currency code. For example, YEN.
Specifies the exchange rate from the default currency.
Specifies how the price currency is displayed. For example, "£{price}".
Indicates the decimal point character.
Indicates the thousand separator character.
Indicates how many decimal places the currency is formatted to.
Specifies whether this is the default currency or not. Either true
or false
.
Specifies if this currency is available for products. Either true
or false
.
links object
Specifies the URL of this currency.
meta object
timestamps object
Indicates the creation date of this currency.
Indicates the updated date of this currency.
Indicates whether the owner is store or org.
{
"data": {
"id": "0c45e4ec-26e0-4043-86e4-c15b9cf985a0",
"type": "currency",
"code": "GBP",
"exchange_rate": 1,
"format": "£{price}",
"decimal_point": ".",
"thousand_separator": ",",
"decimal_places": 2,
"default": true,
"enabled": true,
"links": {
"self": "string"
},
"meta": {
"timestamps": {
"created_at": "2023-11-07T23:04:18.845Z",
"updated_at": "2023-11-07T23:04:18.845Z"
},
"owner": "store"
}
},
"type": {}
}
Bad Request
- application/json
- Schema
- Example (from schema)
- Example
Schema
[
null
]
{
"errors": {
"status": 400,
"title": "Currency already exists",
"description": "The specified currency code already exists"
}
}
Bad Request
- application/json
- Schema
- Example (from schema)
- Example
Schema
[
null
]
{
"errors": {
"status": 422,
"title": "Currency limit reached",
"description": "You have reached the maximum allowed currency limit of 10"
}
}