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

# List orders

# `OrderingQuery.orders()`

```graphql theme={null}
type OrderingQuery {
  orders(after: String): OrderingOrdersConnection!
}
```

Returns a list of all orders for the authenticated organization.

## Input

### `after` (optional)

`String` - A cursor value used for pagination. When provided, the query returns orders after the specified cursor. To paginate through results, use the `cursor` value from the last edge of the previous response.

**Example:**

```graphql theme={null}
query GetOrders {
  ordering {
    orders(after: "eyJpZCI6IjEyMyJ9") {
      edges {
        cursor
        node {
          id
        }
      }
    }
  }
}
```

## Response

### `OrderingOrdersConnection`

[`OrderingOrdersConnection`](#orderingordersconnection) - A connection object containing a list of orders.

## `OrderingOrdersConnection`

```graphql theme={null}
type OrderingOrdersConnection {
  edges: [OrderingOrdersEdge!]!
}
```

### `edges`

[`OrderingOrdersEdge[]`](#orderingordersedge) - An array of edges, each containing an order node.

## `OrderingOrdersEdge`

```graphql theme={null}
type OrderingOrdersEdge {
  node: OrderingOrder!
  cursor: String!
}
```

### `node`

[`OrderingOrder`](/graphql/ordering/ordering-order) - The order object containing all order details.

### `cursor`

`String` - A unique cursor value for this edge. Use this value as the `after` parameter in subsequent queries to fetch the next page of results.

<Warning>
  Cursor values should be treated as opaque identifiers. While they may appear numeric in the current implementation,
  their format is subject to change and should not be parsed or manipulated.
</Warning>

## Pagination

The `orders` query uses cursor-based pagination, allowing you to efficiently paginate through large sets of orders. Each edge in the response includes a `cursor` field that can be used to fetch the next set of results.

### How It Works

1. Make an initial query without the `after` parameter to get the first page of results
2. Extract the `cursor` value from the last edge in the response
3. Use that `cursor` as the `after` parameter in your next query to fetch the next page
4. Repeat until you've retrieved all the orders you need

### Example: Paginating Through Orders

**Initial Request (First Page):**

```graphql theme={null}
query GetFirstPageOfOrders {
  ordering {
    orders {
      edges {
        cursor
        node {
          id
          status
          createdAt
        }
      }
    }
  }
}
```

**Response:**

```json theme={null}
{
  "data": {
    "ordering": {
      "orders": {
        "edges": [
          {
            "cursor": "1",
            "node": {
              "id": "order-123",
              "status": "Delivered",
              "createdAt": "2024-01-15T10:30:00Z"
            }
          },
          {
            "cursor": "2",
            "node": {
              "id": "order-124",
              "status": "In_Transit",
              "createdAt": "2024-01-16T14:20:00Z"
            }
          }
        ]
      }
    }
  }
}
```

**Subsequent Request (Next Page):**

```graphql theme={null}
query GetNextPageOfOrders {
  ordering {
    orders(after: "2") {
      edges {
        cursor
        node {
          id
          status
          createdAt
        }
      }
    }
  }
}
```

This will return the next set of orders after the cursor value "2".
