# Buy and render a shipping label

**POST** `/v1/labels`

Base URL: `https://api.parcel-events.example`

Tags: `Labels`

## Authorization

Any ONE of the following options authorizes this operation; every scheme listed within an option is required together.

| Option | Scheme | Type | Sent as | Scopes |
| --- | --- | --- | --- | --- |
| Option 1 | `ApiKey` | `apiKey` | header `Parcel-API-Key` | — |
| Option 2 | `BearerToken` | `http` | `Authorization: Bearer <token>` (opaque) | — |

## Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` (uuid) | Yes | — |

## Request body

Required. Media type: `application/json`

### Example request body

```json
{
  "format": "pdf",
  "page_size": "four_by_six",
  "shipment_id": "shp_00000000000000000001"
}
```

## Responses

| Status | Description | Media type |
| --- | --- | --- |
| `201` | Label created | `application/json` |
| `402` | The synthetic account cannot purchase this label | `application/problem+json` |
| `422` | One or more fields failed semantic validation | `application/problem+json` |

### Example response: 201 — Label created

```json
{
  "download_url": "https://downloads.parcel-events.example/labels/synthetic-label.pdf",
  "expires_at": "2026-06-09T00:00:00Z",
  "format": "pdf",
  "id": "lbl_00000000000000000001",
  "object": "label",
  "price": {
    "amount": "12.50",
    "currency": "XTS"
  },
  "shipment_id": "shp_00000000000000000001"
}
```

### Example response: 402 — The synthetic account cannot purchase this label

```json
{
  "request_id": "req_00000000000000000003",
  "status": 402,
  "title": "Synthetic balance is insufficient",
  "type": "https://parcel-events.example/problems/payment-required"
}
```

### Example response: 422 — One or more fields failed semantic validation

```json
{
  "errors": [
    {
      "message": "must be a synthetic postal code",
      "path": "recipient.postal_code"
    }
  ],
  "request_id": "req_00000000000000000006",
  "status": 422,
  "title": "Synthetic request validation failed",
  "type": "https://parcel-events.example/problems/validation"
}
```

## Related pages

- [Cancel a pickup](./cancelpickup.md)
- [Cancel a shipment before handoff](./cancelshipment.md)
- [Create a shipment](./createshipment.md)
- [Delete a webhook endpoint](./deletewebhookendpoint.md)
- [Labels](./tags/labels.md)
- [List scheduled pickups](./listpickups.md)
- [List shipments](./listshipments.md)
- [List tracking events for a shipment](./listshipmentevents.md)
- [List webhook endpoints](./listwebhookendpoints.md)
- [Parcel Events Sandbox API](../../api.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
