Update a shipment
curl --request PATCH \
--url https://clarus-api.com/api/shipments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "shipments",
"attributes": {
"goods_out_id": 123,
"carrier_id": 123,
"carrier_service_id": 123,
"reference": "<string>",
"tracking_number": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"packages": [
{
"reference": "<string>",
"weight": 123,
"height": 123,
"length": 123,
"width": 123
}
]
},
"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/shipments/{id}"
payload = { "data": {
"type": "shipments",
"attributes": {
"goods_out_id": 123,
"carrier_id": 123,
"carrier_service_id": 123,
"reference": "<string>",
"tracking_number": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"packages": [
{
"reference": "<string>",
"weight": 123,
"height": 123,
"length": 123,
"width": 123
}
]
},
"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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'shipments',
attributes: {
goods_out_id: 123,
carrier_id: 123,
carrier_service_id: 123,
reference: '<string>',
tracking_number: '<string>',
external_system_reference1: '<string>',
external_system_reference2: '<string>',
external_system_reference3: '<string>',
string1: '<string>',
string2: '<string>',
string3: '<string>',
string4: '<string>',
string5: '<string>',
packages: [{reference: '<string>', weight: 123, height: 123, length: 123, width: 123}]
},
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/shipments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "shipments",
"attributes": {
"goods_out_id": 123,
"carrier_id": 123,
"carrier_service_id": 123,
"reference": "<string>",
"tracking_number": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"packages": [
{
"reference": "<string>",
"weight": 123,
"height": 123,
"length": 123,
"width": 123
}
]
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Shipments
Update a shipment
Update an existing shipment’s attributes such as packages or address. Submitted shipments may have restrictions on what can be changed.
PATCH
/
api
/
shipments
/
{id}
Update a shipment
curl --request PATCH \
--url https://clarus-api.com/api/shipments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "shipments",
"attributes": {
"goods_out_id": 123,
"carrier_id": 123,
"carrier_service_id": 123,
"reference": "<string>",
"tracking_number": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"packages": [
{
"reference": "<string>",
"weight": 123,
"height": 123,
"length": 123,
"width": 123
}
]
},
"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/shipments/{id}"
payload = { "data": {
"type": "shipments",
"attributes": {
"goods_out_id": 123,
"carrier_id": 123,
"carrier_service_id": 123,
"reference": "<string>",
"tracking_number": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"packages": [
{
"reference": "<string>",
"weight": 123,
"height": 123,
"length": 123,
"width": 123
}
]
},
"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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'shipments',
attributes: {
goods_out_id: 123,
carrier_id: 123,
carrier_service_id: 123,
reference: '<string>',
tracking_number: '<string>',
external_system_reference1: '<string>',
external_system_reference2: '<string>',
external_system_reference3: '<string>',
string1: '<string>',
string2: '<string>',
string3: '<string>',
string4: '<string>',
string5: '<string>',
packages: [{reference: '<string>', weight: 123, height: 123, length: 123, width: 123}]
},
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/shipments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "shipments",
"attributes": {
"goods_out_id": 123,
"carrier_id": 123,
"carrier_service_id": 123,
"reference": "<string>",
"tracking_number": "<string>",
"external_system_reference1": "<string>",
"external_system_reference2": "<string>",
"external_system_reference3": "<string>",
"string1": "<string>",
"string2": "<string>",
"string3": "<string>",
"string4": "<string>",
"string5": "<string>",
"packages": [
{
"reference": "<string>",
"weight": 123,
"height": 123,
"length": 123,
"width": 123
}
]
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "shipments",
"attributes": {
"carrier_service_id": 12,
"packages_changes": [
{
"type": "UPDATE",
"id": 456,
"attributes": {
"weight": 3.0
}
}
]
},
"relationships": {
"address": {
"data": {
"type": "addresses",
"attributes": {
"name": "Jane Smith",
"address_1": "456 High Street",
"postcode": "AB3 4EF",
"country_code": "GB"
}
}
}
}
}
}
Package Operations
| Operation | Description |
|---|---|
ADD | Add new package |
UPDATE | Update existing package (requires id) |
REMOVE | Remove package (requires id) |
Address
To update the delivery address, provide it indata.relationships.address (not in data.attributes).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.
Path Parameters
The unique identifier of the shipment to update
Body
application/json
Show child attributes
Show child attributes
Response
Shipment updated successfully
Show child attributes
Show child attributes
⌘I

