Create a Currency
POSThttps://useast.api.elasticpath.com/v2/currencies
caution
This endpoint is for Administrator use only. Do not use this endpoint on your customer-facing frontends.
Request
- application/json
Body
data object
Responses
- 201
- 400
- 422
Created
- application/json
- Schema
- Example (from schema)
Schema
data object
type
{
"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
detail string
status string
title string
[
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
detail string
status string
title string
[
null
]
{
"errors": {
"status": 422,
"title": "Currency limit reached",
"description": "You have reached the maximum allowed currency limit of 10"
}
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://useast.api.elasticpath.com/v2/currencies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '[
{
"data": {
"code": "GBP",
"decimal_places": 2,
"decimal_point": ".",
"default": true,
"enabled": true,
"exchange_rate": 1,
"format": "£{price}",
"thousand_separator": ",",
"type": "currency"
}
}
]'
ResponseClear