Create a warehouse
curl --request POST \
--url https://clarus-api.com/api/warehouses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "warehouses",
"attributes": {
"code": "<string>",
"name": "<string>",
"is_active": true,
"timezone": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"integer1": 123,
"integer2": 123,
"integer3": 123,
"integer4": 123,
"integer5": 123,
"boolean1": true,
"boolean2": true,
"boolean3": true,
"boolean4": true,
"boolean5": true
},
"relationships": {
"address": {
"data": {
"type": "addresses",
"attributes": {
"name": "John Smith",
"address_1": "123 Main Street",
"address_2": "Unit 4B",
"address_3": "London",
"address_4": "Greater London",
"postcode": "SW1A 1AA",
"country_code": "GB",
"email_address": "[email protected]",
"phone_number": "+44 20 7946 0958"
}
}
}
}
}
}
'import requests
url = "https://clarus-api.com/api/warehouses"
payload = { "data": {
"type": "warehouses",
"attributes": {
"code": "<string>",
"name": "<string>",
"is_active": True,
"timezone": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"integer1": 123,
"integer2": 123,
"integer3": 123,
"integer4": 123,
"integer5": 123,
"boolean1": True,
"boolean2": True,
"boolean3": True,
"boolean4": True,
"boolean5": True
},
"relationships": { "address": { "data": {
"type": "addresses",
"attributes": {
"name": "John Smith",
"address_1": "123 Main Street",
"address_2": "Unit 4B",
"address_3": "London",
"address_4": "Greater London",
"postcode": "SW1A 1AA",
"country_code": "GB",
"email_address": "[email protected]",
"phone_number": "+44 20 7946 0958"
}
} } }
} }
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: 'warehouses',
attributes: {
code: '<string>',
name: '<string>',
is_active: true,
timezone: '<string>',
external_system_reference1: '<string>',
external_system_reference2: '<string>',
external_system_reference3: '<string>',
string1: '<string>',
string2: '<string>',
string3: '<string>',
string4: '<string>',
string5: '<string>',
integer1: 123,
integer2: 123,
integer3: 123,
integer4: 123,
integer5: 123,
boolean1: true,
boolean2: true,
boolean3: true,
boolean4: true,
boolean5: true
},
relationships: {
address: {
data: {
type: 'addresses',
attributes: {
name: 'John Smith',
address_1: '123 Main Street',
address_2: 'Unit 4B',
address_3: 'London',
address_4: 'Greater London',
postcode: 'SW1A 1AA',
country_code: 'GB',
email_address: '[email protected]',
phone_number: '+44 20 7946 0958'
}
}
}
}
}
})
};
fetch('https://clarus-api.com/api/warehouses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "warehouses",
"attributes": {
"code": "<string>",
"name": "<string>",
"is_active": true,
"timezone": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"integer1": 123,
"integer2": 123,
"integer3": 123,
"integer4": 123,
"integer5": 123,
"boolean1": true,
"boolean2": true,
"boolean3": true,
"boolean4": true,
"boolean5": true
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Warehouses
Create a warehouse
Create a new warehouse for multi-site operations. Each warehouse has its own locations and can operate independently.
POST
/
api
/
warehouses
Create a warehouse
curl --request POST \
--url https://clarus-api.com/api/warehouses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "warehouses",
"attributes": {
"code": "<string>",
"name": "<string>",
"is_active": true,
"timezone": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"integer1": 123,
"integer2": 123,
"integer3": 123,
"integer4": 123,
"integer5": 123,
"boolean1": true,
"boolean2": true,
"boolean3": true,
"boolean4": true,
"boolean5": true
},
"relationships": {
"address": {
"data": {
"type": "addresses",
"attributes": {
"name": "John Smith",
"address_1": "123 Main Street",
"address_2": "Unit 4B",
"address_3": "London",
"address_4": "Greater London",
"postcode": "SW1A 1AA",
"country_code": "GB",
"email_address": "[email protected]",
"phone_number": "+44 20 7946 0958"
}
}
}
}
}
}
'import requests
url = "https://clarus-api.com/api/warehouses"
payload = { "data": {
"type": "warehouses",
"attributes": {
"code": "<string>",
"name": "<string>",
"is_active": True,
"timezone": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"integer1": 123,
"integer2": 123,
"integer3": 123,
"integer4": 123,
"integer5": 123,
"boolean1": True,
"boolean2": True,
"boolean3": True,
"boolean4": True,
"boolean5": True
},
"relationships": { "address": { "data": {
"type": "addresses",
"attributes": {
"name": "John Smith",
"address_1": "123 Main Street",
"address_2": "Unit 4B",
"address_3": "London",
"address_4": "Greater London",
"postcode": "SW1A 1AA",
"country_code": "GB",
"email_address": "[email protected]",
"phone_number": "+44 20 7946 0958"
}
} } }
} }
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: 'warehouses',
attributes: {
code: '<string>',
name: '<string>',
is_active: true,
timezone: '<string>',
external_system_reference1: '<string>',
external_system_reference2: '<string>',
external_system_reference3: '<string>',
string1: '<string>',
string2: '<string>',
string3: '<string>',
string4: '<string>',
string5: '<string>',
integer1: 123,
integer2: 123,
integer3: 123,
integer4: 123,
integer5: 123,
boolean1: true,
boolean2: true,
boolean3: true,
boolean4: true,
boolean5: true
},
relationships: {
address: {
data: {
type: 'addresses',
attributes: {
name: 'John Smith',
address_1: '123 Main Street',
address_2: 'Unit 4B',
address_3: 'London',
address_4: 'Greater London',
postcode: 'SW1A 1AA',
country_code: 'GB',
email_address: '[email protected]',
phone_number: '+44 20 7946 0958'
}
}
}
}
}
})
};
fetch('https://clarus-api.com/api/warehouses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "warehouses",
"attributes": {
"code": "<string>",
"name": "<string>",
"is_active": true,
"timezone": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"integer1": 123,
"integer2": 123,
"integer3": 123,
"integer4": 123,
"integer5": 123,
"boolean1": true,
"boolean2": true,
"boolean3": true,
"boolean4": true,
"boolean5": true
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "warehouses",
"attributes": {
"code": "WH-NORTH",
"name": "North Distribution Center"
},
"relationships": {
"address": {
"data": {
"type": "addresses",
"attributes": {
"address_1": "100 Industrial Park Way",
"address_3": "Manchester",
"postcode": "M1 1AA",
"country_code": "GB"
}
}
}
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
code | Yes | Unique warehouse code |
name | Yes | Warehouse display name |
Address
The warehouse address must be provided indata.relationships.address, not in data.attributes. See the example above for the correct JSON:API relationships structure.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
Warehouse created successfully
Show child attributes
Show child attributes
⌘I

