Skip to main content
POST
/
api
/
carriers
Create a carrier
curl --request POST \
  --url https://clarus-api.com/api/carriers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "carriers",
    "attributes": {
      "code": "DHL",
      "name": "DHL Express",
      "description": "DHL international courier",
      "active": true
    }
  }
}
'
{
  "data": {
    "id": "5",
    "type": "carriers",
    "attributes": {
      "code": "DHL",
      "name": "DHL Express",
      "description": "DHL international courier",
      "active": true
    }
  }
}

Request Structure

{
  "data": {
    "type": "carriers",
    "attributes": {
      "code": "DHL",
      "name": "DHL Express",
      "active": true
    }
  }
}

Key Fields

FieldRequiredDescription
codeYesUnique carrier code (max 50)
nameYesCarrier display name (max 50)
descriptionNoCarrier description
activeNoWhether the carrier is active
carrier_authenticationNoProvider-specific credentials object

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

Carrier created successfully

data
object