Create a site
curl --request POST \
--url https://clarus-api.com/api/sites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "sites",
"attributes": {
"code": "SITE-NORTH",
"name": "Northern Distribution Centre",
"tier": "upper"
}
}
}
'import requests
url = "https://clarus-api.com/api/sites"
payload = { "data": {
"type": "sites",
"attributes": {
"code": "SITE-NORTH",
"name": "Northern Distribution Centre",
"tier": "upper"
}
} }
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: 'sites',
attributes: {code: 'SITE-NORTH', name: 'Northern Distribution Centre', tier: 'upper'}
}
})
};
fetch('https://clarus-api.com/api/sites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "4",
"type": "sites",
"attributes": {
"code": "SITE-NORTH",
"name": "Northern Distribution Centre",
"tier": "upper",
"default": false
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Sites
Create a site
Create a site. Sites group warehouses for multi-site operations.
POST
/
api
/
sites
Create a site
curl --request POST \
--url https://clarus-api.com/api/sites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "sites",
"attributes": {
"code": "SITE-NORTH",
"name": "Northern Distribution Centre",
"tier": "upper"
}
}
}
'import requests
url = "https://clarus-api.com/api/sites"
payload = { "data": {
"type": "sites",
"attributes": {
"code": "SITE-NORTH",
"name": "Northern Distribution Centre",
"tier": "upper"
}
} }
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: 'sites',
attributes: {code: 'SITE-NORTH', name: 'Northern Distribution Centre', tier: 'upper'}
}
})
};
fetch('https://clarus-api.com/api/sites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "4",
"type": "sites",
"attributes": {
"code": "SITE-NORTH",
"name": "Northern Distribution Centre",
"tier": "upper",
"default": false
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "sites",
"attributes": {
"code": "SITE-NORTH",
"name": "Northern Distribution Centre",
"tier": "upper"
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
code | Yes | Unique site code (max 50) |
name | Yes | Site display name (max 50) |
default | No | Whether this is the default site |
tier | No | One of none, lower, upper |
string1–string5, integer1–integer5, boolean1–boolean5, datetime1–datetime5) and a nested address.Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/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
Site created successfully
Show child attributes
Show child attributes

