Skip to content

pos-get-user-cart

Method: GET
Path: /pos/carts/users/{user_id}

Tags: POS

Summary

Retrieve cart using user id

Description

Retrieve cart detail using user id

Pos SDK Usage

SDK Method: pos.getUserCart()

Example:

typescript
const { data, error } = await pos.getUserCart({
  user_id: "01H9CART12345ABCDE"
});

if (error) {
  console.error("Failed to get user cart:", error.message);
} else {
  console.log("User cart ID:", data.cart.id);
  console.log("Cart value:", data.cart.subtotal_amount);
}

TypeScript Definition

typescript
"pos-get-user-cart": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description User ID */
                user_id: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        /** @example cart details */
                        readonly message: string;
                        readonly success: boolean;
                        content: {
                            cart: components["schemas"]["Cart"];
                        };
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

ReferenceResolves To
components["schemas"]["Cart"]Cart
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Parameters

  • user_id (path): User ID

Responses

200

OK

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "POS"
  ],
  "operationId": "pos-get-user-cart",
  "summary": "Retrieve cart using user id",
  "description": "Retrieve cart detail using user id",
  "parameters": [
    {
      "name": "user_id",
      "in": "path",
      "description": "User ID",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "type": "string",
                "examples": [
                  "cart details"
                ],
                "readOnly": true
              },
              "success": {
                "type": "boolean",
                "readOnly": true
              },
              "content": {
                "properties": {
                  "cart": {
                    "$ref": "#/components/schemas/Cart"
                  }
                },
                "required": [
                  "cart"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "getUserCart"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: