Skip to content

pos-list-orders ​

Method: GET
Path: /pos/orders

Tags: Orders

Summary ​

List all orders

Description ​

Lists orders matching the supplied filters. Staff can retrieve orders across all store locations.

Pos SDK Usage ​

SDK Method: pos.listOrders()

Example:

typescript
// Basic order listing
const { data, error } = await pos.listOrders();

if (error) {
  console.error("Failed to list orders:", error.message);
} else {
  console.log("Orders found:", data.orders?.length || 0);
  console.log("Pagination:", data.pagination);
  data.orders?.forEach(order => {
    console.log(`Order: ${order.order_number} - Status: ${order.status} - Total: ${order.grand_total}`);
  });
}

// With filters and pagination
const { data: filteredData, error: filteredError } = await pos.listOrders({
  page: 1,
  limit: 50,
  search: "ORD-2024",
  filters: JSON.stringify({ "status": "delivered", "payment_status": "success" }),
  sort_by: JSON.stringify({ "order_date": "desc" })
});

TypeScript Definition ​

typescript
"pos-list-orders": {
        parameters: {
            query?: {
                /** @description Page number, starting at 1. Non-integer values and values below 1 return 400. */
                page?: components["parameters"]["pageNumber"];
                /** @description Results per page. Values outside 1–100 are clamped to that range. Non-integer input returns 400. */
                limit?: components["parameters"]["pageLimit"];
                /** @description JSON object */
                filters?: components["parameters"]["columnBasedFilters"];
                /** @description JSON string format: {"field1":"asc", "field2":"desc"} */
                sort_by?: components["parameters"]["sortByOptions"];
                /** @description search keyword */
                search?: components["parameters"]["searchKeyword"];
                /** @description Case-insensitive match within the billing first name. */
                billing_first_name?: string;
                /** @description Case-insensitive match within the billing phone number. */
                billing_phone?: string;
                /** @description Case-insensitive match within the coupon code. */
                coupon_code?: string;
                /** @description Filter orders by whether they contain a subscription. */
                on_subscription?: boolean;
                /** @description Comma-separated payment statuses; optional square brackets and quotes are accepted. */
                payment_status?: string;
                /** @description Comma-separated order statuses; optional square brackets and quotes are accepted. */
                status?: string;
            };
            header?: never;
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            orders: components["schemas"]["OrderList"][];
                            pagination: components["schemas"]["AdminPagination"];
                        };
                    };
                };
            };
            400: components["responses"]["AdminBadRequest"];
            401: components["responses"]["AdminUnauthorized"];
            403: components["responses"]["Forbidden"];
            404: components["responses"]["NotFound"];
            500: components["responses"]["AdminInternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["parameters"]["pageNumber"]pageNumber
components["parameters"]["pageLimit"]pageLimit
components["parameters"]["columnBasedFilters"]columnBasedFilters
components["parameters"]["sortByOptions"]sortByOptions
components["parameters"]["searchKeyword"]searchKeyword
components["schemas"]["OrderList"]OrderList
components["schemas"]["AdminPagination"]AdminPagination
components["responses"]["AdminBadRequest"]AdminBadRequest
components["responses"]["AdminUnauthorized"]AdminUnauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["NotFound"]NotFound
components["responses"]["AdminInternalServerError"]AdminInternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • search (query): search keyword
  • billing_first_name (query): Case-insensitive match within the billing first name.
  • billing_phone (query): Case-insensitive match within the billing phone number.
  • coupon_code (query): Case-insensitive match within the coupon code.
  • on_subscription (query): Filter orders by whether they contain a subscription.
  • payment_status (query): Comma-separated payment statuses; optional square brackets and quotes are accepted.
  • status (query): Comma-separated order statuses; optional square brackets and quotes are accepted.

Responses ​

200 ​

OK

400 ​

401 ​

403 ​

Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.

404 ​

Requested resource not found

500 ​

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "operationId": "pos-list-orders",
  "summary": "List all orders",
  "description": "Lists orders matching the supplied filters. Staff can retrieve orders across all store locations.",
  "parameters": [
    {
      "$ref": "#/components/parameters/pageNumber"
    },
    {
      "$ref": "#/components/parameters/pageLimit"
    },
    {
      "$ref": "#/components/parameters/columnBasedFilters"
    },
    {
      "$ref": "#/components/parameters/sortByOptions"
    },
    {
      "$ref": "#/components/parameters/searchKeyword"
    },
    {
      "name": "billing_first_name",
      "in": "query",
      "description": "Case-insensitive match within the billing first name.",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "billing_phone",
      "in": "query",
      "description": "Case-insensitive match within the billing phone number.",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "coupon_code",
      "in": "query",
      "description": "Case-insensitive match within the coupon code.",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "on_subscription",
      "in": "query",
      "description": "Filter orders by whether they contain a subscription.",
      "required": false,
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "payment_status",
      "in": "query",
      "description": "Comma-separated payment statuses; optional square brackets and quotes are accepted.",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "status",
      "in": "query",
      "description": "Comma-separated order statuses; optional square brackets and quotes are accepted.",
      "required": false,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "orders": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/OrderList"
                    }
                  },
                  "pagination": {
                    "$ref": "#/components/schemas/AdminPagination"
                  }
                },
                "required": [
                  "orders",
                  "pagination"
                ],
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "content"
            ]
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/AdminBadRequest"
    },
    "401": {
      "$ref": "#/components/responses/AdminUnauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "500": {
      "$ref": "#/components/responses/AdminInternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-list-orders"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Orders"
  ],
  "x-speakeasy-group": "pos"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: