> ## Documentation Index
> Fetch the complete documentation index at: https://quickbutik.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Types

> The data shapes the kit returns: products, categories, the shop, carts, checkout sessions and confirmations.

> [!NOTE]
>
> This page is the curated reference. The complete, generated type reference lives at [/kit/api/core](https://quickbutik.dev/kit/api/core.md) and is regenerated from the published typings. Every type here is exported from `@quickbutik/kit` and `@quickbutik/kit/sdk`.

> [!NOTE]
>
> **Money is always an integer in the currency's minor unit** (öre, cents): `24900` is 249.00. The `MinorUnits` alias marks every such field. Prices include VAT. Divide by 100 or use `formatMoney`, with the currency the response states (`product.currency`, `cart.currency`). See [Currencies](https://quickbutik.dev/kit/concepts/currencies.md).

## Page

```ts theme={null}
interface Page<T> {
  data: T[]
  has_more: boolean
  next_cursor: string | null
  meta?: { pricing?: CatalogPricing }   // on product lists and searches
}
```

## CatalogPricing

Who a catalog response was priced for: `page.meta.pricing` on a product list or search, `product.pricing` on a single read. Absent from a platform older than the field.

**audience** `'anonymous' | 'customer' | 'customer_group'`

A guest, a logged-in customer in no group, or one priced with their group's prices.

**groupId** `number | null`

The customer's group, when `audience` is `customer_group`.

**vatDisplay** `'incl' | 'excl' | null`

How the group shows prices. A display hint only; the amounts are the same either way.

## Product

**id** `string`

Prefixed, `"prod_123"`. Pass it straight to `cart.add`.

**name** `string | null`

**price** `number | null`

Display price, minor units, in `currency`.

**currency** `string | undefined`

What every price on this product is in: the client's chosen currency when the shop offers it, else the shop's own. Format with this. Absent on a platform older than the field.

**description** `string | null`

Merchant-authored HTML.

**slug** `string | null`

**visible** `boolean | null`

**taxRate** `number | null`

VAT percentage: 25, 12, 6.

**seoTitle** `string | null`

Preferred by `buildSeo`.

**seoDescription** `string | null`

**images** `ProductImage[]`

**options** `ProductOptionType[] | undefined`

Optional on the wire; the variant matrix rebuilds groups from the variants when absent.

**variants** `ProductVariant[]`

A simple product has one synthetic variant.

**sections** `ProductSection[] | undefined`

Merchant content sections, in order.

**relatedProducts** `RelatedProducts | undefined`

Only from `products.get()`.

**pricing** `CatalogPricing | undefined`

Who the product was priced for. Only from `products.get()` and `getBySlug()`; lists carry it once per page.

A product has **no category membership**: a category page is `products.search({ categoryId })`.

## ProductVariant

**id** `number`

The numeric id the cart takes as `variantId`.

**sku** `string`

**barcode** `string | null`

**weight** `number | null`

Grams.

**hidden** `boolean | null`

**minPurchaseQty** `number | null`

**maxPurchaseQty** `number | null`

**imageId** `number | null | undefined`

The `id` of one of the product's own `images`, or `null`.

**price** `ProductVariantPrice`

**properties**

**price** `number | null`

Minor units. Falls back to `product.price` when null, unless `hidden` is true.

**comparePrice** `number | null`

The "before" price; null when not on sale.

**source** `'base' | 'sale' | 'customer_group' | 'campaign' | undefined`

Where `price` came from (`PriceSource`). Absent from a platform older than the field.

**hidden** `boolean | undefined`

True when the shop shows prices to logged-in customers only and this shopper is a guest. The amounts are null; show a "log in to see prices" hint.

**stock** `ProductVariantStock`

**properties**

**stock** `number | null`

**`null` means not tracked, so purchasable.** Only a number at or below 0 is out of stock.

**preorder** `boolean | null`

**options** `ProductOptionValue[]`

The option values this variant is made of.

## ProductImage

**id** `number`

**productId** `number`

**url** `string | null`

Absolute, without resize parameters. **Render this.**

**path** `string | null`

The bare storage filename. **Not a URL**; rendering it 404s.

**position** `number | null`

**date** `string | null`

**altText** `string | null`

**contentHash** `string | null`

Cache-buster. `"temp"` means the file is still being processed.

## ProductOptionType and ProductOptionValue

```ts theme={null}
interface ProductOptionType {
  id: number
  name: string | null      // "Färg", "Storlek": merchant data, differs per product
  position: number | null
}

interface ProductOptionValue {
  id: number
  name: string | null
  position: number | null
  optionId: number | null
}
```

## ProductSection

```ts theme={null}
interface ProductSection {
  id: string       // stable render key
  title: string    // may be empty
  content: string  // merchant HTML; sanitize before injecting
}
```

Rendered the way the Quickbutik theme renders them: template-linked sections carry the template's text, and the `[STOCKLEFT]`, `[PRICE]` and `[BEFOREPRICE]` merge tags are replaced.

## RelatedProducts

**mode** `'category' | 'specific' | 'none'`

`category`: up to 8 from the same category, newest first. `specific`: the merchant's hand-picked list, up to 12. `none`: always empty.

**products** `RelatedProductSummary[]`

**properties**

**id** `string`

`"prod_123"`

**name** `string | null`

**slug** `string | null`

**price** `\{ price: number | null; comparePrice: number | null \}`

Priced like the product list, discounts and campaign prices included.

**image** `ProductImage | null`

## Category

**id** `string`

`"cat_12"`

**name** `string | null`

**slug** `string | null`

**parentId** `string | null`

**description** `string | null`

**description1** `string | null`

**description2** `string | null`

**image** `string | null`

Bare storage filename, not a URL.

**imageUrl** `string | null`

Absolute. Size it with `resolveCategoryImageUrl`.

**seoTitle** `string | null`

**ancestors** `CategoryAncestor[]`

Root first, to the immediate parent. Feeds a breadcrumb.

**properties**

**id** `string`

`"cat_2"`

**name** `string | null`

**slug** `string | null`

The ancestor's own slug segment, not its full path.

**path** `string | null`

Full slug path, `"clothing/shirts"`.

**childCount** `number`

## Shop

**name** `string`

**currency** `string | null | undefined`

The shop's own (base) currency, upper-case ISO 4217. Absent on a platform older than the field.

**currencies** `ShopCurrency[] | undefined`

Every currency a shopper may browse in, base first. Only the base entry when the merchant's currency converter is off; read a missing field the same way.

**properties**

**code** `string`

Upper-case ISO 4217.

**mode** `'base' | 'display' | 'charge'`

`base`: the shop's own. `display`: shown converted, charged in the shop's currency. `charge`: priced and charged in this currency. Exported as `ShopCurrencyMode`.

**rate** `number`

Units of this currency per 1 unit of the shop's currency.

**storeUrl** `string | null | undefined`

**termsUrl** `string | null | undefined`

**language** `string | null | undefined`

`"sv"`

**newsletterEnabled** `boolean | undefined`

**messageEnabled** `boolean | undefined`

**brand** `ShopBrand`

**properties**

**logo** `string | null`

**favicon** `string | null | undefined`

**description** `string | null | undefined`

Doubles as the home page meta description.

**color.primary** `string | null`

Hex, or null when never set.

**tracking** `ShopTracking | null | undefined`

The merchant's tracking ids as configured in the admin, already validated by the platform. What the kit's analytics loads by default (`destinationsFromShop`). Absent on a platform older than the field.

**properties**

**ga4MeasurementId** `string | null`

`G-…`

**gtmContainerId** `string | null`

`GTM-…`

**metaPixelId** `string | null`

Numeric pixel id.

**metaCapiEnabled** `boolean`

Whether the platform sends Meta Conversions API events for this shop. Access tokens never leave the server.

The wire payload also carries `demo.enabled`, not declared on the type: `true` while the shop has not activated Quickbutik Payments and its checkout runs in demo mode.

## Cart

**id** `string`

**storeId** `number`

The shop's **numeric** id, what the hosted checkout URL needs.

**items** `CartItem[]`

**itemCount** `number`

Sum of quantities, not of lines.

**currency** `string`

What every amount in **this response** is in. A cart is priced per request, so the same cart can read in SEK on one request and EUR on the next.

**presentment** `CartPresentment | undefined`

How `currency` relates to the checkout. A missing field means `mode: "base"`.

**properties**

**mode** `'base' | 'display' | 'charge'`

`display`: amounts converted for display, the checkout charges `chargeCurrency` (the shop's own). `charge`: amounts are what the checkout will charge.

**chargeCurrency** `string`

What the checkout will charge in.

**baseCurrency** `string`

The shop's own currency.

**exchangeRate** `number`

Units of `currency` per 1 unit of `baseCurrency`. `1` for `base`.

**subtotal** `number`

Display figure, following the shop's VAT setting. Also `subtotalExclTax`, `subtotalInclTax`.

**totalTax** `number`

**totalDiscount** `number`

**total** `number`

Display figure. Also `totalExclTax`, `totalInclTax`.

**createdAt** `string`

**updatedAt** `string`

**storefrontId** `string | null | undefined`

The campaign storefront the cart is bound to.

**surface** `StorefrontSurface | null | undefined`

Shipping is chosen in the hosted checkout, so a cart total covers products only.

## CartItem

**id** `string`

The **line** id. The handle for `updateItem` and `removeItem`.

**productId** `number`

**variantId** `number | undefined`

**quantity** `number`

**productTitle** `string | null`

**variantName** `string | null`

`"Red / XL"`; null for a simple product.

**sku** `string | null`

**imageUrl** `string | null`

Absolute. Size it with `applyImageTransform`.

**unitPrice** `number`

Display figure. Also `unitPriceExclTax`, `unitPriceInclTax`.

**compareAtPrice** `number | null`

**taxRate** `number`

**taxAmount** `number`

**discountAmount** `number`

**lineTotal** `number`

Display figure. Also `lineTotalTax`, `lineTotalExclTax`, `lineTotalInclTax`.

**available** `boolean`

False once the product was hidden or deleted.

## CheckoutSession

Returned by `createSession()` and as `session` on a `v2` start result.

**sessionId** `string`

**cartId** `string`

**successUrl** `string | null`

`null` for an inline session created without one.

**cancelUrl** `string | null`

**backUrl** `string | null`

**language** `string | null`

**origin** `string | null`

**embed** `\{ origin: string; returnUrl: string \} | null | undefined`

**successMode** `'redirect' | 'inline' | undefined`

**storefrontId** `string | null | undefined`

**surface** `StorefrontSurface | null | undefined`

**theme** `'light' | 'dark'`

The effective theme.

**displayCurrency** `DisplayCurrency | null | undefined`

The currency the checkout shows an approximate amount in, set when the session was created with a `"display"` currency. `null` when none applies (no currency sent, the shop's own, or a `"charge"` currency, in which case `data.pricing.value.currency` is it).

**properties**

**code** `string`

Upper-case ISO 4217.

**rate** `number`

Units of `code` per 1 unit of the currency the session is charged in.

**fields** `Record\<string, FieldState\>`

Shopper-supplied values with the server's verdict: `value`, `status` (`empty`, `valid`, `invalid`), `errors`, `updatedAt`.

**data** `Record\<string, DataState\>`

Server-computed nodes: `value`, `resolvedAt`.

## CheckoutSessionSnapshot

Returned by `getSession()` and `syncCart()`. The same fields as a session (without `sessionId` and `theme`), plus:

**isComplete** `boolean`

Whether the checkout can take payment.

**blockingFields** `string[]`

What still stands in the way.

The data nodes worth reading (`CheckoutDataNodes`):

| Node | Contents |
| - | - |
| `cart_products` | The lines as the session snapshotted them: `productId`, `variantId`, `name`, `variantName`, `price`, `quantity`, `imageUrl` |
| `pricing` | Product-only subtotals, `taxOnTop`, and `currency` (what the session is priced **and charged** in), with `baseCurrency` and `exchangeRate` when that differs from the shop's own |
| `order_total` | **The authoritative total**: `subtotal`, `totalTax`, `totalDiscount`, `totalShipping`, `totalPaymentFee`, `total`, `currency`, `lines` |
| `shipping_cost`, `payment_cost`, `discount`, `promocode` | `OrderLine[]`: `id`, `tag`, `label`, `amount`, `taxRate`, `taxAmount` |

`order_total.total` is the figure the shopper is charged. Never recompute it.

## SessionConfirmation

**status** `'completed' | 'processing_payment' | 'no_attempt' | 'failed'`

`processing_payment`: paid, order being created (typically 6 to 17 seconds). `no_attempt`: no payment attempt known yet.

**orderNumber** `number | undefined`

**successMode** `'redirect' | 'inline' | undefined`

**legacySuccessUrl** `string | undefined`

**retryAfterMs** `number | undefined`

## ConfirmationOutcome

```ts theme={null}
type ConfirmationOutcome =
  | { kind: "completed"; orderNumber: number | null; confirmation: SessionConfirmation }
  | { kind: "failed"; confirmation: SessionConfirmation }
  | { kind: "timeout"; lastStatus: ConfirmationStatus | null }  // NOT a failure
  | { kind: "aborted" }
```

`orderNumber` can be `null` on `completed`. Fall back to `checkout.parseReturnUrl(location.href)?.orderNumber` for display.

## CurrencyInfo

What `describeCurrency(shop, selected)` and `useCurrency()` resolve a currency choice to.

**currency** `string | null`

What prices are shown in: the choice when the shop offers it, else the shop's own. `null` only before the shop is known with nothing chosen.

**baseCurrency** `string | null`

The shop's own currency.

**mode** `'base' | 'display' | 'charge'`

**rate** `number`

Units of `currency` per 1 unit of the base currency. `1` for `base`.

**chargeCurrency** `string | null`

What the checkout will charge: the base currency, or `currency` in charge mode.

**currencies** `ShopCurrency[]`

Every currency the shop offers, base first. Empty until the shop is known.

## ConsentState

The shopper's cookie decision, as `shopkit.consent.read()`, `readConsentCookie()` and the consent store report it. `ConsentSnapshot` (the store's snapshot) adds `open: boolean`, whether the preferences panel is open.

**status** `'undecided' | 'decided'`

Undecided is treated as denied.

**analytics** `boolean`

**marketing** `boolean`

**decidedAt** `string | null`

ISO timestamp of the decision.

**revision** `number`

The cookie-policy revision the decision was made under.

`ConsentCategory` is `"necessary" | "analytics" | "marketing"`; `ConsentChoice` is `{ analytics: boolean; marketing: boolean }`. See [Consent and analytics](https://quickbutik.dev/kit/concepts/consent-and-analytics.md).

## Customer

The logged-in customer, as `customers.login()`, `customers.register()`, `customers.resetPassword()`, `customers.me()` and `useCustomer()` return it. See [Customer accounts](https://quickbutik.dev/kit/concepts/customer-accounts.md).

**id** `number`

**email** `string`

**firstName** `string | null`

**lastName** `string | null`

**phone** `string | null`

**isCompany** `boolean`

**companyName** `string | null`

**companyNumber** `string | null`

**address** `CustomerAddress | null`

**properties**

**line1** `string | null`

**line2** `string | null`

**postalCode** `string | null`

**city** `string | null`

**country** `string | null`

ISO 3166-1 alpha-2.

**group** `CustomerGroup | null`

The customer group whose prices the customer sees, or `null`.

**properties**

**id** `number`

**name** `string`

**priceVatDisplay** `'incl' | 'excl'`

How the shop shows this group's prices. A display hint only.

## CustomerSession

What `customers.login()` and `customers.resetPassword()` resolve with, and what a `logged_in` `CustomerRegisterResult` carries. `CustomerSessionInput`, which `setSession()` takes, has the same fields without `customer`, and everything but `accessToken` optional.

**accessToken** `string`

Lives 15 minutes. The kit renews it.

**accessTokenExpiresAt** `string`

ISO 8601.

**refreshToken** `string`

Rotates on every renewal.

**refreshTokenExpiresAt** `string`

ISO 8601.

**customer** `Customer`

## CustomerRegisterInput

What `customers.register()` takes. See [Registration](https://quickbutik.dev/kit/concepts/customer-accounts.md#registration).

**email** `string` *required*

**password** `string` *required*

6 to 40 bytes (UTF-8; å, ä and ö count as 2), after HTML tags are removed.

**firstName** `string` *required*

**lastName** `string` *required*

**companyName** `string`

A non-empty name registers a company customer.

**companyNumber** `string`

The company's registration number.

**clubOptIn** `boolean`

Also join the customer club, when the shop's club takes members at registration (`customerClub.joinMethod` is `registration` or `auto_and_registration`). Ignored otherwise.

## CustomerRegisterResult

What `customers.register()` resolves with. Check `status` before reading the session fields.

```ts theme={null}
type CustomerRegisterResult =
  | ({ status: "logged_in" } & CustomerSession)   // a new email, now logged in
  | { status: "verification_required" }            // an earlier guest: a code was emailed; finish with resetPassword()
  | { status: "login_required" }                   // created, but no session: send the shopper to login()
```

## CustomerPasswordResetRequestInput, CustomerPasswordResetInput

What `customers.requestPasswordReset()` and `customers.resetPassword()` take.

**email** `string` *required*

**code** `string` *required*

`CustomerPasswordResetInput` only. The one-time code from the email. Case, spaces and dashes don't matter.

**password** `string` *required*

`CustomerPasswordResetInput` only. The new password, with the same rules as for registration.

## CustomerState

What `customers.onChange()` listeners get, or `null` when nobody is logged in. The `qb:customer` DOM event carries `{ customerId }` only.

**customerId** `string | null`

The customer id from the access token.

**customer** `Customer | null`

The profile, when this client has read it. A session set with `setSession()` has none until `me()` reads it.

## CustomerClub

**member** `boolean`

**active** `boolean`

**points** `\{ balance: number; lifetime: number \}`

**reward** `\{ targetPoints: number; remaining: number \}`

Progress towards the next reward code.

**earning** `\{ pointsPerUnit: number; currency: string \}`

Points earned per unit of the request's currency.

## CustomerAccountsConfig

The shop's customer-account settings, from `customers.config()`.

**login** `object`

**properties**

**enabled** `boolean`

Customer login is switched on.

**signupAllowed** `boolean`

Shoppers may create their own account with `customers.register()`.

**hidePricesForGuests** `boolean`

Guests get `price: null` with `hidden: true`.

**hideAddToCartForGuests** `boolean`

A guest's cart write answers `login_required`.

**customerGroups** `\{ enabled: boolean \}`

**customerClub** `\{ enabled: boolean; joinMethod: 'registration' | 'auto' | 'manual' | 'auto_and_registration' \}`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.