> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# SDK Types: Cart

**Published**: 2026-11-30
**Category**: Types

## `Cart`

*Interface*

A buyer's cart: its lines and the totals the server computed on this call. Read the
totals as given rather than recomputing them. Count lines with `items.length` and
units with `items.reduce((n, i) => n + i.quantity, 0)`.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `currency` | `string` | No | ISO 4217 currency code the totals are expressed in (e.g. `'EUR'`), fixed per site. |
| `deliveryAddress` | `OrderAddress \| null` | No | The delivery address set with CartService.update, `countryCode` in upper case,<br>or `null`. Its country decides which market's shipping options apply. |
| `id` | `string` | No | The cart's `cart_...` id, stable across adds, updates and removals. A<br>CartService.claim that merges into the buyer's existing cart returns that cart's id. |
| `items` | `CartLineItem[]` | No | The cart lines, one per variant. Empty for a cart whose every line was removed. |
| `locale` | `string \| null` | No | The cart's language tag (e.g. `'pt-BR'`), set by the creating `addLine` or by<br>CartService.setLocale. `null` when none was set: the site's default applies. |
| `pickupPoint` | `SelectedPickupPoint \| null` | Yes | The pickup point set with CartService.update, or `null`. Checkout freezes it on<br>the order. Absent from an API that predates pickup points. |
| `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | `'inclusive'` shows prices with VAT; `'exclusive'` without (`subtotalNetCents`, each<br>line's `netCents`, `totalCents - taxTotalCents`). Display only. |
| `removedLines` | `RemovedCartLine[]` | Yes | Lines removed by this call, already gone from `items` and the totals. Absent when<br>nothing was removed: a per-call report, never a standing list. |
| `shippingOptionId` | `string \| null` | No | The chosen `shp_...` shipping option, or `null`. A choice that stops being an active<br>option of the delivery country's market is cleared on the next cart call. |
| `shippingTotalCents` | `number` | No | Shipping of the chosen option in cents, VAT included when charged. 0 with no option,<br>no line, or a free option. Provisional: checkout recomputes it. |
| `subtotalCents` | `number` | No | Sum of every line's CartLineItem.subtotalCents, in minor currency units (cents): the<br>amount charged for the goods, VAT included when VAT is charged. Computed server-side. |
| `subtotalGrossCents` | `number` | No | Cart.subtotalCents with VAT, in cents: equal to `subtotalCents`. |
| `subtotalNetCents` | `number` | No | Cart.subtotalCents without VAT, in cents: the sum of every line's `netCents`. |
| `taxTotalCents` | `number` | No | The VAT contained in Cart.totalCents, in cents (do not add it), at the delivery<br>country's rate, else the merchant country's. 0 when no VAT is charged. |
| `totalCents` | `number` | No | Amount payable in cents: Cart.subtotalCents plus Cart.shippingTotalCents.<br>Provisional: checkout recomputes it and can refuse with `TOTAL_CHANGED`. |


---

## `CartLineInput`

*Interface*

Which variant to add or update, and how many units.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `quantity` | `number` | No | Number of units, an integer from 1 to 999. CartService.addLine adds this many<br>to the line; CartService.updateLine sets the line to exactly this many. |
| `variantId` | `string` | No | The variant's opaque wire id (prefixed `'var_...'`), taken from a product's `variants[].id`. |


---

## `CartLineItem`

*Interface*

One cart line: a product variant and its quantity, addressed by
CartLineItem.variantId. The SKU, image and option values are copied when the
item is added. The price follows the catalogue on every cart call, and checkout
charges the current price.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `grossCents` | `number` | No | This line's amount with VAT, in cents, for all its units: equal to CartLineItem.subtotalCents. |
| `netCents` | `number` | No | This line's amount without VAT, in cents, for all its units. Equal to `grossCents` when no VAT is charged. |
| `optionValues` | `CartLineOptionValue[]` | No | Ordered option pairs identifying the chosen variant. Empty array for a product with no options. |
| `quantity` | `number` | No | How many units of this variant are in the cart. Integer, 1 or more, capped at 999 per line. |
| `subtotalCents` | `number` | No | The amount charged for this line in minor currency units (cents), VAT included when VAT is<br>charged. Computed server-side. Read it rather than multiplying `unitPriceCents` by<br>`quantity`. |
| `thumbnail` | `string \| null` | No | Absolute URL of the product's primary image, copied when the item was added and shared by its lines. `null` when the product has no image. |
| `title` | `string` | No | Product name in the cart's language when translated, else as stored when the item was added. Always non-empty. |
| `unitPriceCents` | `number` | No | Price of one unit in minor currency units (cents), VAT included when VAT is charged:<br>the current catalogue price. When VAT is added to prices the<br>merchant entered without it, this can differ slightly from `subtotalCents / quantity`. |
| `variantId` | `string \| null` | No | The variant's `var_...` id, to pass to CartService.updateLine or<br>CartService.removeLine. `null` only if the variant was deleted; such a line<br>is normally removed and reported in Cart.removedLines. |
| `variantSku` | `string \| null` | No | Merchant stock-keeping unit snapshotted at add time. `null` when the merchant set none. |
| `variantTitle` | `string \| null` | No | Variant name (e.g. `'Medium / Navy'`), translated like `title`, or `null` when the variant has none. |


---

## `CartLineOptionValue`

*Interface*

One resolved option pair on a cart line, snapshotted when the item was added
(e.g. `{ option: 'Size', value: 'M' }`). Render these to tell two lines of the
same product apart. Empty for a product with no options.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `option` | `string` | No | Option name as the merchant labelled it (e.g. `'Size'`, `'Colour'`). |
| `value` | `string` | No | The chosen value for that option (e.g. `'M'`, `'Navy'`). |


---

## `CartUpdateInput`

*Interface*

The cart fields CartService.update sets. An absent key keeps the stored value,
`null` clears it, and a value replaces it.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `deliveryAddress` | `OrderAddress \| null` | Yes | The delivery address, replacing the stored one whole, or `null` to clear it.<br>`countryCode` must be an ISO 3166-1 alpha-2 code; a new country can clear the shipping choice. |
| `pickupPointId` | `string \| null` | Yes | The `id` of a point from `lynkow.pickupPoints.search()` for the cart's shipping option,<br>or `null` to clear it. A new shipping option clears the stored point unless the same<br>call sends one. The stored point is also dropped when the delivery country changes away<br>from the point's country, or when the option stops taking a point.<br><br>Refused, with nothing written, with `apiCode` `SHIPPING_OPTION_NO_PICKUP_POINTS` when<br>the cart has no shipping option or delivery country or its option takes no point,<br>`PICKUP_POINT_INVALID` for an unknown or closed point, and<br>`PICKUP_POINT_SEARCH_UNAVAILABLE` (retry) when the point cannot be checked right now. |
| `shippingOptionId` | `string \| null` | Yes | A `shp_...` id from `lynkow.shippingOptions.list()`, or `null` to clear it. An id that<br>is not active in the delivery country's market is cleared, not refused. |


---

## `CartWithToken`

*Interface*

The Cart returned by CartService.addLine, which carries the guest cart
token on the add that creates a guest cart. The service keeps the token; persist it
only to survive a page reload.

Extends: `Cart`

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `cartToken` | `string` | Yes | The guest cart token, returned once and never again. Whoever holds it can read and<br>change the cart, so store it per visitor only. |
| `currency` | `string` | No | ISO 4217 currency code the totals are expressed in (e.g. `'EUR'`), fixed per site. |
| `deliveryAddress` | `OrderAddress \| null` | No | The delivery address set with CartService.update, `countryCode` in upper case,<br>or `null`. Its country decides which market's shipping options apply. |
| `id` | `string` | No | The cart's `cart_...` id, stable across adds, updates and removals. A<br>CartService.claim that merges into the buyer's existing cart returns that cart's id. |
| `items` | `CartLineItem[]` | No | The cart lines, one per variant. Empty for a cart whose every line was removed. |
| `locale` | `string \| null` | No | The cart's language tag (e.g. `'pt-BR'`), set by the creating `addLine` or by<br>CartService.setLocale. `null` when none was set: the site's default applies. |
| `pickupPoint` | `SelectedPickupPoint \| null` | Yes | The pickup point set with CartService.update, or `null`. Checkout freezes it on<br>the order. Absent from an API that predates pickup points. |
| `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | `'inclusive'` shows prices with VAT; `'exclusive'` without (`subtotalNetCents`, each<br>line's `netCents`, `totalCents - taxTotalCents`). Display only. |
| `removedLines` | `RemovedCartLine[]` | Yes | Lines removed by this call, already gone from `items` and the totals. Absent when<br>nothing was removed: a per-call report, never a standing list. |
| `shippingOptionId` | `string \| null` | No | The chosen `shp_...` shipping option, or `null`. A choice that stops being an active<br>option of the delivery country's market is cleared on the next cart call. |
| `shippingTotalCents` | `number` | No | Shipping of the chosen option in cents, VAT included when charged. 0 with no option,<br>no line, or a free option. Provisional: checkout recomputes it. |
| `subtotalCents` | `number` | No | Sum of every line's CartLineItem.subtotalCents, in minor currency units (cents): the<br>amount charged for the goods, VAT included when VAT is charged. Computed server-side. |
| `subtotalGrossCents` | `number` | No | Cart.subtotalCents with VAT, in cents: equal to `subtotalCents`. |
| `subtotalNetCents` | `number` | No | Cart.subtotalCents without VAT, in cents: the sum of every line's `netCents`. |
| `taxTotalCents` | `number` | No | The VAT contained in Cart.totalCents, in cents (do not add it), at the delivery<br>country's rate, else the merchant country's. 0 when no VAT is charged. |
| `totalCents` | `number` | No | Amount payable in cents: Cart.subtotalCents plus Cart.shippingTotalCents.<br>Provisional: checkout recomputes it and can refuse with `TOTAL_CHANGED`. |


---

## `RemovedCartLine`

*Interface*

One entry in Cart.removedLines: a line the server removed during the call that
returned the cart, because its variant is no longer sellable or is out of stock on a
site that refuses overselling. Use it to tell the buyer the item was dropped.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `reason` | `"unavailable" \| "out_of_stock"` | No | `'unavailable'`: the variant is no longer sellable. `'out_of_stock'`: its tracked stock<br>is at or below zero, and the buyer can add it again once restocked. |
| `title` | `string` | No | Product name, translated like CartLineItem.title, for the "removed" message. Always non-empty. |
| `variantId` | `string \| null` | No | The removed variant's `var_...` id, or `null` when the variant was deleted. The line is already gone. |
| `variantTitle` | `string \| null` | No | Variant name (e.g. `'Medium / Navy'`), translated like `title`, or `null` when unset. |


---

## `ShippingOption`

*Interface*

One shipping option of a market, as `lynkow.shippingOptions.list()` returns it:
a delivery method the merchant offers in that market, with its price. Only
active options are listed.

The `locale`, `requestedLocale` and `isFallback` signals of
LocaleResolution are present when the request carried a locale, and
describe the language `label` is served in.

Extends: `LocaleResolution`

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `deliveryLabelKey` | `"home_delivery" \| "pickup_point_delivery"` | Yes | A stable key for how the option delivers, `'home_delivery'` or `'pickup_point_delivery'`,<br>to map to your own translated text. Absent from an API that predates pickup points. |
| `id` | `string` | No | Opaque option id, prefixed `'shp_'`. Stable; pass it as<br>CartUpdateInput.shippingOptionId or `PlaceOrderInput.shippingOptionId`. |
| `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.<br>Absent when the request carried no locale. Never `true` with `fallback: false`. |
| `label` | `string` | No | The option's name for the buyer (e.g. `'Standard delivery'`), in the requested locale<br>or its fallback. Always non-empty. |
| `locale` | `string` | Yes | BCP 47 locale code of the record actually served (e.g. `'en'`, `'fr'`).<br>Equals `requestedLocale` unless `isFallback` is `true`. |
| `position` | `number` | No | The merchant's sort order for the option within its market. The list is already<br>sorted by it, lowest first; use it only to re-sort a copy. |
| `priceCents` | `number` | No | The option's price in minor currency units (cents) of the site's currency, VAT<br>included when the site charges VAT: equal to ShippingOption.priceGrossCents.<br>Integer, 0 or more; 0 is a free option. |
| `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | How the merchant wants prices shown: `'inclusive'` shows the prices with VAT<br>(`priceGrossCents`), `'exclusive'` without it (`priceNetCents`). `'inclusive'` unless the<br>merchant chose otherwise. Display only: it never changes the amount charged. |
| `priceGrossCents` | `number` | No | ShippingOption.priceCents with VAT, at the rate of the `country` the list was<br>read with, else the merchant's. Pass the delivery country to show the amount charged. |
| `priceNetCents` | `number` | No | ShippingOption.priceCents without VAT, in cents. Equal to `priceGrossCents` when no<br>VAT applies. Show it when ShippingOption.priceDisplayMode is `'exclusive'`. |
| `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the<br>`locale` request option or the client's configured locale.<br>Absent when the request carried no locale. |
| `requiresPickupPoint` | `boolean` | Yes | `true` when the buyer must choose a pickup point for this option<br>(`lynkow.pickupPoints.search()`) before placing the order. Absent from an API that<br>predates pickup points: read it as `option.requiresPickupPoint === true`. |


---

## `ShippingOptionList`

*Interface*

The response of `lynkow.shippingOptions.list()`: every active shipping option of
one market, lowest `position` first. Not paginated.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `data` | `ShippingOption[]` | No | The market's active shipping options. Empty when it has none, when `market` is not an<br>active market of the site, or, with `fallback: false`, when none is translated. |


---

## `ShippingOptionsListOptions`

*Interface*

Request options of `lynkow.shippingOptions.list()`. `market` is required.

Extends: `BaseRequestOptions`

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `country` | `string` | Yes | ISO 3166-1 alpha-2 code (e.g. `'DE'`) of the buyer's delivery country, whose VAT rate<br>prices the options. Sent only when set. An unusable value is ignored and the merchant's<br>country applies. |
| `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then<br>throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads<br>without locale fallback ignore it. |
| `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's<br>`fetchOptions`, such as `{ next: { revalidate: 60 } }`. |
| `locale` | `string` | Yes | Locale of this request (e.g. `'fr'`), overriding the client's `locale`.<br>Reads never reject a locale: a missing translation is served in another<br>locale and flagged `isFallback: true` (see LocaleResolution). Some<br>writes, such as `reviews.submit()`, refuse a locale the site does not enable. |
| `market` | `string` | No | Id (`mkt_...`) of the market whose shipping options to list, as returned by<br>`lynkow.markets.list()`. The id of a market that is unknown, still a draft, or<br>another site's lists nothing. |