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

# Track an Order

This guide shows you how to programmatically check if Quivo shipped an order and retrieve the carrier's tracking link to share with your customer.

## Prerequisites

Before you start, make sure you have:

* **Session token:** A valid session token. See the [Authentication guide](/api-reference/authentication) to learn how to obtain one.
* **Order ID:** The unique integer `orderId` returned when you created the order. Use the [`GET /orders endpoint`](/api-reference/#tag/orders) to find it.

<Note>
  All API examples in this guide use `${BASE_URL}` as a placeholder. Replace it with the correct base URL configured for the correct environment. For more information see [Environments page](/api-reference/environments).
</Note>

## Retrieve order details

To track an order, retrieve its full details using its unique ID via the [`GET /orders/{orderId} endpoint`](/api-reference/#tag/orders).

A successful request returns a 200 OK status. The response body contains the order's current state. Focus on two specific sections: the status and the tracking information. Timestamps use the ISO 8601 pattern YYYY-MM-DDTHH:mm:ssZ in Coordinated Universal Time UTC.

<Tabs>
  <Tab title="Request">
    Use this request to retrieve the current status and tracking information for a specific order:

    ```bash theme={null}
    curl -X GET "${BASE_URL}/orders/<YOUR_ORDER_ID>" \
      -H "X-Api-Key: <YOUR_STATIC_API_KEY>" \
      -H "Authorization: <YOUR_SESSION_TOKEN>"
    ```
  </Tab>

  <Tab title="Response">
    A successful request returns a `200 OK` status code.

    ```json theme={null}
    {
      "orderId": <YOUR_ORDER_ID>,
      "orderIdentifier": "<YOUR_ORDER_IDENTIFIER>",
      "orderReference": "<YOUR_ORDER_REFERENCE>",
      "orderStatus": "<ORDER_STATUS>",
      "orderDate": "<YYYY-MM-DDTHH:mm:ssZ>",
      "completedAt": "<YYYY-MM-DDTHH:mm:ssZ>",
      "shippingMethodName": "<SHIPPING_METHOD_NAME>",
      "shipmentTracking": [
        {
          "number": "<TRACKING_NUMBER>",
          "link": "<TRACKING_LINK>"
        }
      ],
      "positions": [
        {
          "sku": "<YOUR_SKU>",
          "name": "<PRODUCT_NAME>",
          "quantity": <QUANTITY>
        }
      ]
    }
    ```

    Locate the `orderStatus` field in the response body. This field indicates where the order is in the fulfillment lifecycle.

    | Status       | Description                                                                                     |
    | ------------ | ----------------------------------------------------------------------------------------------- |
    | `PENDING`    | The order has been received; however, we cannot start processing it due to missing information. |
    | `PROCESSING` | The warehouse is currently picking and packing the items.                                       |
    | `COMPLETED`  | The warehouse packed the order and handed it over to the carrier.                               |
    | `CANCELLED`  | The order is cancelled before fulfillment.                                                      |

    Once the status changes to `COMPLETED`, the system generates tracking information. Find this in the `shipmentTracking` array.

    * `number`: The tracking number assigned by the carrier.
    * `link`: A direct URL to the carrier's tracking page.
  </Tab>
</Tabs>

## Where to go next

Now that you can track orders, you can continue with these guides:

<CardGroup cols={2}>
  <Card title="Manage Returns" icon="rotate-left" href="/docs/quickstart/manage-returns">
    Generate return labels and track returned items when customers need to send products back.
  </Card>

  <Card title="Manage Webhooks" icon="bell" href="/docs/webhooks/create-subscriptions">
    Automate order tracking by setting up webhooks to receive real-time status updates.
  </Card>
</CardGroup>
