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

# Quickstart

> Create your first Sparqle delivery and print its label.

This guide walks through the full happy path: validate an address, create an
order, and fetch a printable label. You'll use the **test** environment
throughout — nothing here dispatches a real courier.

## Prerequisites

* An **API key** for the test environment
* A **`locationId`** for the pickup location

Both are issued by your Sparqle contact. See [Authentication](/authentication)
for where the key goes, and [Environments](/environments) for base URLs.

<Note>
  The test base URL is `https://staging-v2.sparqle.tech`. Replace it with the
  live URL only once you're ready to ship real parcels.
</Note>

## 1. Check the order

Optional but recommended: validate the recipient address and serviceability
before you commit. Pass your `locationId` in the path.

```bash theme={null}
curl -X POST https://staging-v2.sparqle.tech/orders/check/ABC123 \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "deliveryAddress": {
      "street": "Gustav Mahlerlaan",
      "houseNumber": "320",
      "postalCode": "1082 ME",
      "city": "Amsterdam",
      "countryCode": "NL"
    }
  }'
```

## 2. Create the order

```bash theme={null}
curl -X POST https://staging-v2.sparqle.tech/orders \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "locationId": "ABC123",
    "orderRef": "PADE3JWEA",
    "deliveryName": "Jane Doe",
    "deliveryEmail": "jane@example.com",
    "deliveryPhone": "+31612345678",
    "deliveryAddress": {
      "street": "Gustav Mahlerlaan",
      "houseNumber": "320",
      "postalCode": "1082 ME",
      "city": "Amsterdam",
      "countryCode": "NL"
    }
  }'
```

A successful response returns the created order, including the fields you'll need
next:

```json theme={null}
{
  "orderId": "SPQ-10293",
  "orderRef": "PADE3JWEA",
  "status": "draft",
  "barcode": "3STBXX123456789",
  "trackingUrl": "https://tracking.sparqle.com/barcode/3STBXX123456789"
}
```

<Tip>
  `orderRef` is **your** reference for the order. Keep it stable and unique so
  you can reconcile webhooks and labels against your own system.
</Tip>

## 3. Fetch the label

Use the `orderId` from the previous step. The label comes back as a
base64-encoded PDF.

```bash theme={null}
curl https://staging-v2.sparqle.tech/orders/label/SPQ-10293 \
  -H "api-key: YOUR_API_KEY"
```

Decode the base64 string to a `.pdf` and print it. For multi-parcel shipments,
fetch every label in a bundle at once with
`GET /orders/label/bundle/{orderBundleId}`. See [Labels](/concepts/labels).

## 4. Track the delivery

As the parcel moves, Sparqle sends [webhooks](/webhooks) for each status change,
or you can poll the order. Statuses run from `draft` through to `completed` —
see the [order lifecycle](/concepts/order-lifecycle).

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Keys, headers, and test vs. live.
  </Card>

  <Card title="Order lifecycle" icon="arrows-spin" href="/concepts/order-lifecycle">
    Every status and what it means.
  </Card>

  <Card title="Webhooks" icon="bell" href="/webhooks">
    Receive status updates as they happen.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/introduction">
    Full endpoint and schema details.
  </Card>
</CardGroup>
