---
title: "Buy a shipping label"
method: POST
path: "/v1/labels"
tags: ["ship"]
---

# Buy a shipping label

`POST /v1/labels`

## Request

- Base URL: `https://api.noerrands.com/c/ship`
- URL: `https://api.noerrands.com/c/ship/v1/labels`
- Auth: HTTP bearer

Buy the outbound shipping label for one quote_id, with confirm true; CONSEQUENTIAL -- it charges that quote's price_cents in credits and buys real postage -- and returns the printable label_url (PDF) and the tracking number, plus a USPS QR code if qr_code is true. Sensitive write: it requires the human's approval of that quote's carrier, delivery days and price. A short balance returns 402 with a topup_url. A replay with the same idempotency_key returns the original label and never buys twice.

## Request body

- object
  - `quote_id` string, required: One quote_id from get_shipping_rates, the option the human approved.
  - `confirm` true, required: Must be true. Set it only after the human approved this exact action and price.
  - `qr_code` boolean: USPS only: also return a QR code the human can show at any post office instead of printing the label.
  - `idempotency_key` string: Use one key per human request. Replays within 24 hours return the original result instead of buying twice.

## Response `200`

Success.

- object
  - `shipment_id` string, required: Opaque id, "sh_...". Use it with get_shipment.
  - `kind` 'outbound' | 'return', required
  - `status` 'unknown' | 'pre_transit' | 'in_transit' | 'out_for_delivery' | 'delivered' | 'available_for_pickup' | 'return_to_sender' | 'failure' | 'cancelled' | 'error', required: The carrier's tracking status. pre_transit means the label exists and nothing has been scanned yet.
  - `carrier` string, required
  - `service` string, required
  - `tracking_code` string, required
  - `label_url` string, uri: The printable PDF label. Gone after the retention window.
  - `qr_code_url` string, uri: USPS QR code image. The human shows it at a post office counter and the clerk prints the label.
  - `tracking_url` string, uri: The carrier's public tracking page.
  - `est_delivery_date` string
  - `credits_charged_cents` integer, required: Net credits this label cost: zero once a refund has been confirmed.
  - `refund_status` 'none' | 'submitted' | 'refunded' | 'rejected', required: none, or after void_label: submitted (waiting on the carrier), refunded (credits are back), rejected (the label was used or too old).
  - `from` object, required: A US postal address as stored. After the 30-day retention window only city, state and the first 3 ZIP digits remain; name, company and street lines are permanently removed.
    - `name` string: Recipient or sender name, 1-40 characters.
    - `company` string: Optional company line, up to 40 characters.
    - `line1` string: Street address, up to 64 characters.
    - `line2` string: Apartment, suite, or unit, up to 64 characters.
    - `city` string, required
    - `state` string, required: Two-letter US state code.
    - `zip` string: ZIP code, 5 digits or ZIP+4 -- or just the first 3 digits once redacted.
    - `country` 'US': US only in v0.
  - `to` object, required: A US postal address as stored. After the 30-day retention window only city, state and the first 3 ZIP digits remain; name, company and street lines are permanently removed.
    - `name` string: Recipient or sender name, 1-40 characters.
    - `company` string: Optional company line, up to 40 characters.
    - `line1` string: Street address, up to 64 characters.
    - `line2` string: Apartment, suite, or unit, up to 64 characters.
    - `city` string, required
    - `state` string, required: Two-letter US state code.
    - `zip` string: ZIP code, 5 digits or ZIP+4 -- or just the first 3 digits once redacted.
    - `country` 'US': US only in v0.
  - `created_at` string, date-time, required
  - `balance_cents` integer, required: General credit left after the charge.

## Other responses

- `400`: invalid_request
- `401`: unauthorized. Carries WWW-Authenticate: Bearer resource_metadata="..."
- `402`: insufficient_credits, with required_cents, balance_cents, topup_url and packs.
- `403`: forbidden_scope: a write tool called with a read-only key.
- `404`: not_found
- `409`: idempotency_conflict
- `429`: rate_limited
- `502`: provider_error

---

[API](https://skmtc.dev/noerrands/apis/no-errands-ship-api.md) · [All operations](https://skmtc.dev/noerrands/apis/no-errands-ship-api/llms.txt) · [OpenAPI document](https://skmtc.dev/noerrands/apis/no-errands-ship-api/revisions/f0615c6bd5d8?raw)
