> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crbtrack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Overview

> Complete reference for the CrossBorderly Shipping API

## Base URL

<Tabs>
  <Tab title="Production">
    ```
    https://api.crbtrack.com
    ```
  </Tab>

  <Tab title="Sandbox">
    ```
    https://sandbox.crbtrack.com
    ```
  </Tab>
</Tabs>

## Authentication

All endpoints require an API key in the `X-API-Key` header:

```bash theme={null}
curl -H "X-API-Key: <YOUR_API_KEY>" https://api.crbtrack.com/api/v1/...
```

See [Authentication](/authentication) for details on obtaining and managing API keys.

## Content Type

All requests must use JSON:

```
Content-Type: application/json
```

## Endpoints Overview

### Legacy Public API

Verbatim legacy endpoints for customers that cannot migrate:

* [Legacy Public API](/api-reference/legacy/overview)

### Orders

| Method | Endpoint                | Description                 |
| ------ | ----------------------- | --------------------------- |
| `POST` | `/api/v1/orders/create` | Create a new shipping order |
| `POST` | `/api/v1/orders/void`   | Void one or more orders     |

### Manifests

| Method | Endpoint                   | Description                      |
| ------ | -------------------------- | -------------------------------- |
| `POST` | `/api/v1/manifests/submit` | Submit a shipping manifest (AWB) |

### Tracking

| Method | Endpoint                            | Description                   |
| ------ | ----------------------------------- | ----------------------------- |
| `GET`  | `/api/v1/tracking/{trackingNumber}` | Get single parcel tracking    |
| `POST` | `/api/v1/tracking/batch`            | Get multiple parcels tracking |

### Labels

| Method | Endpoint                                   | Description         |
| ------ | ------------------------------------------ | ------------------- |
| `GET`  | `/api/v1/labels/{trackingNumber}`          | Get label metadata  |
| `GET`  | `/api/v1/labels/{trackingNumber}/download` | Download label file |
| `POST` | `/api/v1/labels/{trackingNumber}/reprint`  | Regenerate a label  |

### Public Tracking

| Method | Endpoint                  | Description               |
| ------ | ------------------------- | ------------------------- |
| `GET`  | `/track/{trackingNumber}` | Public tracking (no auth) |

## Request/Response Format

### Successful Response

```json theme={null}
{
  "success": true,
  "data": { ... },
  "meta": {
    "requestId": "req_abc123xyz"
  }
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "message_es": "Mensaje de error en español",
    "details": { ... },
    "requestId": "req_abc123xyz"
  }
}
```

## Common Headers

### Request Headers

| Header              | Required | Description                        |
| ------------------- | -------- | ---------------------------------- |
| `X-API-Key`         | Yes      | Your API key                       |
| `Content-Type`      | Yes      | Must be `application/json`         |
| `X-Idempotency-Key` | No       | Prevents duplicate requests        |
| `Accept-Language`   | No       | `en` or `es` for response language |

### Response Headers

| Header                  | Description                        |
| ----------------------- | ---------------------------------- |
| `X-Request-Id`          | Unique request ID for support      |
| `X-RateLimit-Limit`     | Max requests per window            |
| `X-RateLimit-Remaining` | Requests remaining                 |
| `X-RateLimit-Reset`     | When limit resets (Unix timestamp) |

## HTTP Status Codes

| Code  | Meaning                               |
| ----- | ------------------------------------- |
| `200` | Success                               |
| `201` | Created                               |
| `400` | Bad Request (validation error)        |
| `401` | Unauthorized (invalid API key)        |
| `403` | Forbidden (insufficient permissions)  |
| `404` | Not Found                             |
| `409` | Conflict (duplicate, locked resource) |
| `429` | Rate Limit Exceeded                   |
| `500` | Internal Server Error                 |

## Idempotency

For `POST` requests that create resources, include an `idempotencyKey`:

```json theme={null}
{
  "idempotencyKey": "unique-request-id-12345",
  ...
}
```

If you retry a request with the same `idempotencyKey` within 24 hours, the original response is returned without creating a duplicate.

<Info>
  Use your order ID, UUID, or timestamp-based key for idempotency.
</Info>

## Pagination

List endpoints support pagination:

```
GET /api/v1/parcels?page=1&limit=50
```

Response includes pagination metadata:

```json theme={null}
{
  "data": [...],
  "meta": {
    "page": 1,
    "limit": 50,
    "total": 1234,
    "totalPages": 25
  }
}
```

## Try It Now

Use the interactive playground on each endpoint page to test API calls directly in your browser.

<Card title="Create Your First Order" icon="plus" href="/api-reference/orders/create-order">
  Start by creating a test order in sandbox mode
</Card>
