# Types: BundleMode to CartLineState (/themes/sdk/reference/cart/types-1)

```ts
import { … } from '@poltura/theme-sdk/cart';
```

## `BundleMode` [#bundlemode]

How a bundle in the cart was put together.

```ts
type BundleMode = 'addOn' | 'fixed' | 'fbt' | 'bxgy'
```

## `BundlePriceReview` [#bundlepricereview]

A bundle price the shop changed since the shopper added the bundle, which they must accept before paying.

<TypeTable type={{"needsReview":{"description":"Whether a changed bundle price waits for the shopper's approval.","type":"boolean","required":true},"proposedTotal":{"description":"The new total of the changed bundles, or null while it is not known.","type":"Money | null","required":true},"loading":{"description":"Whether the new price is loading.","type":"boolean","required":true},"accepting":{"description":"Whether the approval is being sent.","type":"boolean","required":true},"failed":{"description":"Whether the last approval failed.","type":"boolean","required":true},"accept":{"description":"Accepts the new price; the cart reloads with it.","type":"() => Promise<void>","required":true}}} />

## `Cart` [#cart]

The shopper's cart.

<TypeTable type={{"id":{"description":"The cart's id.","type":"string","required":true},"currencyCode":{"description":"The cart's currency.","type":"CurrencyCode","required":true},"lines":{"description":"The lines, with bundle components folded under their bundle.","type":"readonly CartLine[]","required":true},"itemCount":{"description":"How many units the cart holds.","type":"number","required":true},"totals":{"description":"What the cart adds up to.","type":"CartTotals","required":true},"codes":{"description":"The discount codes the shopper entered.","type":"readonly CartCode[]","required":true},"giftCards":{"description":"The gift cards applied.","type":"readonly CartGiftCard[]","required":true},"minimumOrder":{"description":"The minimum order value not reached yet, or null.","type":"MinimumOrder | null","required":true},"checkoutBlocked":{"description":"Whether checkout is blocked until the shopper fixes the cart.","type":"boolean","required":true}}} />

## `CartAddInput` [#cartaddinput]

What to add to the cart.

<TypeTable type={{"variantId":{"description":"The variant to add.","type":"string","required":true},"quantity":{"description":"How many units; 1 when omitted.","type":"number","required":false},"personalization":{"description":"The shopper's personalisation texts by field key.","type":"Readonly<Record<string, string>>","required":false}}} />

## `CartCode` [#cartcode]

A discount code the shopper entered.

<TypeTable type={{"code":{"description":"The code as entered.","type":"string","required":true},"status":{"description":"Whether it takes effect.","type":"CartCodeStatus","required":true},"message":{"description":"What a pending code waits for or why it does not apply, in the page language; null when applied.","type":"string | null","required":true},"tone":{"description":"The tone to show `message` in.","type":"'success' | 'info' | 'warning'","required":true}}} />

## `CartCodeStatus` [#cartcodestatus]

Whether an entered code takes effect: now, once a checkout fact is known, or not at all.

```ts
type CartCodeStatus = 'applied' | 'pending' | 'notApplicable'
```

## `CartError` [#carterror]

A failed cart action, with a message ready to show.

<TypeTable type={{"code":{"description":"Why it failed.","type":"CartErrorCode","required":true},"message":{"description":"The reason in the page language.","type":"string","required":true}}} />

## `CartErrorCode` [#carterrorcode]

Why a cart action failed.

```ts
type CartErrorCode = 'outOfStock' | 'limitReached' | 'codeExpired' | 'codeUsedUp' | 'codeInvalid' | 'codeRejected' | 'notInCart' | 'unknown'
```

## `CartGiftCard` [#cartgiftcard]

A gift card applied to the cart.

<TypeTable type={{"id":{"description":"The applied card's id; pass it to `removeGiftCard`.","type":"string","required":true},"kind":{"description":"Whether the card carries an amount or redeems for a product.","type":"'amount' | 'product'","required":true},"last4":{"description":"The card code's last four characters.","type":"string","required":true},"applied":{"description":"The credit this order uses.","type":"Money","required":true},"balanceAfter":{"description":"What stays on the card after this order; zero for a product card.","type":"Money","required":true},"productTitle":{"description":"The product a product card redeems for, or null.","type":"string | null","required":true}}} />

## `CartLine` [#cartline]

One line of the cart, with the bundle components folded under it.

<TypeTable type={{"id":{"description":"The line's id; pass it to the cart actions.","type":"string","required":true},"productId":{"description":"The product's id.","type":"string","required":true},"variantId":{"description":"The variant's id.","type":"string","required":true},"title":{"description":"The product's title.","type":"string","required":true},"variantTitle":{"description":"The variant's title, or null for a single-variant product.","type":"string | null","required":true},"href":{"description":"The product page's path, or null when the product has no page.","type":"string | null","required":true},"image":{"description":"The line's image, or null.","type":"MediaImageRef | null","required":true},"quantity":{"description":"How many units are in the cart.","type":"number","required":true},"unitPrice":{"description":"The price of one unit as charged.","type":"Money","required":true},"total":{"description":"The line total as charged.","type":"Money","required":true},"compareAtTotal":{"description":"The line total before discounts, or null when nothing was discounted.","type":"Money | null","required":true},"netUnitPrice":{"description":"The price of one unit without tax, or null when the market has no tax split.","type":"Money | null","required":true},"netTotal":{"description":"The line total without tax, or null when the market has no tax split.","type":"Money | null","required":true},"availability":{"description":"Whether the quantity can still be bought.","type":"Availability","required":true},"preorder":{"description":"The delivery promise of a pre-order line, otherwise null.","type":"CartLinePreorder | null","required":true},"isDigital":{"description":"Whether the item is delivered digitally.","type":"boolean","required":true},"personalization":{"description":"What the shopper entered to personalise the item.","type":"readonly CartLinePersonalization[]","required":true},"giftCardDelivery":{"description":"Who a gift card line goes to and when, or null for any other line.","type":"CartLineGiftCardDelivery | null","required":true},"bundle":{"description":"The bundle the line belongs to, or null.","type":"CartLineBundle | null","required":true},"components":{"description":"The bundle components folded under this line.","type":"readonly CartLine[]","required":true},"state":{"description":"Whether the line is being changed.","type":"CartLineState","required":true}}} />

## `CartLineBundle` [#cartlinebundle]

The bundle a cart line belongs to.

<TypeTable type={{"groupId":{"description":"The id shared by every line of this bundle in the cart.","type":"string","required":true},"bundleId":{"description":"The bundle's id.","type":"string","required":true},"title":{"description":"The bundle's title.","type":"string","required":true},"mode":{"description":"How the bundle was put together: add-on, fixed kit, bought together, or buy X get Y.","type":"BundleMode","required":true},"itemCount":{"description":"How many items the bundle holds.","type":"number","required":true},"compareAt":{"description":"The bundle's price before its discount, or null.","type":"Money | null","required":true}}} />

## `CartLineGiftCardDelivery` [#cartlinegiftcarddelivery]

Who a gift card in the cart goes to and when it is sent.

<TypeTable type={{"forSelf":{"description":"Whether the shopper buys the card for themselves.","type":"boolean","required":true},"recipientName":{"description":"The recipient's name, or null.","type":"string | null","required":true},"recipientEmail":{"description":"The recipient's email address, or null when the card is for the shopper.","type":"string | null","required":true},"sendAt":{"description":"The day the card is sent as `YYYY-MM-DD`, or null when it is sent with the order.","type":"string | null","required":true}}} />

## `CartLinePersonalization` [#cartlinepersonalization]

A text the shopper entered to personalise a cart line, with the field's label.

<TypeTable type={{"label":{"description":"The field's label in the page language.","type":"string","required":true},"value":{"description":"What the shopper entered.","type":"string","required":true}}} />

## `CartLinePreorder` [#cartlinepreorder]

The delivery date a shopper agrees to by ordering a pre-order line.

<TypeTable type={{"expected":{"description":"When the item is expected to ship.","type":"ExpectedDate","required":true},"message":{"description":"The merchant's note to pre-order buyers in the page language, or null.","type":"string | null","required":true}}} />

## `CartLineState` [#cartlinestate]

Whether a cart line is being changed and what went wrong with the last change.

<TypeTable type={{"updating":{"description":"A quantity change is in flight.","type":"boolean","required":true},"removing":{"description":"A removal is in flight.","type":"boolean","required":true},"error":{"description":"Why the last change failed, in the page language, or null.","type":"string | null","required":true}}} />
