Skip to main content
POST
/
api
/
shipments
Create a shipment
curl --request POST \
  --url https://clarus-api.com/api/shipments \
  --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"
          }
        }
      }
    }
  }
}
'
{
  "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
        }
      ]
    }
  }
}

Request Structure

{
  "data": {
    "type": "shipments",
    "attributes": {
      "goods_out_id": 123,
      "carrier_id": 5,
      "carrier_service_id": 10,
      "packages_changes": [
        {
          "type": "ADD",
          "attributes": {
            "weight": 2.5,
            "length": 30,
            "width": 20,
            "height": 15
          }
        }
      ]
    },
    "relationships": {
      "address": {
        "data": {
          "type": "addresses",
          "attributes": {
            "name": "John Smith",
            "address_1": "123 Main Street",
            "postcode": "AB1 2CD",
            "country_code": "GB"
          }
        }
      }
    }
  }
}

Key Fields

FieldRequiredDescription
goods_out_idYesOrder to ship
carrier_idNoCarrier for delivery
carrier_service_idNoService level
packages_changesNoPackage details (ADD/UPDATE/REMOVE)

Address

An optional delivery address (overrides goods out address) can be provided in data.relationships.address. See the example above.

Package Dimensions

Weight in kg, dimensions in cm.

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Shipment created successfully

data
object