Skip to content

pos-list-customers

Method: GET
Path: /pos/customers

Tags: POSAdmin

Summary

List all customers

Description

List all customers

Pos SDK Usage

SDK Method: pos.getCustomers()

Example:

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

if (error) {
  console.error("Failed to list customers:", error.message);
} else {
  console.log("Customers found:", data.content?.customers?.length || 0);
  console.log("Pagination:", data.content?.pagination);
  data.content?.customers?.forEach(customer => {
    console.log(`Customer: ${customer.full_name} - Email: ${customer.email}`);
  });
}

// With search and pagination
const { data: searchData, error: searchError } = await pos.getCustomers({
  page: 1,
  limit: 20,
  search: "john@example.com",
  sort_by: JSON.stringify({ "created_at": "desc" })
});

TypeScript Definition

typescript
"pos-list-customers": {
        parameters: {
            query?: {
                /** @description page number of pagination list */
                page?: components["parameters"]["pageNumber"];
                /** @description no of rows per page */
                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"];
            };
            header?: never;
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message?: string;
                        success?: boolean;
                        content?: {
                            customers?: components["schemas"]["Customer"][];
                            pagination?: components["schemas"]["Pagination"];
                        };
                    };
                };
            };
        };
    };

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"]["Customer"]Customer
components["schemas"]["Pagination"]Pagination

Parameters

  • search (query): search keyword

Responses

200

OK

OpenAPI Definition

json
{
  "operationId": "pos-list-customers",
  "summary": "List all customers",
  "description": "List all customers",
  "parameters": [
    {
      "$ref": "#/components/parameters/pageNumber"
    },
    {
      "$ref": "#/components/parameters/pageLimit"
    },
    {
      "$ref": "#/components/parameters/columnBasedFilters"
    },
    {
      "$ref": "#/components/parameters/sortByOptions"
    },
    {
      "$ref": "#/components/parameters/searchKeyword"
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "customers": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  },
                  "pagination": {
                    "$ref": "#/components/schemas/Pagination"
                  }
                },
                "type": "object"
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    "POSAdmin"
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-ignore": true
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: