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

# Orders

> Query order status via the Public API

# Orders

Query the fulfillment status of orders by their associated prescription UIDs.

## Get Order Status

Retrieve order and fulfillment status for one or more prescriptions.

```bash theme={null}
GET /v2/public-api/orders/{shop_identifier}
```

<ParamField path="shop_identifier" type="string" required>
  Unique identifier for the shop
</ParamField>

<ParamField query="prescription_uids" type="string" required>
  Comma-separated list of prescription UIDs (max 50)
</ParamField>

**Required permission:** `order:read`

### Example Request

```bash theme={null}
curl -X GET "https://api.rxscale.com/v2/public-api/orders/my-shop?prescription_uids=px-abc123,px-def456" \
  -H "X-API-Key: your-api-key-here"
```

### Response

```json theme={null}
{
  "data": [
    {
      "prescription_uid": "px-abc123",
      "order_status": "completed",
      "fulfillment_status": "fulfilled",
      "tracking_number": "1Z999AA10123456784",
      "tracking_url": "https://tracking.example.com/1Z999AA10123456784",
      "created_at": "2025-03-15T10:30:00Z",
      "fulfilled_at": "2025-03-17T14:00:00Z",
      "line_items": [
        {
          "sku_uid": "sku-456",
          "display_name": "Medication X 100mg",
          "quantity": 1
        }
      ]
    },
    {
      "prescription_uid": "px-def456",
      "order_status": "processing",
      "fulfillment_status": "unfulfilled",
      "tracking_number": null,
      "tracking_url": null,
      "created_at": "2025-03-16T09:00:00Z",
      "fulfilled_at": null,
      "line_items": [
        {
          "sku_uid": "sku-789",
          "display_name": "Medication Y 50mg",
          "quantity": 2
        }
      ]
    }
  ]
}
```

### Response Fields

| Field                | Type           | Description                                                            |
| -------------------- | -------------- | ---------------------------------------------------------------------- |
| `prescription_uid`   | string         | The prescription UID queried                                           |
| `order_status`       | string         | Current order status                                                   |
| `fulfillment_status` | string         | Fulfillment status (`fulfilled`, `unfulfilled`, `partially_fulfilled`) |
| `tracking_number`    | string or null | Shipping tracking number (if available)                                |
| `tracking_url`       | string or null | Shipping tracking URL (if available)                                   |
| `created_at`         | string         | Order creation timestamp (ISO 8601)                                    |
| `fulfilled_at`       | string or null | Fulfillment timestamp (ISO 8601, if fulfilled)                         |
| `line_items`         | array          | Items in the order                                                     |

### Error Responses

| Status Code | Description                                                         |
| ----------- | ------------------------------------------------------------------- |
| `400`       | Missing `prescription_uids` parameter or more than 50 UIDs provided |
| `404`       | Shop not found                                                      |
