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

# Introduction

> Get started with the UniUni Platform Client API

The UniUni Platform Client API lets you programmatically create shipments, purchase labels, manage batches, track deliveries, and receive webhook notifications.

## Environments

We provide both **sandbox** and **production** environments. Test your integration in sandbox first before going live.

| Environment | Base URL                                      |
| ----------- | --------------------------------------------- |
| Sandbox     | `https://api-sandbox.ship.uniuni.com/client/` |
| Production  | `https://api.ship.uniuni.com/prod/client/`    |

All requests are HTTPS only.

## Authentication

Every request must include your **API access token** in the `Authorization` header:

```
Authorization: Bearer <YOUR_ACCESS_TOKEN>
```

See [Create Access Token](/en/api/create-access-token) for step-by-step instructions on generating and managing your tokens.

## Request & response format

* All requests and responses use **JSON**.
* Use `Content-Type: application/json; charset=utf-8` for POST bodies.
* All object keys are in **camelCase**.
* Response HTTP code is always `200` with a valid payload. Invalid payloads return HTTP `422`.

Every response follows this structure:

```json theme={null}
{
  "message": "Shipment created successfully",
  "code": 0,
  "data": { ... }
}
```

| Field     | Type           | Description                                           |
| --------- | -------------- | ----------------------------------------------------- |
| `message` | string         | Additional information about the request status       |
| `code`    | integer        | Status code (`0` indicates success)                   |
| `data`    | object \| null | Response payload. Returns `null` if `code` is not `0` |

## Pagination

Collection endpoints support pagination via query parameters:

| Parameter  | Default | Max | Description      |
| ---------- | ------- | --- | ---------------- |
| `page`     | 1       | —   | Page number      |
| `pageSize` | 10      | 500 | Results per page |

## Sandbox testing

You can test your integration freely using the sandbox base URL. No charges will be incurred. Sandbox data is isolated and can be reset without affecting production.

To add test credits in sandbox, use the test credit card number **4242 4242 4242 4242** with any expiry and CVC.

## Error handling

### 422 Unprocessable Content

Returned when required parameters are missing or have the wrong type:

```json theme={null}
{
  "message": "Invalid payload [...]",
  "errorCode": "PayloadValidationError",
  "statusCode": 422,
  "meta": {
    "issues": [
      {
        "code": "invalid_type",
        "expected": "number",
        "received": "nan",
        "path": ["page"],
        "message": "Expected number, received nan"
      }
    ],
    "name": "ZodError"
  }
}
```

### Authentication errors

```json theme={null}
{
  "message": "Invalid or revoked access token",
  "code": 1009,
  "data": null
}
```

```json theme={null}
{
  "message": "Missing access token",
  "code": 1009,
  "data": null
}
```

### Error codes

| Code   | Reason                              |
| ------ | ----------------------------------- |
| `0`    | Success                             |
| `1002` | Invalid request                     |
| `1006` | Database error                      |
| `1009` | General error                       |
| `1014` | Resource not found (labels/batches) |
| `1031` | Tracking lookup failed              |
