Skip to main content
POST
/
api
/
custom_carrier_types
Create a custom carrier type
curl --request POST \
  --url https://clarus-api.com/api/custom_carrier_types \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "custom_carrier_types",
    "attributes": {
      "name": "DPD Express",
      "code": "DPDEXP",
      "print_params": {
        "orientation": "portrait",
        "page_width": 100,
        "page_height": 150,
        "top": 5,
        "bottom": 5,
        "left": 5,
        "right": 5
      }
    }
  }
}
'
{
  "data": {
    "id": "9",
    "type": "custom_carrier_types",
    "attributes": {
      "name": "DPD Express",
      "code": "DPDEXP",
      "print_params": {
        "orientation": "portrait",
        "page_width": 100,
        "page_height": 150
      }
    }
  }
}

Request Structure

{
  "data": {
    "type": "custom_carrier_types",
    "attributes": {
      "name": "DPD Express",
      "code": "DPDEXP",
      "print_params": {
        "orientation": "portrait",
        "page_width": 100.0,
        "page_height": 150.0
      }
    }
  }
}

Key Fields

FieldRequiredDescription
nameNoCustom carrier type name
codeNoCustom carrier type code
print_paramsNoPage dimensions and margins for the printable label/document template
The printable template asset is uploaded separately via POST /api/custom_carrier_types/{id}/attachment.

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

Created successfully

data
object