Skip to main content

Authentication

Include your API key in the X-API-Key header:
curl https://api.crbtrack.com/api/v1/... \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json"

Create Order

curl -X POST https://api.crbtrack.com/api/v1/orders/create \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "idempotencyKey": "order-12345",
    "sender": {
      "fullName": "John Smith",
      "phone": "+1 305-555-0123",
      "address": {
        "line1": "1234 Main Street",
        "city": "Miami",
        "state": "FL",
        "zipCode": "33101",
        "country": "US"
      }
    },
    "receiver": {
      "fullName": "María García",
      "phone": "+593 99 123 4567",
      "nationalId": "1234567890",
      "address": {
        "line1": "Av. 9 de Octubre 123",
        "city": "Guayaquil",
        "province": "Guayas",
        "zipCode": "090101",
        "country": "EC"
      }
    },
    "parcelDetails": {
      "weightLbs": 2.5,
      "declaredValue": 99.99
    }
  }'

Submit Manifest

curl -X POST https://api.crbtrack.com/api/v1/manifests/submit \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "idempotencyKey": "manifest-12345",
    "awbNumber": "180-12345678",
    "flightNumber": "LA2480",
    "flightDate": "2024-12-25",
    "originAirport": "MIA",
    "destinationAirport": "UIO",
    "carrier": "LATAM Airlines",
    "country": "EC",
    "parcels": [
      {"trackingNumber": "CBECUSD123456789"},
      {"trackingNumber": "CBECUSD123456790"}
    ]
  }'

Void Order

curl -X POST https://api.crbtrack.com/api/v1/orders/void \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "idempotencyKey": "void-12345",
    "trackingNumbers": ["CBECUSD123456789"],
    "reason": "Customer cancelled order"
  }'

Track Single Parcel

curl "https://api.crbtrack.com/api/v1/tracking/CBECUSD123456789?includeHistory=true" \
  -H "X-API-Key: pk_your_api_key"

Batch Tracking

curl -X POST https://api.crbtrack.com/api/v1/tracking/batch \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "trackingNumbers": [
      "CBECUSD123456789",
      "CBECUSD123456790",
      "CBECUSD123456791"
    ],
    "includeHistory": false
  }'

Get Label Info

curl "https://api.crbtrack.com/api/v1/labels/CBECUSD123456789" \
  -H "X-API-Key: pk_your_api_key"

Download Label

# Download as PDF
curl "https://api.crbtrack.com/api/v1/labels/CBECUSD123456789/download" \
  -H "X-API-Key: pk_your_api_key" \
  -o label.pdf

# Download as ZPL
curl "https://api.crbtrack.com/api/v1/labels/CBECUSD123456789/download?format=ZPL" \
  -H "X-API-Key: pk_your_api_key" \
  -o label.zpl

Reprint Label

curl -X POST "https://api.crbtrack.com/api/v1/labels/CBECUSD123456789/reprint" \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "idempotencyKey": "reprint-12345",
    "labelFormat": "PDF"
  }'

Public Tracking (No Auth)

curl "https://api.crbtrack.com/track/CBECUSD123456789"

Error Response Example

# Example error response
{
  "success": false,
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Request validation failed",
    "message_es": "La validación de la solicitud falló",
    "details": {
      "errors": [
        {
          "field": "receiver.nationalId",
          "message": "National ID is required for Ecuador shipments"
        }
      ]
    },
    "requestId": "req_abc123xyz"
  }
}

Shell Script Example

Save as create-order.sh:
#!/bin/bash

API_KEY="${CROSSBORDERLY_API_KEY}"
BASE_URL="https://api.crbtrack.com"

create_order() {
  local order_id="$1"
  local receiver_name="$2"
  local receiver_id="$3"
  
  curl -s -X POST "${BASE_URL}/api/v1/orders/create" \
    -H "X-API-Key: ${API_KEY}" \
    -H "Content-Type: application/json" \
    -d "{
      \"idempotencyKey\": \"order-${order_id}\",
      \"sender\": {
        \"fullName\": \"Your Company\",
        \"phone\": \"+1 305-555-0123\",
        \"address\": {
          \"line1\": \"1234 Warehouse St\",
          \"city\": \"Miami\",
          \"state\": \"FL\",
          \"zipCode\": \"33101\",
          \"country\": \"US\"
        }
      },
      \"receiver\": {
        \"fullName\": \"${receiver_name}\",
        \"phone\": \"+593 99 123 4567\",
        \"nationalId\": \"${receiver_id}\",
        \"address\": {
          \"line1\": \"Av. 9 de Octubre 123\",
          \"city\": \"Guayaquil\",
          \"province\": \"Guayas\",
          \"zipCode\": \"090101\",
          \"country\": \"EC\"
        }
      },
      \"parcelDetails\": {
        \"weightLbs\": 2.5,
        \"declaredValue\": 99.99
      }
    }"
}

# Usage: ./create-order.sh ORDER_ID "Receiver Name" "1234567890"
result=$(create_order "$1" "$2" "$3")
echo "$result" | jq .

Using with jq

Parse responses with jq:
# Extract tracking number
curl -s ... | jq -r '.parcel.trackingNumber'

# Check success status
curl -s ... | jq -r '.success'

# Get all errors
curl -s ... | jq -r '.error.details.errors[]?.message'