@behio/storefront-sdk 1.19.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.d.ts CHANGED
@@ -71,6 +71,8 @@ interface BehioStorefrontConfig {
71
71
  locale?: string;
72
72
  /** Default currency for price resolution. Default: none (uses shop default) */
73
73
  currency?: string;
74
+ /** Default delivery country (ISO-2) for catalog price rules. Does not mutate the cart. */
75
+ country?: string;
74
76
  /** Custom fetch implementation (for Node.js < 18 or testing) */
75
77
  fetch?: typeof fetch;
76
78
  /**
@@ -134,6 +136,14 @@ type StockMode = "TRACKED" | "ALWAYS_AVAILABLE" | "MADE_TO_ORDER";
134
136
  * progress) rather than a security boundary.
135
137
  */
136
138
  interface CheckoutSettings {
139
+ /** Single page or address / delivery / confirmation steps. Missing = SINGLE_PAGE. */
140
+ checkoutLayout?: "SINGLE_PAGE" | "STEP_BY_STEP";
141
+ /** Hide the optional subtotal/tax/discount breakdown, never the payable total. */
142
+ showCartPriceBreakdown?: boolean;
143
+ /** Show a delivery estimate only if the selected method supplies one. */
144
+ showEstimatedDelivery?: boolean;
145
+ /** Merchant's plain-text order confirmation message. */
146
+ orderConfirmationText?: string | null;
137
147
  /** Guests may order without an account (also on ShopInfo for back-compat). */
138
148
  allowGuestCheckout: boolean;
139
149
  /** Checkout requires a logged-in / registered account. */
@@ -181,8 +191,10 @@ interface CheckoutSettings {
181
191
  * them as sold out with the buy button disabled.
182
192
  * - `SHOW_SOLD_OUT`: sold-out products render with a "Vyprodáno" state and
183
193
  * a disabled buy button; the API rejects over-stock adds with a 400.
184
- * - `BACKORDER`: out-of-stock products stay purchasable (any quantity);
185
- * render "Na objednávku" instead of disabling the button.
194
+ * - `BACKORDER`: follow `isPurchasable`; the merchant can cap negative stock
195
+ * with a positive safetyStock allowance. Zero keeps backorders unlimited.
196
+ * The cart validates ordinary and bundled quantities together and returns
197
+ * quantityControls for accepted repair/increase targets.
186
198
  * For HIDE/SHOW_SOLD_OUT cap quantity steppers at `stockQuantity` — the
187
199
  * cart API 400s on anything above it.
188
200
  */
@@ -214,7 +226,20 @@ interface CheckoutSettings {
214
226
  }
215
227
  /** Price presentation mode (Eshop.priceDisplay). See `CheckoutSettings.priceDisplay`. */
216
228
  type PriceDisplay = "INCL_VAT" | "EXCL_VAT" | "CUSTOMER_CHOICE";
229
+ type CurrencyDisplayFormat = "SYMBOL_BEFORE" | "SYMBOL_AFTER" | "CODE";
217
230
  interface ShopInfo {
231
+ currencyDisplayFormat?: CurrencyDisplayFormat;
232
+ account?: {
233
+ passwordMinLength: number;
234
+ requireEmailVerification: boolean;
235
+ };
236
+ /** Admin overrides take precedence over template tokens; null inherits them. */
237
+ appearance?: ShopAppearance;
238
+ /** Separate from isActive. Explicit maintenance applies to preview shops too. */
239
+ maintenance?: {
240
+ enabled: boolean;
241
+ message: string | null;
242
+ };
218
243
  id: string;
219
244
  name: string;
220
245
  domain: string;
@@ -261,6 +286,15 @@ interface ShopInfo {
261
286
  */
262
287
  seo?: ShopSeoIdentity;
263
288
  }
289
+ interface ShopAppearance {
290
+ primaryColor: string | null;
291
+ secondaryColor: string | null;
292
+ /** CSS family list. Templates validate syntax and retain local fallbacks. */
293
+ fontFamily: string | null;
294
+ /** CSS only. Escape raw-text closing tags when embedding in a style element. */
295
+ customCss: string | null;
296
+ showPoweredBy: boolean;
297
+ }
264
298
  /** Public shop identity for SEO / structured data (GAP-31). */
265
299
  interface ShopSeoIdentity {
266
300
  /** Merchant shop description — Organization JSON-LD `description`. */
@@ -286,6 +320,8 @@ interface NewsletterUnsubscribeResult {
286
320
  success: boolean;
287
321
  }
288
322
  interface ShopSeo {
323
+ robotsTxt?: string | null;
324
+ googleSiteVerification?: string | null;
289
325
  locale: string;
290
326
  title: string | null;
291
327
  description: string | null;
@@ -412,7 +448,16 @@ interface ProductVariant {
412
448
  * the chosen variant.
413
449
  */
414
450
  id: string;
451
+ /** Public supporting files/media of this variant; no paid download URLs. */
452
+ assetGroups?: ProductAssetGroup[];
453
+ /** Approved reviews of this exact sellable listing. */
454
+ ratingAverage?: number | null;
455
+ ratingCount?: number;
456
+ requiresShipping?: boolean;
457
+ isDigital?: boolean;
415
458
  sku: string;
459
+ /** Barcode of this sellable variant; never inherit the parent barcode. */
460
+ gtin?: string | null;
416
461
  /**
417
462
  * Variant name in the requested locale. Before SDK 1.1.0 this was always the
418
463
  * warehouse item name, so translated shops showed one language to everyone.
@@ -447,6 +492,8 @@ interface ProductVariant {
447
492
  * Added in SDK 1.1.0.
448
493
  */
449
494
  images: ProductDetail["images"];
495
+ /** Own image/video gallery. Empty means inherit the parent gallery. */
496
+ media?: ProductMedia[];
450
497
  /**
451
498
  * Per-variant SEO/OG overrides, or `null` when the merchant wrote none. The
452
499
  * canonical URL stays the parent's, so use these only when a variant is
@@ -474,6 +521,16 @@ interface ProductVariant {
474
521
  /** `null` when prices are gated behind login for guests (B2B mode). */
475
522
  price: ProductPrice | null;
476
523
  inStock: boolean;
524
+ /** Own sale window and stock policy. Never infer eligibility from price. */
525
+ isPurchasable?: boolean;
526
+ availability?: ProductAvailability;
527
+ /** Own purchase rules; null means no constraint, not inheritance. */
528
+ minOrderQuantity?: number | null;
529
+ orderQuantityStep?: number | null;
530
+ saleStartAt?: number | null;
531
+ saleEndAt?: number | null;
532
+ /** This variant's quantity tiers in the requested currency. Empty for gated guests. */
533
+ volumePricing?: ProductVolumePrice[];
477
534
  /** Exact remaining stock, or `null` when the merchant hides the count
478
535
  * (showStockCount off) — treat null as "unknown", never as 0. */
479
536
  stockQuantity?: number | null;
@@ -880,6 +937,8 @@ interface ProductDetail extends ProductListItem {
880
937
  * indexing = PARENT_PAGE). Added in SDK 1.4.0.
881
938
  */
882
939
  canonicalSlug?: string | null;
940
+ /** Actual canonical translations, for hreflang and locale navigation. */
941
+ localizedSlugs?: Record<string, string>;
883
942
  /**
884
943
  * `true` = render `noindex, follow`. Set on a parent product that colour
885
944
  * cards have taken over, so it stops competing with its own cards.
@@ -907,6 +966,8 @@ interface ProductDetail extends ProductListItem {
907
966
  * active digital asset (PDF, MP3, ...) delivered instantly after purchase.
908
967
  */
909
968
  isDigital?: boolean;
969
+ /** Independent of attached digital content. */
970
+ requiresShipping?: boolean;
910
971
  }
911
972
  interface Category {
912
973
  id: string;
@@ -1167,6 +1228,27 @@ interface AuthTokens {
1167
1228
  accessToken: string;
1168
1229
  refreshToken: string;
1169
1230
  }
1231
+ /** Checkout-only response. The guest token reads exactly the newly created order
1232
+ * for 30 minutes. Keep it out of URLs and analytics; prefer an HttpOnly cookie. */
1233
+ interface CheckoutPreview {
1234
+ currency: string;
1235
+ subtotal: number;
1236
+ taxTotal: number;
1237
+ shippingTotal: number;
1238
+ paymentFee: number;
1239
+ /** Includes loyaltyDiscount and giftCardDeducted; do not subtract them twice. */
1240
+ discountTotal: number;
1241
+ loyaltyPointsUsed: number;
1242
+ loyaltyDiscount: number;
1243
+ giftCardDeducted: number;
1244
+ roundingAdjustment: number;
1245
+ grandTotal: number;
1246
+ previewToken: string;
1247
+ expiresAt: number;
1248
+ }
1249
+ interface CheckoutResult extends OrderDetail {
1250
+ orderAccessToken?: string | null;
1251
+ }
1170
1252
  /**
1171
1253
  * Result of a registration. When the eshop requires admin approval,
1172
1254
  * `pendingApproval` is true and the tokens are null (the account is created but
@@ -1175,6 +1257,8 @@ interface AuthTokens {
1175
1257
  */
1176
1258
  interface RegisterResult {
1177
1259
  pendingApproval: boolean;
1260
+ /** Account created, but no session until the e-mail link is verified. */
1261
+ pendingEmailVerification?: boolean;
1178
1262
  accessToken: string | null;
1179
1263
  refreshToken: string | null;
1180
1264
  }
@@ -1221,7 +1305,7 @@ interface CartItemProduct {
1221
1305
  sku: string;
1222
1306
  imageUrl?: string;
1223
1307
  inStock: boolean;
1224
- currentPrice: number;
1308
+ currentPrice: number | null;
1225
1309
  /** Minimum order quantity (units); null = no minimum. Clamp the cart
1226
1310
  * stepper's lower bound to this (GAP-48). */
1227
1311
  minOrderQuantity?: number | null;
@@ -1231,6 +1315,14 @@ interface CartItemProduct {
1231
1315
  }
1232
1316
  interface CartItem {
1233
1317
  id: string;
1318
+ /** A retained row can be unavailable after the merchant changes its offer. */
1319
+ isPurchasable: boolean;
1320
+ unavailableReason: "CURRENCY_UNAVAILABLE" | "ITEM_UNAVAILABLE" | "QUANTITY_UNAVAILABLE" | null;
1321
+ /** Valid adjacent line quantities, including units in bundles. Older servers omit it. */
1322
+ quantityControls?: {
1323
+ decreaseTo: number | null;
1324
+ increaseTo: number | null;
1325
+ };
1234
1326
  /**
1235
1327
  * Eshop product ID of the sellable unit on this line. A variant is its own
1236
1328
  * product, so this is the exact product/variant the customer added — use it
@@ -1239,19 +1331,19 @@ interface CartItem {
1239
1331
  productId: string;
1240
1332
  product: CartItemProduct;
1241
1333
  quantity: number;
1242
- unitPrice: number;
1243
- totalPrice: number;
1334
+ unitPrice: number | null;
1335
+ totalPrice: number | null;
1244
1336
  priceChanged: boolean;
1245
1337
  volumePriceApplied: boolean;
1246
1338
  /** VAT rate for this line in percent (e.g. 21). Estimated from the shop /
1247
1339
  * product rate; refined by the shipping country at checkout (GAP-30). */
1248
1340
  taxRate: number;
1249
1341
  /** Net amount for this line (without VAT) = totalPrice. */
1250
- netAmount: number;
1342
+ netAmount: number | null;
1251
1343
  /** VAT amount for this line at `taxRate`. */
1252
- taxAmount: number;
1344
+ taxAmount: number | null;
1253
1345
  /** Gross amount for this line (net + VAT). */
1254
- grossAmount: number;
1346
+ grossAmount: number | null;
1255
1347
  }
1256
1348
  /** One VAT rate's slice of a cart or order (GAP-30). Render "DPH {rate} %:
1257
1349
  * {taxAmount}" summary rows from these. `netAmount + taxAmount = grossAmount`. */
@@ -1280,6 +1372,19 @@ interface CartPromotion {
1280
1372
  discountAmount: number;
1281
1373
  }
1282
1374
  interface Cart {
1375
+ /** Hide payable amounts and block checkout while an unavailable line remains. */
1376
+ totalsAvailable: boolean;
1377
+ /** Physical delivery required by any cart or bundle product. Assume true when omitted by older APIs. */
1378
+ requiresShipping?: boolean;
1379
+ /** Delivery threshold basis after product promotions and before order coupons/loyalty/gift cards, in displayed price mode and cart currency. Includes bundles. */
1380
+ shippingSubtotal?: number;
1381
+ /** A currently applicable FREE_SHIPPING promotion waives delivery at checkout. */
1382
+ shippingPromotionApplied?: boolean;
1383
+ /** Authoritative admin limits converted to cart currency. Compare subtotal before shipping/codes. */
1384
+ checkoutLimits?: {
1385
+ minOrderValue: number | null;
1386
+ maxOrderValue: number | null;
1387
+ };
1283
1388
  id: string;
1284
1389
  sessionToken?: string;
1285
1390
  items: CartItem[];
@@ -1349,8 +1454,20 @@ interface CartBundleLine {
1349
1454
  bundleSlug: string;
1350
1455
  bundleName: string;
1351
1456
  quantity: number;
1352
- /** Snapshot of the bundle's per-unit price when it was added. */
1353
- bundlePriceSnapshot: number;
1457
+ /** Current per-unit offer in cart currency; the API keeps this legacy name.
1458
+ * Reading the cart does not rewrite stored cart/order snapshots. */
1459
+ bundlePriceSnapshot: number | null;
1460
+ isPurchasable: boolean;
1461
+ unavailableReason: "CURRENCY_UNAVAILABLE" | "OFFER_UNAVAILABLE" | "QUANTITY_UNAVAILABLE" | "ITEM_UNAVAILABLE" | null;
1462
+ priceChanged: boolean;
1463
+ /** Adjacent valid quantities across every component, other cart line and shared stock. Older servers omit this field. */
1464
+ quantityControls?: {
1465
+ decreaseTo: number | null;
1466
+ increaseTo: number | null;
1467
+ };
1468
+ minQuantity: number;
1469
+ maxQuantity: number | null;
1470
+ remainingStock: number | null;
1354
1471
  currency: string;
1355
1472
  items: CartBundleLineItem[];
1356
1473
  }
@@ -1388,13 +1505,15 @@ interface CheckoutAddress {
1388
1505
  phone?: string;
1389
1506
  }
1390
1507
  interface CheckoutInput {
1508
+ /** Five-minute token from checkout.preview; stale prices or choices fail closed. */
1509
+ previewToken?: string;
1391
1510
  /**
1392
1511
  * Consent-gated Behio Analytics visitor id (behio_visitor_id). Optional;
1393
1512
  * lets the backend attribute the order to the visitor journey. Send it only
1394
1513
  * when the visitor granted analytics consent.
1395
1514
  */
1396
1515
  analyticsVisitorId?: string;
1397
- shippingAddress: CheckoutAddress;
1516
+ shippingAddress?: CheckoutAddress;
1398
1517
  billingAddress: CheckoutAddress;
1399
1518
  email: string;
1400
1519
  phone?: string;
@@ -1518,6 +1637,10 @@ interface OrderStatusHistory {
1518
1637
  createdAt: number;
1519
1638
  }
1520
1639
  interface OrderDetail extends OrderListItem {
1640
+ /** Payment is recorded; access delivery will retry automatically. Do not place a duplicate order. */
1641
+ contentDeliveryPending?: boolean;
1642
+ /** False for an order without physical delivery. */
1643
+ requiresShipping?: boolean;
1521
1644
  items: OrderItem[];
1522
1645
  shippingAddress: CheckoutAddress;
1523
1646
  billingAddress: CheckoutAddress;
@@ -1532,6 +1655,10 @@ interface OrderDetail extends OrderListItem {
1532
1655
  /** DOMESTIC, OSS, REVERSE_CHARGE (no VAT, buyer accounts for it) or EXPORT (no VAT, outside EU). SDK 1.17.0. */
1533
1656
  vatMode?: "DOMESTIC" | "OSS" | "REVERSE_CHARGE" | "EXPORT" | null;
1534
1657
  shippingTotal: number;
1658
+ paymentFee?: number | null;
1659
+ roundingAdjustment?: number | null;
1660
+ loyaltyDiscount?: number | null;
1661
+ giftCardDeducted?: number | null;
1535
1662
  discountTotal: number;
1536
1663
  fulfillmentStatus: FulfillmentStatus;
1537
1664
  statusHistory: OrderStatusHistory[];
@@ -1570,6 +1697,8 @@ interface OrderAccessVerifyResponse {
1570
1697
  * (null = unlimited), optional `expiresAt`.
1571
1698
  */
1572
1699
  interface DigitalDownload {
1700
+ /** Asset disabled or order no longer grants access. */
1701
+ isRevoked?: boolean;
1573
1702
  id: string;
1574
1703
  /** Order this grant originates from (null for legacy/manual grants). */
1575
1704
  orderId: string | null;
@@ -1613,6 +1742,8 @@ interface CourseListItem {
1613
1742
  /** Access expiry (epoch ms, null = never expires). */
1614
1743
  expiresAt: number | null;
1615
1744
  isExpired: boolean;
1745
+ /** Access was withdrawn; another paid, unexpired purchase keeps access active. */
1746
+ isRevoked?: boolean;
1616
1747
  /**
1617
1748
  * Course content opens at this time (epoch ms); null/undefined = already
1618
1749
  * open. While in the future, render "Startujeme ..." + countdown.
@@ -2149,6 +2280,11 @@ interface ProductGroup {
2149
2280
  description: string | null;
2150
2281
  items: ProductListItem[];
2151
2282
  }
2283
+ interface BundleCatalogQuery {
2284
+ locale?: string;
2285
+ currency?: string;
2286
+ country?: string;
2287
+ }
2152
2288
  interface BundleItem {
2153
2289
  productId: string;
2154
2290
  slug: string | null;
@@ -2163,17 +2299,30 @@ interface Bundle {
2163
2299
  slug: string;
2164
2300
  name: string;
2165
2301
  description: string | null;
2166
- /** `null` when the eshop hides prices from guests and this visitor has no price entitlement. */
2302
+ /** `null` when prices are hidden or the bundle has no active offer in the requested currency. */
2167
2303
  bundlePrice: number | null;
2304
+ /** Requested currency. Only explicitly active bundle prices are purchasable. */
2168
2305
  currency: string;
2306
+ priceHidden: boolean;
2307
+ isPurchasable: boolean;
2308
+ unavailableReason: "PRICE_HIDDEN" | "CURRENCY_UNAVAILABLE" | "QUANTITY_UNAVAILABLE" | "ITEM_UNAVAILABLE" | null;
2309
+ activeCurrencies: string[];
2169
2310
  coverImage: string | null;
2170
2311
  endsAt: number | null;
2171
- /** `null` when prices are hidden (see `bundlePrice`). */
2312
+ /** `null` when any component has no comparable price in the requested currency, or prices are hidden. */
2172
2313
  itemsSum: number | null;
2173
- /** Absolute saving vs buying the components separately, in `currency`. `null` when prices are hidden. */
2314
+ /** Absolute saving vs buying the components separately, in `currency`. `null` when the offer or any comparable component price is unavailable. */
2174
2315
  savings: number | null;
2175
- /** Percentage saving, 0–100. 0 when `itemsSum` is zero. `null` when prices are hidden. */
2316
+ /** Percentage saving, 0–100. 0 when `itemsSum` is zero. `null` when the offer or any comparable component price is unavailable. */
2176
2317
  savingsPercent: number | null;
2318
+ /** Valid additional quantities for the current basket; null means no compatible range.
2319
+ * Hidden inventory counts do not appear as a numerical stock ceiling.
2320
+ * Send the current cart session. A stale offer is still rechecked on mutation. */
2321
+ quantityRules?: {
2322
+ minimum: number;
2323
+ maximum: number | null;
2324
+ step: number;
2325
+ } | null;
2177
2326
  /** Minimum bundles per order. Default 1. */
2178
2327
  minQuantity: number;
2179
2328
  /** Maximum bundles per order. `null` = uncapped. */
@@ -2233,6 +2382,12 @@ interface ShippingQuoteInput {
2233
2382
  quantity: number;
2234
2383
  weightKg?: number;
2235
2384
  }>;
2385
+ /**
2386
+ * @deprecated Ignored by the API. The free-shipping threshold is computed
2387
+ * from the visitor's cart (the `X-Cart-Session` the client already sends)
2388
+ * or from `items`; a client-supplied total was never trusted. Kept only so
2389
+ * existing storefronts keep compiling.
2390
+ */
2236
2391
  cartTotal?: number;
2237
2392
  currency?: string;
2238
2393
  }
@@ -2376,14 +2531,17 @@ interface CrossSellItem {
2376
2531
  /** Price in the requested currency (or eshop default), including any price
2377
2532
  * list override for the authenticated customer. `null` when hidden (B2B). */
2378
2533
  price: number | null;
2534
+ /** Render priceFrom with an "from" label for a variant-only family. */
2535
+ variantsOnly?: boolean;
2536
+ priceFrom?: ProductPrice | null;
2379
2537
  /** Original (crossed-out) price in the same currency, when on sale. */
2380
2538
  compareAtPrice: number | null;
2381
2539
  /** Currency code the `price` / `compareAtPrice` are expressed in. */
2382
2540
  currency: string;
2383
2541
  imageUrl: string | null;
2384
- /** Cached stock quantity of the recommended product. */
2385
- stockCached: number;
2386
- /** Convenience flag: `stockCached > 0`. */
2542
+ /** Selected-warehouse quantity; null when the merchant hides exact stock. */
2543
+ stockCached: number | null;
2544
+ /** Availability follows the shop's stock mode and published variants. */
2387
2545
  inStock: boolean;
2388
2546
  /** Merchant-editable note ("proč se to hodí") resolved for the requested
2389
2547
  * locale (falls back to the eshop default language). `null` when unset. */
@@ -2657,6 +2815,8 @@ interface SubmitQuoteInput {
2657
2815
  }
2658
2816
  /** One URL for the sitemap. Added in SDK 1.4.0. */
2659
2817
  interface SitemapEntry {
2818
+ /** Actual translated slugs in enabled languages. Never reuse one locale slug for all URLs. */
2819
+ localizedSlugs?: Record<string, string>;
2660
2820
  /** Slug without any prefix; the template builds the path. */
2661
2821
  slug: string;
2662
2822
  /** Last change (epoch ms) for `lastmod`. */
@@ -2845,6 +3005,10 @@ declare class BehioStorefront {
2845
3005
  setCurrency(currency: string | undefined): void;
2846
3006
  /** Get the current default currency, if any. */
2847
3007
  getCurrency(): string | undefined;
3008
+ private defaultCountry?;
3009
+ /** Set the catalog's delivery country. Use cart.setDestination separately for the cart. */
3010
+ setCountry(country: string | undefined): void;
3011
+ getCountry(): string | undefined;
2848
3012
  /** Set the default locale sent on every catalog request (per-call wins). */
2849
3013
  setLocale(locale: string | undefined): void;
2850
3014
  /** Get the current default locale, if any. */
@@ -2933,6 +3097,7 @@ declare class CatalogModule {
2933
3097
  getFeatured(options?: {
2934
3098
  locale?: string;
2935
3099
  currency?: string;
3100
+ country?: string;
2936
3101
  }): Promise<SdkResult<PaginatedResponse<ProductListItem>>>;
2937
3102
  /**
2938
3103
  * Available filters for a dynamic filter UI.
@@ -2980,11 +3145,11 @@ declare class CatalogModule {
2980
3145
  limit?: number;
2981
3146
  }): Promise<SdkResult<PaginatedResponse<ProductListItem>>>;
2982
3147
  /** List all active bundles */
2983
- getBundles(): Promise<SdkResult<{
3148
+ getBundles(options?: BundleCatalogQuery): Promise<SdkResult<{
2984
3149
  items: Bundle[];
2985
3150
  }>>;
2986
3151
  /** Get a single bundle by slug */
2987
- getBundle(slug: string): Promise<SdkResult<Bundle>>;
3152
+ getBundle(slug: string, options?: BundleCatalogQuery): Promise<SdkResult<Bundle>>;
2988
3153
  /**
2989
3154
  * One product group ("collection") by slug with its products as standard
2990
3155
  * list items. Groups are curated in the admin; use this to render curated
@@ -2994,6 +3159,7 @@ declare class CatalogModule {
2994
3159
  getProductGroup(slug: string, options?: {
2995
3160
  locale?: string;
2996
3161
  currency?: string;
3162
+ country?: string;
2997
3163
  }): Promise<SdkResult<ProductGroup>>;
2998
3164
  /**
2999
3165
  * Cross-sell / related / upsell products for a product. Returns three
@@ -3005,6 +3171,7 @@ declare class CatalogModule {
3005
3171
  getCrossSell(productSlug: string, options?: {
3006
3172
  locale?: string;
3007
3173
  currency?: string;
3174
+ country?: string;
3008
3175
  }): Promise<SdkResult<{
3009
3176
  related: CrossSellItem[];
3010
3177
  upsell: CrossSellItem[];
@@ -3140,10 +3307,10 @@ declare class CartModule {
3140
3307
  } | {
3141
3308
  slug: string;
3142
3309
  }, quantity?: number): Promise<SdkResult<Cart>>;
3143
- /** Update quantity of a bundle already in the cart */
3144
- updateBundleQuantity(bundleId: string, quantity: number): Promise<SdkResult<Cart>>;
3145
- /** Remove a bundle from the cart */
3146
- removeBundle(bundleId: string): Promise<SdkResult<Cart>>;
3310
+ /** Update by CartBundleLine.id; legacy catalog bundle IDs are accepted by the API */
3311
+ updateBundleQuantity(lineId: string, quantity: number): Promise<SdkResult<Cart>>;
3312
+ /** Remove by CartBundleLine.id; scoped to the current visitor cart */
3313
+ removeBundle(lineId: string): Promise<SdkResult<Cart>>;
3147
3314
  /** Merge anonymous cart into authenticated customer cart */
3148
3315
  merge(): Promise<SdkResult<Cart>>;
3149
3316
  /** Apply discount code */
@@ -3154,8 +3321,12 @@ declare class CartModule {
3154
3321
  declare class CheckoutModule {
3155
3322
  private client;
3156
3323
  constructor(client: BehioStorefront);
3324
+ /** Recalculate the current cart including shipping, fees, benefits and rounding.
3325
+ * No order, stock claim, payment or gift-card redemption is created. Required
3326
+ * legal consents are enforced only on createOrder, not while quoting. */
3327
+ preview(input: CheckoutInput): Promise<SdkResult<CheckoutPreview>>;
3157
3328
  /** Create order from cart */
3158
- createOrder(input: CheckoutInput): Promise<SdkResult<OrderDetail>>;
3329
+ createOrder(input: CheckoutInput): Promise<SdkResult<CheckoutResult>>;
3159
3330
  }
3160
3331
  declare class OrdersModule {
3161
3332
  private client;
@@ -3577,6 +3748,8 @@ declare class NewsletterModule {
3577
3748
  interface BehioContextValue {
3578
3749
  client: BehioStorefront;
3579
3750
  storage: StorageAdapter;
3751
+ /** Browser storage has been restored; server-rendered query data is usable before this. */
3752
+ sessionRestored: boolean;
3580
3753
  /**
3581
3754
  * The shopper's actively selected currency, or undefined when none has been
3582
3755
  * chosen (the shop's default currency is used server-side). This is sent on
@@ -4347,10 +4520,19 @@ declare function useOrderAccess(): {
4347
4520
  };
4348
4521
 
4349
4522
  declare function useCheckout(): {
4350
- createOrder: (input: CheckoutInput) => Promise<OrderDetail>;
4523
+ createOrder: (input: CheckoutInput) => Promise<CheckoutResult>;
4351
4524
  isCreating: boolean;
4352
4525
  error: Error | null;
4353
- order: OrderDetail | null;
4526
+ order: CheckoutResult | null;
4527
+ reset: () => void;
4528
+ };
4529
+ /** A preview is transient, never cached by cart ID or reused after input edits.
4530
+ * On expiry/change request another preview and ask the shopper to review it. */
4531
+ declare function useCheckoutPreview(): {
4532
+ preview: _tanstack_react_query.UseMutateAsyncFunction<CheckoutPreview, Error, CheckoutInput, unknown>;
4533
+ data: CheckoutPreview | undefined;
4534
+ isPreviewing: boolean;
4535
+ error: Error | null;
4354
4536
  reset: () => void;
4355
4537
  };
4356
4538
 
@@ -4419,6 +4601,7 @@ declare function useShopInfo(options?: UseShopInfoOptions): _tanstack_react_quer
4419
4601
 
4420
4602
  interface UseShopScriptsOptions {
4421
4603
  enabled?: boolean;
4604
+ initialData?: ShopScripts;
4422
4605
  }
4423
4606
  /**
4424
4607
  * Fetch the merchant-defined storefront scripts (analytics, pixels, custom
@@ -4518,6 +4701,8 @@ interface CurrencySwitcherProps {
4518
4701
  declare function CurrencySwitcher({ className, labels, showWhenSingle, ariaLabel, children, }: CurrencySwitcherProps): react_jsx_runtime.JSX.Element | null;
4519
4702
 
4520
4703
  interface StorefrontScriptsProps {
4704
+ /** Server-loaded settings: avoids fetching our own database after hydration. */
4705
+ initialScripts?: ShopScript[];
4521
4706
  /** Override the visitor id; defaults to the `behio_visitor_id` localStorage value. */
4522
4707
  visitorId?: string;
4523
4708
  }
@@ -4528,7 +4713,7 @@ interface StorefrontScriptsProps {
4528
4713
  * analytics cookie consent; the rest are injected on mount. Mount once in the
4529
4714
  * root layout, inside the BehioProvider.
4530
4715
  */
4531
- declare function StorefrontScripts({ visitorId: visitorIdProp }?: StorefrontScriptsProps): null;
4716
+ declare function StorefrontScripts({ visitorId: visitorIdProp, initialScripts }?: StorefrontScriptsProps): null;
4532
4717
 
4533
4718
  /**
4534
4719
  * Behio Analytics auto-tracker. Mount ONCE in the root layout (next to
@@ -4552,7 +4737,7 @@ declare function StorefrontScripts({ visitorId: visitorIdProp }?: StorefrontScri
4552
4737
  declare function BehioAnalyticsTracker(): null;
4553
4738
 
4554
4739
  /** List all active bundles. */
4555
- declare function useBundles(options?: {
4740
+ declare function useBundles(options?: BundleCatalogQuery & {
4556
4741
  enabled?: boolean;
4557
4742
  initialData?: {
4558
4743
  items: Bundle[];
@@ -4561,7 +4746,7 @@ declare function useBundles(options?: {
4561
4746
  items: Bundle[];
4562
4747
  }>, Error>;
4563
4748
  /** Get a single bundle by slug. */
4564
- declare function useBundle(slug: string | undefined, options?: {
4749
+ declare function useBundle(slug: string | undefined, options?: BundleCatalogQuery & {
4565
4750
  enabled?: boolean;
4566
4751
  initialData?: Bundle;
4567
4752
  }): _tanstack_react_query.UseQueryResult<NoInfer<Bundle>, Error>;
@@ -4867,6 +5052,7 @@ declare function useProductReviews(productId: string | undefined, options?: {
4867
5052
  page?: number;
4868
5053
  limit?: number;
4869
5054
  enabled?: boolean;
5055
+ initialData?: ProductReviewsResponse;
4870
5056
  }): _tanstack_react_query.UseQueryResult<NoInfer<ProductReviewsResponse>, Error>;
4871
5057
  declare function useSubmitReview(): _tanstack_react_query.UseMutationResult<{
4872
5058
  id: string;
@@ -5093,7 +5279,7 @@ declare function useBehioClient(): BehioStorefront;
5093
5279
  * @param locale - BCP 47 locale string (e.g. "cs", "en", "de"). Defaults to "cs".
5094
5280
  * @returns Formatted price string (e.g. "1 499 Kč", "24,99 €")
5095
5281
  */
5096
- declare function formatPrice(amount: number, currency: string, locale?: string): string;
5282
+ declare function formatPrice(amount: number, currency: string, locale?: string, display?: "SYMBOL_BEFORE" | "SYMBOL_AFTER" | "CODE"): string;
5097
5283
 
5098
5284
  /**
5099
5285
  * GA4 e-commerce event helper.
@@ -5208,4 +5394,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
5208
5394
  success: boolean;
5209
5395
  }>>;
5210
5396
 
5211
- export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };
5397
+ export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useVisitorMessages, useWishlist };