CheckoutSession is the core type of the SDK: the platform-agnostic view of the shopper’s cart, customer, shipping, payment and totals that useCheckoutSession returns and that every action of useCheckoutAction updates. This page lists every field of the session and of the types it contains. All of them are importable from @ollie-shop/sdk, for example import type { CheckoutSession, CartItem } from '@ollie-shop/sdk'.
Two conventions apply everywhere below:
- Amounts are in minor units (cents). Divide by 100 before formatting, or use
Intl.NumberFormatwithsession.localeas in the examples. - Optional means the platform may not send it. Guard with
?.before reading nested data.
Structure Overview
CartItem
CustomerData
Every field is optional.
CustomerPreferences:
saveData?: boolean (remember the customer’s data) and locale?: string (e.g., "en-US").
Addresses
Address
The base shape, used for billing addresses asBillingAddress.
ShippingAddress
Address plus receiverName?: string.
CustomerAddress
Address plus:
ShippingInfo
ShippingPackage
EstimatedDeliveryTime:
{ value: number; unit }, where unit is a singular or plural time unit ("day", "days", "hour", "week", …) or "businessDays".
TimeSlot: { id: string; price: number; originalPrice: number; startDate: string; endDate: string }, dates in ISO 8601.
ShippingQuote
A union of three shapes, narrowed bytype:
Fields shared by all three:
pickUpInfo on a pickup quote:
PaymentInfo
PaymentMethod
PaymentInstallment:
{ number: number; amount: number; total: number; interestRate?: number }, amounts in minor units.
SelectedPayment
GiftCard
SavedCard
Campaign
Promotion:
id: string, name?: string, discountValue?: number (minor units), code?: string (the coupon that triggered it), trigger: "coupon" | "automatic", applied: boolean.
Totals
TaxLine:
{ name: string; value: number }.
LocaleInfo
User
Usage Examples
Formatting amounts
Every amount is in minor units, so one helper built fromsession.locale serves every example below.
Checking if a session is ready for checkout
Displaying cart totals
Handling multi-package shipping
Reading the selected pickup point
Related
- useCheckoutSession: the hook that returns this type
- useCheckoutAction: the inputs that change it
- Checkout Order Types: the shape of the order placed from this session