pos-search-customers
Method: POST
Path: /pos/search-customers
Tags: Customers
Summary
Search customers
Description
Searches customers for selection at the till, with facets and pagination.
Pos SDK Usage
SDK Method: pos.searchCustomers()
Example:
typescript
const { data, error } = await pos.searchCustomers({ query: "Jane" });TypeScript Definition
typescript
"pos-search-customers": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
query: string;
/** @default 1 */
page?: number;
/** @default 25 */
limit?: number;
/** @description Values are trimmed and must not be blank. */
facets?: string[];
/** @description Filter expression or conditions to narrow the customer results. Omit or send null for no filtering. Conditions in the outer array are combined with AND; conditions in a nested array are combined with OR. */
filter?: string | (string | string[])[] | null;
/** @description Values are trimmed and must not be blank. */
sort?: string[] | null;
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
customers: components["schemas"]["PosCustomerSearchHit"][];
facet_stats?: {
[key: string]: unknown;
};
facet_distribution?: {
[key: string]: unknown;
};
pagination: components["schemas"]["Pagination"];
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
500: components["responses"]["InternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["PosCustomerSearchHit"] | PosCustomerSearchHit |
components["schemas"]["Pagination"] | Pagination |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
401
Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.
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.
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
json
{
"operationId": "pos-search-customers",
"summary": "Search customers",
"description": "Searches customers for selection at the till, with facets and pagination.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"query": {
"type": "string"
},
"page": {
"type": "integer",
"default": 1,
"minimum": 1
},
"limit": {
"type": "integer",
"default": 25,
"minimum": 1
},
"facets": {
"description": "Values are trimmed and must not be blank.",
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"filter": {
"description": "Filter expression or conditions to narrow the customer results. Omit or send null for no filtering. Conditions in the outer array are combined with AND; conditions in a nested array are combined with OR.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
{
"type": "null"
}
]
},
"sort": {
"description": "Values are trimmed and must not be blank.",
"type": [
"array",
"null"
],
"items": {
"type": "string",
"minLength": 1
}
}
},
"required": [
"query"
]
}
}
}
},
"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/PosCustomerSearchHit"
}
},
"facet_stats": {
"type": "object",
"additionalProperties": true
},
"facet_distribution": {
"type": "object",
"additionalProperties": true
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"required": [
"customers",
"pagination"
],
"type": "object"
}
},
"required": [
"message",
"success",
"content"
]
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"externalDocs": {
"url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-search-customers"
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Customers"
],
"x-speakeasy-group": "pos",
"x-speakeasy-name-override": "posSearchCustomers"
}Auto-generated from OpenAPI spec and TypeScript definitions