Create a delivery address
curl --request POST \
--url https://clarus-api.com/api/delivery_addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "delivery_addresses",
"attributes": {
"name": "John Smith",
"code": "JSMITH-HOME",
"address_1": "123 Main Street",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"customer_id": 42
}
}
}
'import requests
url = "https://clarus-api.com/api/delivery_addresses"
payload = { "data": {
"type": "delivery_addresses",
"attributes": {
"name": "John Smith",
"code": "JSMITH-HOME",
"address_1": "123 Main Street",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"customer_id": 42
}
} }
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: 'delivery_addresses',
attributes: {
name: 'John Smith',
code: 'JSMITH-HOME',
address_1: '123 Main Street',
address_3: 'Manchester',
postcode: 'M1 2AB',
country_code: 'GB',
customer_id: 42
}
}
})
};
fetch('https://clarus-api.com/api/delivery_addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "771",
"type": "delivery_addresses",
"attributes": {
"name": "John Smith",
"code": "JSMITH-HOME",
"address_1": "123 Main Street",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"customer_id": 42
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Delivery Addresses
Create a delivery address
Create a delivery address. Delivery addresses belong to an end customer (via customer_id). Town/city is held in address_3 (passed to couriers as the city).
POST
/
api
/
delivery_addresses
Create a delivery address
curl --request POST \
--url https://clarus-api.com/api/delivery_addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "delivery_addresses",
"attributes": {
"name": "John Smith",
"code": "JSMITH-HOME",
"address_1": "123 Main Street",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"customer_id": 42
}
}
}
'import requests
url = "https://clarus-api.com/api/delivery_addresses"
payload = { "data": {
"type": "delivery_addresses",
"attributes": {
"name": "John Smith",
"code": "JSMITH-HOME",
"address_1": "123 Main Street",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"customer_id": 42
}
} }
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: 'delivery_addresses',
attributes: {
name: 'John Smith',
code: 'JSMITH-HOME',
address_1: '123 Main Street',
address_3: 'Manchester',
postcode: 'M1 2AB',
country_code: 'GB',
customer_id: 42
}
}
})
};
fetch('https://clarus-api.com/api/delivery_addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "771",
"type": "delivery_addresses",
"attributes": {
"name": "John Smith",
"code": "JSMITH-HOME",
"address_1": "123 Main Street",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"customer_id": 42
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "delivery_addresses",
"attributes": {
"name": "John Smith",
"code": "JSMITH-HOME",
"address_1": "123 Main Street",
"address_3": "Manchester",
"postcode": "M1 2AB",
"country_code": "GB",
"customer_id": 42
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
code | Yes | Address code (max 50) |
name | Yes | Addressee name |
customer_id | No | End customer this delivery 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
Delivery address created successfully
Show child attributes
Show child attributes
⌘I

