Skip to content

pos-get-customer-detail

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

Tags: POSAdmin

Summary

Retrieve customer detail

Description

Retrieve customer detail

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.content?.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"];
                        };
                    };
                };
            };
        };
    };

Component References

ReferenceResolves To
components["schemas"]["CustomerDetail"]CustomerDetail

Parameters

  • id (path): Customer Id

Responses

200

OK

OpenAPI Definition

json
{
  "operationId": "pos-get-customer-detail",
  "summary": "Retrieve customer detail",
  "description": "Retrieve customer detail",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "description": "Customer Id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "customer": {
                    "$ref": "#/components/schemas/CustomerDetail"
                  }
                },
                "type": "object"
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    "POSAdmin"
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-ignore": true
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: