Create a collection address
curl --request POST \
--url https://clarus-api.com/api/collection_addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "collection_addresses",
"attributes": {
"name": "Acme Supplies Depot",
"code": "ACME-DEPOT",
"address_1": "10 Industrial Way",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"supplier_id": 14
}
}
}
'import requests
url = "https://clarus-api.com/api/collection_addresses"
payload = { "data": {
"type": "collection_addresses",
"attributes": {
"name": "Acme Supplies Depot",
"code": "ACME-DEPOT",
"address_1": "10 Industrial Way",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"supplier_id": 14
}
} }
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: 'collection_addresses',
attributes: {
name: 'Acme Supplies Depot',
code: 'ACME-DEPOT',
address_1: '10 Industrial Way',
address_3: 'Manchester',
postcode: 'M1 2AB',
country_code: 'GB',
supplier_id: 14
}
}
})
};
fetch('https://clarus-api.com/api/collection_addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "920",
"type": "collection_addresses",
"attributes": {
"name": "Acme Supplies Depot",
"code": "ACME-DEPOT",
"address_1": "10 Industrial Way",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"supplier_id": 14
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Collection Addresses
Create a collection address
Create a collection address. Collection addresses belong to a supplier (via supplier_id). Town/city is held in address_3.
POST
/
api
/
collection_addresses
Create a collection address
curl --request POST \
--url https://clarus-api.com/api/collection_addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "collection_addresses",
"attributes": {
"name": "Acme Supplies Depot",
"code": "ACME-DEPOT",
"address_1": "10 Industrial Way",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"supplier_id": 14
}
}
}
'import requests
url = "https://clarus-api.com/api/collection_addresses"
payload = { "data": {
"type": "collection_addresses",
"attributes": {
"name": "Acme Supplies Depot",
"code": "ACME-DEPOT",
"address_1": "10 Industrial Way",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"supplier_id": 14
}
} }
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: 'collection_addresses',
attributes: {
name: 'Acme Supplies Depot',
code: 'ACME-DEPOT',
address_1: '10 Industrial Way',
address_3: 'Manchester',
postcode: 'M1 2AB',
country_code: 'GB',
supplier_id: 14
}
}
})
};
fetch('https://clarus-api.com/api/collection_addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "920",
"type": "collection_addresses",
"attributes": {
"name": "Acme Supplies Depot",
"code": "ACME-DEPOT",
"address_1": "10 Industrial Way",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"supplier_id": 14
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "collection_addresses",
"attributes": {
"name": "Acme Supplies Depot",
"code": "ACME-DEPOT",
"address_1": "10 Industrial Way",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"supplier_id": 14
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
code | Yes | Address code (max 50) |
name | Yes | Addressee name |
supplier_id | No | Supplier this collection address belongs to |
address_3 | No | Town/city (passed to couriers as the city) |
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
Collection address created successfully
Show child attributes
Show child attributes
⌘I

