pos-get-cart
Method: GET
Path: /pos/carts/{id}
Tags: POS
Summary
Retrieve cart detail
Description
Retrieve cart detail
Pos SDK Usage
SDK Method: pos.getCart()
Example:
typescript
const { data, error } = await pos.getCart({
id: "01H9CART12345ABCDE"
});
if (error) {
console.error("Failed to get cart:", error.message);
} else {
const cart = data.cart;
console.log("Cart total:", cart.grand_total);
console.log("Items count:", cart.cart_items.length);
}TypeScript Definition
typescript
"pos-get-cart": {
parameters: {
query?: never;
header?: never;
path: {
/** @description Cart ID */
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
| Reference | Resolves To |
|---|---|
components["schemas"]["Cart"] | Cart |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["NotFound"] | NotFound |
Parameters
- id (path): Cart 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-cart",
"summary": "Retrieve cart detail",
"description": "Retrieve cart detail",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Cart 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": "getCart"
}Auto-generated from OpenAPI spec and TypeScript definitions