Skip to main content

Cart

cart: Cart

The current cart state, containing products, pricing, and validation status.

PropertyTypeAlways presentDescription
idstringYesUnique identifier for the cart session.
validationCartValidationYesValidation status of the cart.
itemsCartItem[]YesList of items currently in the cart.
pricesPricesYesBreakdown of the cart's pricing details.
couponDeepPartial<Coupon>NoOptional coupon applied to the cart.
is_subscriptionbooleanYesIndicates if the cart is a subscription. Only available on checkout.

CartItem (each element of cart.items):

PropertyTypeAlways presentDescription
idnumberYesUnique identifier for the product instance in the cart.
namestringYesName of the product.
pricestringYesPrice in string format (to match API response).
quantitynumberYesQuantity of this product in the cart.
free_shippingbooleanYesWhether the product qualifies for free shipping.
product_idnumberYesUnique identifier for the product (not cart-specific).
variant_idnumberYesUnique identifier for the selected product variant.
thumbnailstringYesURL of the product's thumbnail image.
variant_valuesstringYesVariant details (e.g. selected attributes).
skustring or nullNoSKU (Stock Keeping Unit) for the product variant.
propertiesArray<unknown> or Record<string, unknown>NoAdditional product properties.
urlstringYesURL of the product's page.
is_ahora_12_eligiblebooleanYesWhether the product is eligible for Ahora 12 financing.

Prices (cart.prices):

PropertyTypeAlways presentDescription
discount_couponnumberYesDiscount applied through a coupon.
discount_gatewaynumberYesDiscount applied through a payment gateway.
discount_promotionnumberYesDiscount applied through a store promotion.
shippingnumberYesCost of shipping.
subtotalnumberYesSubtotal before discounts and shipping.
totalnumberYesFinal total after all discounts and shipping.

Coupon (cart.coupon):

PropertyTypeAlways presentDescription
codestringYesThe coupon code used.
typestringYesThe type of discount (percentage, fixed, etc.).
valuestringYesThe discount value (format depends on type).

CartValidation (cart.validation): One of { status: "success" }, { status: "pending" }, or { status: "fail"; reason: string }.

For the exact TypeScript definitions, use the types from @tiendanube/nube-sdk-types (e.g. Cart, CartItem, Prices, Coupon, CartValidation).