Create a currency
curl --request POST \
--url https://clarus-api.com/api/currencies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "currencies",
"attributes": {
"code": "gbp",
"name": "Pound Sterling"
}
}
}
'import requests
url = "https://clarus-api.com/api/currencies"
payload = { "data": {
"type": "currencies",
"attributes": {
"code": "gbp",
"name": "Pound Sterling"
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({data: {type: 'currencies', attributes: {code: 'gbp', name: 'Pound Sterling'}}})
};
fetch('https://clarus-api.com/api/currencies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "currencies",
"attributes": {
"code": "gbp",
"name": "Pound Sterling"
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Currencies
Create a currency
Create a currency. The code must be a valid ISO 4217 code in lowercase.
POST
/
api
/
currencies
Create a currency
curl --request POST \
--url https://clarus-api.com/api/currencies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "currencies",
"attributes": {
"code": "gbp",
"name": "Pound Sterling"
}
}
}
'import requests
url = "https://clarus-api.com/api/currencies"
payload = { "data": {
"type": "currencies",
"attributes": {
"code": "gbp",
"name": "Pound Sterling"
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({data: {type: 'currencies', attributes: {code: 'gbp', name: 'Pound Sterling'}}})
};
fetch('https://clarus-api.com/api/currencies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "currencies",
"attributes": {
"code": "gbp",
"name": "Pound Sterling"
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "currencies",
"attributes": {
"code": "gbp",
"name": "Pound Sterling"
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
code | Yes | ISO 4217 currency code, lowercase (e.g. gbp, usd, eur) |
name | Yes | Currency display name |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
Show child attributes
Show child attributes
Response
Currency created successfully
Show child attributes
Show child attributes
⌘I

