Cart
Type: schema
Description
This cart model is structured to capture a wide range of details, facilitating accurate representation and management of user shopping carts in an e-commerce platform.
TypeScript Definition
typescript
Cart: {{
/** @description Unique identifier for the cart. */
id: string;
/** @description The user who owns the cart. Can differ from `customer_id`, for example when several users belong to one business customer. For a POS cart, identifies the operator recorded as `pos_user_id` in `metadata`. */
user_id: string;
/** @description The unique ID of the customer the cart is for. `null` until a customer is linked. The cart never embeds customer details — fetch them from the customer endpoints so they are always current. */
customer_id: string | null;
/** @description Indicates whether the cart is currently active or inactive. */
active: boolean;
/** @description customer note for shipping or product customization. */
customer_note: string | null;
/** @description Indicates if a promotion is applied or not. */
is_promotion_applied: boolean;
/** @description Indicates if a coupon is applied or not. */
is_coupon_applied: boolean;
/** @description Code of the applied coupon. */
coupon_code: string | null;
/**
* Format: double
* @description Discount amount due to the coupon.
*/
coupon_discount_amount: number;
/**
* Format: double
* @description Discount percentage of the applied coupon. `null` if no coupon has been applied to the cart yet.
*/
coupon_discount_percent: number | null;
/**
* Format: double
* @description Discount amount due to promotions(If Applied).
*/
promotion_discount_amount: number;
/**
* Format: double
* @description Discount amount due to promotions(If Applied).
*/
promotion_discount_percent: number;
/**
* Format: double
* @description Subtotal amount for items in the cart.
*/
subtotal: number;
/**
* Format: double
* @description Total tax amount for items.
*/
items_tax_amount: number;
/**
* Format: double
* @description Subtotal including tax.
*/
subtotal_including_tax: number;
/** @description Estimated cost of shipping. */
shipping_estimated_cost: number | null;
/** @description Discount applied on estimated shipping cost. */
shipping_discount_amount: number | null;
/** @description Shipping amount chargable to customer. */
shipping_amount: number | null;
/** @description For a single rate, the shipping GST percentage. For mixed-rate GST charges, the highest component rate; use charge_tax_lines for the taxable value and tax at each rate. Earlier sales retain their original shipping rate. */
shipping_tax_rate: number | null;
/** @description Tax applied on shipping_amount. */
shipping_tax_amount: number | null;
/** @description Shipping amount including shipping tax. */
shipping_amount_including_tax: number | null;
fulfillment_preference: components["schemas"]["FulfillmentPreference"];
/** @description Estimated delivery time across the cart's shipments, as a range of days `"<min>-<max>"` (e.g. `"2-5"`). `null` until the shipments have a delivery estimate. */
estimated_delivery_days: string | null;
/**
* Format: double
* @description The additional charge applied to cover the costs associated with processing, packaging, and handling an order. This fee is separate from shipping charges and may include materials, or special handling requirements.
*/
handling_charge_excluding_tax: number;
/** Format: double */
handling_charge_tax_amount: number;
/** Format: double */
handling_charge_including_tax: number;
/**
* Format: double
* @description Total tax amount for the entire cart.
*/
total_tax: number;
/**
* Format: double
* @description Goods including tax, shipping and handling, less coupons, promotions and redeemed loyalty points, rounded down to a whole currency unit. Store credit is deducted from to_be_paid.
*/
grand_total: number;
/**
* Format: double
* @description Amount of credit balance used.
*/
credit_balance_used: number;
/**
* Format: double
* @description Grand total less applied store credit, rounded down to a whole currency unit. May be negative when applied credit exceeds the total; reduce the credit before checkout.
*/
to_be_paid: number;
/** @description Number of loyalty points redeemed. */
loyalty_points_redeemed: number;
/** @description Number of loyalty points earned. */
loyalty_points_earned: number;
/** @description Number of items in the cart. */
cart_items_count: number;
/** @description List containing detailed information about each item in the cart. */
cart_items: components["schemas"]["CartItem"][];
/** @description Details of the billing address. */
billing_address: components["schemas"]["CartAddress"];
/** @description Details of the shipping address. */
shipping_address: components["schemas"]["CartAddress"];
/** @description Details about the currency being used, including `name`, `code`, and `symbol`. */
currency: components["schemas"]["Currency"];
/** @description Session-derived POS attribution plus custom scalar text/null values. Numbers are returned as strings; reserved keys and unsafe stored nested values are excluded. */
metadata: ({
/** @description POS operator who created the cart. `null` for a cart not created at a POS. */
pos_user_id?: string | null;
/** @description POS device the cart was created on. `null` for a cart not created at a POS. */
pos_device_id?: string | null;
/** @description Store location the cart was created at, when given. */
origin_location_id?: string | null;
} & {
[key: string]: string | null;
}) | null;
/**
* Format: date-time
* @description ISO 8601 expiry time. Active carts can be refreshed and renewed by cart updates, including loyalty-point and credit-balance redemption. Checkout rejects an expired cart.
*/
expires_at: string | null;
/** @description Information about the promotional offers that have been applied to the cart. */
applied_promotions: components["schemas"]["AppliedPromotion"][];
/** @description This key provides details about the savings in cart after coupon have been applied to the cart. */
applied_coupons: components["schemas"]["AppliedCoupon"][];
/** @description List containing detailed information about each shipment in the cart. */
shipments: components["schemas"]["CartShipment"][];
/** @description Monetary promotion savings; bonus loyalty points are excluded. */
promotion_savings: number;
/** @description Monetary coupon savings; bonus loyalty points are excluded. */
coupon_savings: number;
/** @description Nonnegative markdown savings between listing price and original selling price, across positive-quantity items. */
other_savings: number;
/** @description Combined savings across promotions, coupons, and other discounts (`promotion_savings` + `coupon_savings` + `other_savings`). */
total_savings: number;
/** @description Free shipping threshold of the cart */
free_shipping_threshold: number | null;
/**
* @description Checkout readiness of the cart. Collection carts are ready when they have items. Other carts also need a shipping address, and delivery carts need shipments. This status does not confirm that a pickup preference has been selected. Use `status_error_message` for the reason when `not-ready-for-payment`.
* @default not-ready-for-payment
* @enum {string}
*/
status: "not-ready-for-payment" | "ready-for-payment";
/** @description Human-readable reason why the cart is not ready for payment. `null` when `status` is `ready-for-payment`. */
status_error_message: string | null;
/** @description ID of the applied coupon. `null` when no coupon is applied. */
coupon_id: $Read<string | null>;
/** @description Whether the cart is a subscription cart. */
on_subscription: boolean;
/** @description The sales channel the cart belongs to. */
sales_channel: {
id: string | null;
name: string | null;
type: string | null;
};
/** @description Order amount eligible for loyalty-point earning. */
loyalty_point_eligible_amount: number;
/** @description Calculated cart value used for coupon/promotion order-value checks. */
cart_value: number;
/** @description Cart-level shipping provider name. Currently always `null` (resolved per shipment under `shipments[]`). */
shipping_provider_name: string | null;
/** @description Cart-level courier company name. Currently always `null` (resolved per shipment under `shipments[]`). */
courier_company_name: string | null;
/**
* Format: date-time
* @description Creation timestamp (ISO-8601).
*/
created_at: $Read<string>;
/**
* Format: date-time
* @description Last-modification timestamp (ISO-8601).
*/
modified_at: $Read<string>;
/** @description Shipping and handling taxable value and tax per rate, summed from each planned shipment’s own quote and goods. Later shipment splits, merges and warehouse changes conserve the originating quote’s charge parts. GST component heads are split on the invoice at issue time. */
charge_tax_lines?: components["schemas"]["ChargeTaxLine"][] | null;
/**
* @description Signed adjustment from rounding the total after discounts and redeemed loyalty points down to a whole currency unit; included in grand_total. Does not include the separate rounding of to_be_paid after store credit.
* @example -0.04
*/
round_off?: number | null;
};
/**
* CartAddress
* @description A billing or shipping address set on a cart. `null` until an address is set.
*/
}Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["FulfillmentPreference"] | FulfillmentPreference |
components["schemas"]["CartItem"] | CartItem |
components["schemas"]["CartAddress"] | CartAddress |
components["schemas"]["Currency"] | Currency |
components["schemas"]["AppliedPromotion"] | AppliedPromotion |
components["schemas"]["AppliedCoupon"] | AppliedCoupon |
components["schemas"]["CartShipment"] | CartShipment |
components["schemas"]["ChargeTaxLine"] | ChargeTaxLine |
OpenAPI Schema
json
{
"description": "This cart model is structured to capture a wide range of details, facilitating accurate representation and management of user shopping carts in an e-commerce platform.",
"type": "object",
"properties": {
"id": {
"description": "Unique identifier for the cart.",
"type": "string",
"pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$"
},
"user_id": {
"description": "The user who owns the cart. Can differ from `customer_id`, for example when several users belong to one business customer. For a POS cart, identifies the operator recorded as `pos_user_id` in `metadata`.",
"type": "string"
},
"customer_id": {
"description": "The unique ID of the customer the cart is for. `null` until a customer is linked. The cart never embeds customer details — fetch them from the customer endpoints so they are always current.",
"type": [
"string",
"null"
]
},
"active": {
"description": "Indicates whether the cart is currently active or inactive.",
"type": "boolean"
},
"customer_note": {
"description": "customer note for shipping or product customization.",
"type": [
"string",
"null"
]
},
"is_promotion_applied": {
"description": "Indicates if a promotion is applied or not.",
"type": "boolean"
},
"is_coupon_applied": {
"description": "Indicates if a coupon is applied or not.",
"type": "boolean"
},
"coupon_code": {
"description": "Code of the applied coupon.",
"type": [
"string",
"null"
]
},
"coupon_discount_amount": {
"description": "Discount amount due to the coupon.",
"type": "number",
"format": "double",
"minimum": 0
},
"coupon_discount_percent": {
"description": "Discount percentage of the applied coupon. `null` if no coupon has been applied to the cart yet.",
"type": [
"number",
"null"
],
"format": "double",
"minimum": 0
},
"promotion_discount_amount": {
"description": "Discount amount due to promotions(If Applied).",
"type": "number",
"format": "double",
"minimum": 0
},
"promotion_discount_percent": {
"description": "Discount amount due to promotions(If Applied).",
"type": "number",
"format": "double",
"minimum": 0
},
"subtotal": {
"description": "Subtotal amount for items in the cart.",
"type": "number",
"format": "double",
"minimum": 0
},
"items_tax_amount": {
"description": "Total tax amount for items.",
"type": "number",
"format": "double",
"minimum": 0
},
"subtotal_including_tax": {
"description": "Subtotal including tax.",
"type": "number",
"format": "double",
"minimum": 0
},
"shipping_estimated_cost": {
"description": "Estimated cost of shipping.",
"type": [
"number",
"null"
]
},
"shipping_discount_amount": {
"description": "Discount applied on estimated shipping cost.",
"type": [
"number",
"null"
]
},
"shipping_amount": {
"description": "Shipping amount chargable to customer.",
"type": [
"number",
"null"
]
},
"shipping_tax_rate": {
"description": "For a single rate, the shipping GST percentage. For mixed-rate GST charges, the highest component rate; use charge_tax_lines for the taxable value and tax at each rate. Earlier sales retain their original shipping rate.",
"type": [
"number",
"null"
]
},
"shipping_tax_amount": {
"description": "Tax applied on shipping_amount.",
"type": [
"number",
"null"
]
},
"shipping_amount_including_tax": {
"description": "Shipping amount including shipping tax.",
"type": [
"number",
"null"
]
},
"fulfillment_preference": {
"$ref": "#/components/schemas/FulfillmentPreference"
},
"estimated_delivery_days": {
"description": "Estimated delivery time across the cart's shipments, as a range of days `\"<min>-<max>\"` (e.g. `\"2-5\"`). `null` until the shipments have a delivery estimate.",
"type": [
"string",
"null"
]
},
"handling_charge_excluding_tax": {
"description": "The additional charge applied to cover the costs associated with processing, packaging, and handling an order. This fee is separate from shipping charges and may include materials, or special handling requirements.",
"type": "number",
"format": "double",
"minimum": 0
},
"handling_charge_tax_amount": {
"type": "number",
"format": "double",
"minimum": 0
},
"handling_charge_including_tax": {
"type": "number",
"format": "double",
"minimum": 0
},
"total_tax": {
"description": "Total tax amount for the entire cart.",
"type": "number",
"format": "double",
"minimum": 0
},
"grand_total": {
"description": "Goods including tax, shipping and handling, less coupons, promotions and redeemed loyalty points, rounded down to a whole currency unit. Store credit is deducted from to_be_paid.",
"type": "number",
"format": "double"
},
"credit_balance_used": {
"description": "Amount of credit balance used.",
"type": "number",
"format": "double",
"minimum": 0
},
"to_be_paid": {
"description": "Grand total less applied store credit, rounded down to a whole currency unit. May be negative when applied credit exceeds the total; reduce the credit before checkout.",
"type": "number",
"format": "double"
},
"loyalty_points_redeemed": {
"description": "Number of loyalty points redeemed.",
"type": "number",
"minimum": 0
},
"loyalty_points_earned": {
"description": "Number of loyalty points earned.",
"type": "number",
"minimum": 0
},
"cart_items_count": {
"description": "Number of items in the cart.",
"type": "integer",
"minimum": 0
},
"cart_items": {
"description": "List containing detailed information about each item in the cart. ",
"type": "array",
"items": {
"$ref": "#/components/schemas/CartItem"
}
},
"billing_address": {
"description": "Details of the billing address.",
"$ref": "#/components/schemas/CartAddress"
},
"shipping_address": {
"description": "Details of the shipping address.",
"$ref": "#/components/schemas/CartAddress"
},
"currency": {
"description": "Details about the currency being used, including `name`, `code`, and `symbol`.",
"$ref": "#/components/schemas/Currency"
},
"metadata": {
"description": "Session-derived POS attribution plus custom scalar text/null values. Numbers are returned as strings; reserved keys and unsafe stored nested values are excluded.",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": [
"string",
"null"
]
},
"properties": {
"pos_user_id": {
"description": "POS operator who created the cart. `null` for a cart not created at a POS.",
"type": [
"string",
"null"
]
},
"pos_device_id": {
"description": "POS device the cart was created on. `null` for a cart not created at a POS.",
"type": [
"string",
"null"
]
},
"origin_location_id": {
"description": "Store location the cart was created at, when given.",
"type": [
"string",
"null"
]
}
}
},
"expires_at": {
"description": "ISO 8601 expiry time. Active carts can be refreshed and renewed by cart updates, including loyalty-point and credit-balance redemption. Checkout rejects an expired cart.",
"type": [
"string",
"null"
],
"format": "date-time"
},
"applied_promotions": {
"description": "Information about the promotional offers that have been applied to the cart.",
"type": "array",
"items": {
"$ref": "#/components/schemas/AppliedPromotion"
}
},
"applied_coupons": {
"description": "This key provides details about the savings in cart after coupon have been applied to the cart.",
"type": "array",
"items": {
"$ref": "#/components/schemas/AppliedCoupon"
}
},
"shipments": {
"description": "List containing detailed information about each shipment in the cart.",
"type": "array",
"items": {
"$ref": "#/components/schemas/CartShipment"
}
},
"promotion_savings": {
"description": "Monetary promotion savings; bonus loyalty points are excluded.",
"type": "number",
"minimum": 0
},
"coupon_savings": {
"description": "Monetary coupon savings; bonus loyalty points are excluded.",
"type": "number",
"minimum": 0
},
"other_savings": {
"description": "Nonnegative markdown savings between listing price and original selling price, across positive-quantity items.",
"type": "number",
"minimum": 0
},
"total_savings": {
"description": "Combined savings across promotions, coupons, and other discounts (`promotion_savings` + `coupon_savings` + `other_savings`).",
"type": "number",
"minimum": 0
},
"free_shipping_threshold": {
"description": "Free shipping threshold of the cart",
"type": [
"number",
"null"
]
},
"status": {
"description": "Checkout readiness of the cart. Collection carts are ready when they have items. Other carts also need a shipping address, and delivery carts need shipments. This status does not confirm that a pickup preference has been selected. Use `status_error_message` for the reason when `not-ready-for-payment`.",
"type": "string",
"default": "not-ready-for-payment",
"enum": [
"not-ready-for-payment",
"ready-for-payment"
]
},
"status_error_message": {
"description": "Human-readable reason why the cart is not ready for payment. `null` when `status` is `ready-for-payment`.",
"type": [
"string",
"null"
]
},
"coupon_id": {
"description": "ID of the applied coupon. `null` when no coupon is applied.",
"type": [
"string",
"null"
],
"readOnly": true
},
"on_subscription": {
"description": "Whether the cart is a subscription cart.",
"type": "boolean"
},
"sales_channel": {
"description": "The sales channel the cart belongs to.",
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"type": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"name",
"type"
]
},
"loyalty_point_eligible_amount": {
"description": "Order amount eligible for loyalty-point earning.",
"type": "number"
},
"cart_value": {
"description": "Calculated cart value used for coupon/promotion order-value checks.",
"type": "number"
},
"shipping_provider_name": {
"description": "Cart-level shipping provider name. Currently always `null` (resolved per shipment under `shipments[]`).",
"type": [
"string",
"null"
]
},
"courier_company_name": {
"description": "Cart-level courier company name. Currently always `null` (resolved per shipment under `shipments[]`).",
"type": [
"string",
"null"
]
},
"created_at": {
"description": "Creation timestamp (ISO-8601).",
"type": "string",
"format": "date-time",
"readOnly": true
},
"modified_at": {
"description": "Last-modification timestamp (ISO-8601).",
"type": "string",
"format": "date-time",
"readOnly": true
},
"charge_tax_lines": {
"description": "Shipping and handling taxable value and tax per rate, summed from each planned shipment’s own quote and goods. Later shipment splits, merges and warehouse changes conserve the originating quote’s charge parts. GST component heads are split on the invoice at issue time.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/components/schemas/ChargeTaxLine"
}
},
"round_off": {
"description": "Signed adjustment from rounding the total after discounts and redeemed loyalty points down to a whole currency unit; included in grand_total. Does not include the separate rounding of to_be_paid after store credit.",
"type": [
"number",
"null"
],
"example": -0.04
}
},
"examples": [],
"externalDocs": {
"url": "https://llm-docs.commercengine.io/admin-pos/schemas/Cart"
},
"required": [
"id",
"user_id",
"customer_id",
"active",
"customer_note",
"is_promotion_applied",
"is_coupon_applied",
"coupon_code",
"coupon_discount_amount",
"coupon_discount_percent",
"promotion_discount_amount",
"subtotal",
"items_tax_amount",
"subtotal_including_tax",
"shipping_estimated_cost",
"shipping_discount_amount",
"shipping_amount",
"shipping_tax_rate",
"shipping_tax_amount",
"shipping_amount_including_tax",
"estimated_delivery_days",
"handling_charge_excluding_tax",
"handling_charge_tax_amount",
"handling_charge_including_tax",
"total_tax",
"grand_total",
"credit_balance_used",
"to_be_paid",
"loyalty_points_redeemed",
"loyalty_points_earned",
"cart_items_count",
"cart_items",
"billing_address",
"shipping_address",
"currency",
"metadata",
"expires_at",
"applied_promotions",
"applied_coupons",
"shipments",
"promotion_savings",
"coupon_savings",
"other_savings",
"total_savings",
"free_shipping_threshold",
"status",
"status_error_message",
"on_subscription",
"sales_channel",
"created_at",
"modified_at",
"cart_value",
"loyalty_point_eligible_amount",
"promotion_discount_percent",
"fulfillment_preference",
"coupon_id",
"shipping_provider_name",
"courier_company_name"
],
"title": "Cart"
}Auto-generated from OpenAPI spec and TypeScript definitions