Skip to content

pos-get-customer-detail ​

Method: GET
Path: /pos/customers/{id}

Tags: Customers

Summary ​

Retrieve customer detail

Description ​

Retrieves the full CustomerDetail object, including business, segments, addresses, banking, loyalty, notification_preferences, and the assigned customer_group_id.

Pos SDK Usage ​

SDK Method: pos.getCustomer()

Example:

typescript
const { data, error } = await pos.getCustomer({
  id: "01H9CUST12345ABCDE"
});

if (error) {
  console.error("Failed to get customer:", error.message);
} else {
  const customer = data.customer;
  console.log(`Customer: ${customer?.full_name}`);
  console.log(`Email: ${customer?.email}`);
  console.log(`Phone: ${customer?.phone}`);
  console.log(`Loyalty points: ${customer?.loyalty?.points_balance}`);
  console.log(`Total spent: ${customer?.loyalty?.lifetime_spent}`);
}

TypeScript Definition ​

typescript
"pos-get-customer-detail": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description Customer Id */
                id: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            customer: components["schemas"]["CustomerDetail"];
                        };
                    };
                };
            };
            400: components["responses"]["BadRequest"];
            401: components["responses"]["AdminUnauthorized"];
            403: components["responses"]["Forbidden"];
            404: components["responses"]["AdminNotFound"];
            500: components["responses"]["AdminInternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["schemas"]["CustomerDetail"]CustomerDetail
components["responses"]["BadRequest"]BadRequest
components["responses"]["AdminUnauthorized"]AdminUnauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["AdminNotFound"]AdminNotFound
components["responses"]["AdminInternalServerError"]AdminInternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • id (path): Customer Id

Responses ​

200 ​

OK

400 ​

Bad request

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 ​

500 ​

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "operationId": "pos-get-customer-detail",
  "summary": "Retrieve customer detail",
  "description": "Retrieves the full `CustomerDetail` object, including `business`, `segments`, `addresses`, `banking`, `loyalty`, `notification_preferences`, and the assigned `customer_group_id`.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "description": "Customer Id",
      "required": true,
      "schema": {
        "type": "string",
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]{1,128}$"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "customer": {
                    "$ref": "#/components/schemas/CustomerDetail"
                  }
                },
                "required": [
                  "customer"
                ],
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "content"
            ]
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/AdminUnauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/AdminNotFound"
    },
    "500": {
      "$ref": "#/components/responses/AdminInternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-get-customer-detail"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Customers"
  ],
  "x-speakeasy-group": "pos"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: