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

# List orders

> Retrieve orders for the authenticated shopper with optional filters.

## Request

```http theme={null}
GET /orders
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
```

## Headers

| Header          | Type   | Description                                              |
| --------------- | ------ | -------------------------------------------------------- |
| `Authorization` | string | Provide the customer token in the format `Bearer <jwt>`. |
| `x-shop-id`     | string | Identify the shop that owns the orders.                  |

## Query parameters

| Parameter  | Type   | Description                                                                                                                                   |
| ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`   | string | Filter by order status. Can be specified multiple times. Valid values: `pending`, `processing`, `paid`, `completed`, `cancelled`, `refunded`. |
| `orderId`  | number | Filter by specific order number.                                                                                                              |
| `minTotal` | number | Filter orders with subtotal greater than or equal to this value.                                                                              |
| `maxTotal` | number | Filter orders with subtotal less than or equal to this value.                                                                                 |
| `from`     | string | Filter orders created after this date (ISO 8601 format).                                                                                      |
| `to`       | string | Filter orders created before this date (ISO 8601 format).                                                                                     |
| `page`     | number | Page number for pagination (default: 1).                                                                                                      |
| `limit`    | number | Number of items per page (default: 10).                                                                                                       |

## Request examples

### Get all orders

```http theme={null}
GET /orders
```

### Filter by single status

```http theme={null}
GET /orders?status=pending
```

### Filter by multiple statuses

```http theme={null}
GET /orders?status=pending&status=paid
```

### Filter by total range

```http theme={null}
GET /orders?minTotal=100&maxTotal=500
```

### Filter by date range

```http theme={null}
GET /orders?from=2025-01-01T00:00:00.000Z&to=2025-12-31T23:59:59.999Z
```

### Filter by order number

```http theme={null}
GET /orders?orderId=9
```

### Pagination

```http theme={null}
GET /orders?page=2&limit=5
```

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Orders retrieved",
    "data": {
        "orders": [
            {
                "_id": "6938414ad9485f4d96134f8c",
                "user": "669d5dcf3cc9c8596ec0f302",
                "shop": "68b8f52575da81b332af29f1",
                "items": [
                    {
                        "product": "68bc52f0e15404b8e40a7c52",
                        "variant": "692caacbb07303c9be5ea8f2",
                        "name": "Classic Hoodie",
                        "sku": "HOODIE-GREEN-M",
                        "price": 25000,
                        "quantity": 1,
                        "variantAttributes": {
                            "color": "green"
                        },
                        "imageUrl": "https://cdn.salesive.com/products/hoodie.jpg",
                        "_id": "6938414ad9485f4d96134f8d"
                    }
                ],
                "status": "completed",
                "payment": {
                    "_id": "693b7cb3e1906f5273e48135",
                    "shop": "68b8f52575da81b332af29f1",
                    "channel": "other",
                    "transactionId": "9859451",
                    "provider": "flutterwave",
                    "amount": 19477.2,
                    "total": 19876,
                    "currency": "NGN",
                    "status": "completed",
                    "createdAt": "2025-12-12T02:23:47.841Z",
                    "updatedAt": "2025-12-12T02:23:47.841Z"
                },
                "discount": 6250,
                "coupon": "690f5d8a088bef812956b384",
                "subtotal": 25000,
                "shippingCost": 727.2,
                "fee": 0,
                "tax": 0,
                "shipment": {
                    "_id": "693aa5ed1141d1a105282ba2",
                    "courier": {
                        "id": "express_courier",
                        "name": "Express Delivery",
                        "image": "https://cdn.salesive.com/couriers/express.png"
                    },
                    "estimatedDelivery": "2025-12-14T11:07:24.000Z"
                },
                "orderId": 9,
                "createdAt": "2025-12-09T15:33:30.039Z",
                "updatedAt": "2026-02-16T12:13:31.035Z"
            }
        ],
        "pagination": {
            "page": 1,
            "limit": 10,
            "total": 1,
            "pages": 1
        }
    }
}
```

## Error response

```json theme={null}
{
    "status": 401,
    "success": false,
    "message": "Unauthorized",
    "data": {}
}
```


## OpenAPI

````yaml GET /orders
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /orders:
    get:
      summary: List orders
      description: Retrieve orders for the authenticated shopper with optional filters.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
        - name: status
          in: query
          description: Filter by order status. Can be specified multiple times.
          schema:
            type: string
            enum:
              - pending
              - processing
              - paid
              - cancelled
              - refunded
        - name: orderId
          in: query
          description: Filter by specific order ID.
          schema:
            type: integer
        - name: minTotal
          in: query
          description: Filter orders with total greater than or equal to this value.
          schema:
            type: number
        - name: maxTotal
          in: query
          description: Filter orders with total less than or equal to this value.
          schema:
            type: number
        - name: from
          in: query
          description: Filter orders created after this date (ISO 8601 format).
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: Filter orders created before this date (ISO 8601 format).
          schema:
            type: string
            format: date-time
        - name: page
          in: query
          description: 'Page number for pagination (default: 1).'
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          description: 'Number of items per page (default: 10).'
          schema:
            type: integer
            minimum: 1
            default: 10
      responses:
        '200':
          description: Orders retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderListResponse'
        '401':
          description: Unauthorized.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  schemas:
    OrderListResponse:
      type: object
      required:
        - status
        - success
        - message
        - data
      properties:
        status:
          type: integer
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          required:
            - orders
            - pagination
          properties:
            orders:
              type: array
              items:
                $ref: '#/components/schemas/Order'
            pagination:
              type: object
              properties:
                page:
                  type: integer
                limit:
                  type: integer
                total:
                  type: integer
                pages:
                  type: integer
    Order:
      type: object
      required:
        - _id
        - orderId
        - user
        - shop
        - items
        - status
        - subtotal
        - shippingCost
        - total
      properties:
        _id:
          type: string
          description: Order identifier.
        orderId:
          type: integer
          description: Human-readable order number.
        user:
          type: string
          description: Identifier of the shopper who placed the order.
        shop:
          type: string
          description: Identifier of the shop associated with the order.
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
        status:
          type: string
          enum:
            - pending
            - processing
            - paid
            - cancelled
            - refunded
          description: Current status of the order.
        subtotal:
          type: number
          description: Subtotal before shipping costs.
        shippingCost:
          type: number
          description: Shipping cost for the order.
        total:
          type: number
          description: Total order amount (subtotal + shippingCost).
        shippingAddress:
          nullable: true
          deprecated: true
          description: >-
            Legacy embedded address; absent on current orders — use the
            shipment's shippingAddress instead.
          allOf:
            - $ref: '#/components/schemas/OrderAddress'
        payment:
          type: string
          description: Payment identifier.
        shipment:
          type: string
          description: Shipment identifier.
        notes:
          type: string
          description: Additional order notes.
        additionalInfo:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalInfoItem'
          description: Custom labelled key/value info attached to the order.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    OrderItem:
      type: object
      required:
        - product
        - name
        - price
        - quantity
      properties:
        product:
          type: string
          description: Product identifier.
        variant:
          type: string
          description: Variant identifier if applicable.
        name:
          type: string
          description: Product name.
        sku:
          type: string
          description: Product SKU.
        price:
          type: number
          description: Unit price at time of order.
        quantity:
          type: integer
          minimum: 1
          description: Quantity ordered.
        variantAttributes:
          type: object
          additionalProperties:
            type: string
        imageUrl:
          type: string
          format: uri
    OrderAddress:
      type: object
      properties:
        fullName:
          type: string
        addressLine1:
          type: string
        addressLine2:
          type: string
        city:
          type: string
        state:
          type: string
        zipCode:
          type: string
        country:
          type: string
        phoneNumber:
          type: string
      nullable: true
      deprecated: true
      description: >-
        Legacy embedded order address — not populated on current orders (no live
        order carries it). The delivery address lives on the order's shipment:
        see the shipment's shippingAddress, or GET /shipping/shipments.
    AdditionalInfoItem:
      type: object
      required:
        - label
      properties:
        label:
          type: string
          maxLength: 100
          description: The name of the field (e.g. "Gift message").
        value:
          type: string
          maxLength: 2000
          description: The field value.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````