@behio/storefront-sdk 1.18.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.mts 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
  }
@@ -1183,6 +1267,18 @@ interface RegisterInput {
1183
1267
  password: string;
1184
1268
  firstName?: string;
1185
1269
  lastName?: string;
1270
+ /** B2B sign-up: company name. */
1271
+ company?: string;
1272
+ /** Company registration number. */
1273
+ companyId?: string;
1274
+ /**
1275
+ * VAT ID. EU numbers are verified in VIES on the server; a confirmed one
1276
+ * creates a default billing address and can auto-join the merchant's
1277
+ * "EU companies" customer group.
1278
+ */
1279
+ vatId?: string;
1280
+ /** ISO-2 country of the company (VIES fallback when `vatId` has no prefix). */
1281
+ country?: string;
1186
1282
  }
1187
1283
  interface LoginInput {
1188
1284
  email: string;
@@ -1209,7 +1305,7 @@ interface CartItemProduct {
1209
1305
  sku: string;
1210
1306
  imageUrl?: string;
1211
1307
  inStock: boolean;
1212
- currentPrice: number;
1308
+ currentPrice: number | null;
1213
1309
  /** Minimum order quantity (units); null = no minimum. Clamp the cart
1214
1310
  * stepper's lower bound to this (GAP-48). */
1215
1311
  minOrderQuantity?: number | null;
@@ -1219,6 +1315,14 @@ interface CartItemProduct {
1219
1315
  }
1220
1316
  interface CartItem {
1221
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
+ };
1222
1326
  /**
1223
1327
  * Eshop product ID of the sellable unit on this line. A variant is its own
1224
1328
  * product, so this is the exact product/variant the customer added — use it
@@ -1227,19 +1331,19 @@ interface CartItem {
1227
1331
  productId: string;
1228
1332
  product: CartItemProduct;
1229
1333
  quantity: number;
1230
- unitPrice: number;
1231
- totalPrice: number;
1334
+ unitPrice: number | null;
1335
+ totalPrice: number | null;
1232
1336
  priceChanged: boolean;
1233
1337
  volumePriceApplied: boolean;
1234
1338
  /** VAT rate for this line in percent (e.g. 21). Estimated from the shop /
1235
1339
  * product rate; refined by the shipping country at checkout (GAP-30). */
1236
1340
  taxRate: number;
1237
1341
  /** Net amount for this line (without VAT) = totalPrice. */
1238
- netAmount: number;
1342
+ netAmount: number | null;
1239
1343
  /** VAT amount for this line at `taxRate`. */
1240
- taxAmount: number;
1344
+ taxAmount: number | null;
1241
1345
  /** Gross amount for this line (net + VAT). */
1242
- grossAmount: number;
1346
+ grossAmount: number | null;
1243
1347
  }
1244
1348
  /** One VAT rate's slice of a cart or order (GAP-30). Render "DPH {rate} %:
1245
1349
  * {taxAmount}" summary rows from these. `netAmount + taxAmount = grossAmount`. */
@@ -1268,6 +1372,19 @@ interface CartPromotion {
1268
1372
  discountAmount: number;
1269
1373
  }
1270
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
+ };
1271
1388
  id: string;
1272
1389
  sessionToken?: string;
1273
1390
  items: CartItem[];
@@ -1337,8 +1454,20 @@ interface CartBundleLine {
1337
1454
  bundleSlug: string;
1338
1455
  bundleName: string;
1339
1456
  quantity: number;
1340
- /** Snapshot of the bundle's per-unit price when it was added. */
1341
- 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;
1342
1471
  currency: string;
1343
1472
  items: CartBundleLineItem[];
1344
1473
  }
@@ -1376,13 +1505,15 @@ interface CheckoutAddress {
1376
1505
  phone?: string;
1377
1506
  }
1378
1507
  interface CheckoutInput {
1508
+ /** Five-minute token from checkout.preview; stale prices or choices fail closed. */
1509
+ previewToken?: string;
1379
1510
  /**
1380
1511
  * Consent-gated Behio Analytics visitor id (behio_visitor_id). Optional;
1381
1512
  * lets the backend attribute the order to the visitor journey. Send it only
1382
1513
  * when the visitor granted analytics consent.
1383
1514
  */
1384
1515
  analyticsVisitorId?: string;
1385
- shippingAddress: CheckoutAddress;
1516
+ shippingAddress?: CheckoutAddress;
1386
1517
  billingAddress: CheckoutAddress;
1387
1518
  email: string;
1388
1519
  phone?: string;
@@ -1506,6 +1637,10 @@ interface OrderStatusHistory {
1506
1637
  createdAt: number;
1507
1638
  }
1508
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;
1509
1644
  items: OrderItem[];
1510
1645
  shippingAddress: CheckoutAddress;
1511
1646
  billingAddress: CheckoutAddress;
@@ -1520,6 +1655,10 @@ interface OrderDetail extends OrderListItem {
1520
1655
  /** DOMESTIC, OSS, REVERSE_CHARGE (no VAT, buyer accounts for it) or EXPORT (no VAT, outside EU). SDK 1.17.0. */
1521
1656
  vatMode?: "DOMESTIC" | "OSS" | "REVERSE_CHARGE" | "EXPORT" | null;
1522
1657
  shippingTotal: number;
1658
+ paymentFee?: number | null;
1659
+ roundingAdjustment?: number | null;
1660
+ loyaltyDiscount?: number | null;
1661
+ giftCardDeducted?: number | null;
1523
1662
  discountTotal: number;
1524
1663
  fulfillmentStatus: FulfillmentStatus;
1525
1664
  statusHistory: OrderStatusHistory[];
@@ -1558,6 +1697,8 @@ interface OrderAccessVerifyResponse {
1558
1697
  * (null = unlimited), optional `expiresAt`.
1559
1698
  */
1560
1699
  interface DigitalDownload {
1700
+ /** Asset disabled or order no longer grants access. */
1701
+ isRevoked?: boolean;
1561
1702
  id: string;
1562
1703
  /** Order this grant originates from (null for legacy/manual grants). */
1563
1704
  orderId: string | null;
@@ -1601,6 +1742,8 @@ interface CourseListItem {
1601
1742
  /** Access expiry (epoch ms, null = never expires). */
1602
1743
  expiresAt: number | null;
1603
1744
  isExpired: boolean;
1745
+ /** Access was withdrawn; another paid, unexpired purchase keeps access active. */
1746
+ isRevoked?: boolean;
1604
1747
  /**
1605
1748
  * Course content opens at this time (epoch ms); null/undefined = already
1606
1749
  * open. While in the future, render "Startujeme ..." + countdown.
@@ -2137,6 +2280,11 @@ interface ProductGroup {
2137
2280
  description: string | null;
2138
2281
  items: ProductListItem[];
2139
2282
  }
2283
+ interface BundleCatalogQuery {
2284
+ locale?: string;
2285
+ currency?: string;
2286
+ country?: string;
2287
+ }
2140
2288
  interface BundleItem {
2141
2289
  productId: string;
2142
2290
  slug: string | null;
@@ -2151,17 +2299,30 @@ interface Bundle {
2151
2299
  slug: string;
2152
2300
  name: string;
2153
2301
  description: string | null;
2154
- /** `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. */
2155
2303
  bundlePrice: number | null;
2304
+ /** Requested currency. Only explicitly active bundle prices are purchasable. */
2156
2305
  currency: string;
2306
+ priceHidden: boolean;
2307
+ isPurchasable: boolean;
2308
+ unavailableReason: "PRICE_HIDDEN" | "CURRENCY_UNAVAILABLE" | "QUANTITY_UNAVAILABLE" | "ITEM_UNAVAILABLE" | null;
2309
+ activeCurrencies: string[];
2157
2310
  coverImage: string | null;
2158
2311
  endsAt: number | null;
2159
- /** `null` when prices are hidden (see `bundlePrice`). */
2312
+ /** `null` when any component has no comparable price in the requested currency, or prices are hidden. */
2160
2313
  itemsSum: number | null;
2161
- /** 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. */
2162
2315
  savings: number | null;
2163
- /** 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. */
2164
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;
2165
2326
  /** Minimum bundles per order. Default 1. */
2166
2327
  minQuantity: number;
2167
2328
  /** Maximum bundles per order. `null` = uncapped. */
@@ -2221,6 +2382,12 @@ interface ShippingQuoteInput {
2221
2382
  quantity: number;
2222
2383
  weightKg?: number;
2223
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
+ */
2224
2391
  cartTotal?: number;
2225
2392
  currency?: string;
2226
2393
  }
@@ -2364,14 +2531,17 @@ interface CrossSellItem {
2364
2531
  /** Price in the requested currency (or eshop default), including any price
2365
2532
  * list override for the authenticated customer. `null` when hidden (B2B). */
2366
2533
  price: number | null;
2534
+ /** Render priceFrom with an "from" label for a variant-only family. */
2535
+ variantsOnly?: boolean;
2536
+ priceFrom?: ProductPrice | null;
2367
2537
  /** Original (crossed-out) price in the same currency, when on sale. */
2368
2538
  compareAtPrice: number | null;
2369
2539
  /** Currency code the `price` / `compareAtPrice` are expressed in. */
2370
2540
  currency: string;
2371
2541
  imageUrl: string | null;
2372
- /** Cached stock quantity of the recommended product. */
2373
- stockCached: number;
2374
- /** 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. */
2375
2545
  inStock: boolean;
2376
2546
  /** Merchant-editable note ("proč se to hodí") resolved for the requested
2377
2547
  * locale (falls back to the eshop default language). `null` when unset. */
@@ -2645,6 +2815,8 @@ interface SubmitQuoteInput {
2645
2815
  }
2646
2816
  /** One URL for the sitemap. Added in SDK 1.4.0. */
2647
2817
  interface SitemapEntry {
2818
+ /** Actual translated slugs in enabled languages. Never reuse one locale slug for all URLs. */
2819
+ localizedSlugs?: Record<string, string>;
2648
2820
  /** Slug without any prefix; the template builds the path. */
2649
2821
  slug: string;
2650
2822
  /** Last change (epoch ms) for `lastmod`. */
@@ -2833,6 +3005,10 @@ declare class BehioStorefront {
2833
3005
  setCurrency(currency: string | undefined): void;
2834
3006
  /** Get the current default currency, if any. */
2835
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;
2836
3012
  /** Set the default locale sent on every catalog request (per-call wins). */
2837
3013
  setLocale(locale: string | undefined): void;
2838
3014
  /** Get the current default locale, if any. */
@@ -2921,6 +3097,7 @@ declare class CatalogModule {
2921
3097
  getFeatured(options?: {
2922
3098
  locale?: string;
2923
3099
  currency?: string;
3100
+ country?: string;
2924
3101
  }): Promise<SdkResult<PaginatedResponse<ProductListItem>>>;
2925
3102
  /**
2926
3103
  * Available filters for a dynamic filter UI.
@@ -2968,11 +3145,11 @@ declare class CatalogModule {
2968
3145
  limit?: number;
2969
3146
  }): Promise<SdkResult<PaginatedResponse<ProductListItem>>>;
2970
3147
  /** List all active bundles */
2971
- getBundles(): Promise<SdkResult<{
3148
+ getBundles(options?: BundleCatalogQuery): Promise<SdkResult<{
2972
3149
  items: Bundle[];
2973
3150
  }>>;
2974
3151
  /** Get a single bundle by slug */
2975
- getBundle(slug: string): Promise<SdkResult<Bundle>>;
3152
+ getBundle(slug: string, options?: BundleCatalogQuery): Promise<SdkResult<Bundle>>;
2976
3153
  /**
2977
3154
  * One product group ("collection") by slug with its products as standard
2978
3155
  * list items. Groups are curated in the admin; use this to render curated
@@ -2982,6 +3159,7 @@ declare class CatalogModule {
2982
3159
  getProductGroup(slug: string, options?: {
2983
3160
  locale?: string;
2984
3161
  currency?: string;
3162
+ country?: string;
2985
3163
  }): Promise<SdkResult<ProductGroup>>;
2986
3164
  /**
2987
3165
  * Cross-sell / related / upsell products for a product. Returns three
@@ -2993,6 +3171,7 @@ declare class CatalogModule {
2993
3171
  getCrossSell(productSlug: string, options?: {
2994
3172
  locale?: string;
2995
3173
  currency?: string;
3174
+ country?: string;
2996
3175
  }): Promise<SdkResult<{
2997
3176
  related: CrossSellItem[];
2998
3177
  upsell: CrossSellItem[];
@@ -3128,10 +3307,10 @@ declare class CartModule {
3128
3307
  } | {
3129
3308
  slug: string;
3130
3309
  }, quantity?: number): Promise<SdkResult<Cart>>;
3131
- /** Update quantity of a bundle already in the cart */
3132
- updateBundleQuantity(bundleId: string, quantity: number): Promise<SdkResult<Cart>>;
3133
- /** Remove a bundle from the cart */
3134
- 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>>;
3135
3314
  /** Merge anonymous cart into authenticated customer cart */
3136
3315
  merge(): Promise<SdkResult<Cart>>;
3137
3316
  /** Apply discount code */
@@ -3142,8 +3321,12 @@ declare class CartModule {
3142
3321
  declare class CheckoutModule {
3143
3322
  private client;
3144
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>>;
3145
3328
  /** Create order from cart */
3146
- createOrder(input: CheckoutInput): Promise<SdkResult<OrderDetail>>;
3329
+ createOrder(input: CheckoutInput): Promise<SdkResult<CheckoutResult>>;
3147
3330
  }
3148
3331
  declare class OrdersModule {
3149
3332
  private client;
@@ -3565,6 +3748,8 @@ declare class NewsletterModule {
3565
3748
  interface BehioContextValue {
3566
3749
  client: BehioStorefront;
3567
3750
  storage: StorageAdapter;
3751
+ /** Browser storage has been restored; server-rendered query data is usable before this. */
3752
+ sessionRestored: boolean;
3568
3753
  /**
3569
3754
  * The shopper's actively selected currency, or undefined when none has been
3570
3755
  * chosen (the shop's default currency is used server-side). This is sent on
@@ -4335,10 +4520,19 @@ declare function useOrderAccess(): {
4335
4520
  };
4336
4521
 
4337
4522
  declare function useCheckout(): {
4338
- createOrder: (input: CheckoutInput) => Promise<OrderDetail>;
4523
+ createOrder: (input: CheckoutInput) => Promise<CheckoutResult>;
4339
4524
  isCreating: boolean;
4340
4525
  error: Error | null;
4341
- 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;
4342
4536
  reset: () => void;
4343
4537
  };
4344
4538
 
@@ -4407,6 +4601,7 @@ declare function useShopInfo(options?: UseShopInfoOptions): _tanstack_react_quer
4407
4601
 
4408
4602
  interface UseShopScriptsOptions {
4409
4603
  enabled?: boolean;
4604
+ initialData?: ShopScripts;
4410
4605
  }
4411
4606
  /**
4412
4607
  * Fetch the merchant-defined storefront scripts (analytics, pixels, custom
@@ -4506,6 +4701,8 @@ interface CurrencySwitcherProps {
4506
4701
  declare function CurrencySwitcher({ className, labels, showWhenSingle, ariaLabel, children, }: CurrencySwitcherProps): react_jsx_runtime.JSX.Element | null;
4507
4702
 
4508
4703
  interface StorefrontScriptsProps {
4704
+ /** Server-loaded settings: avoids fetching our own database after hydration. */
4705
+ initialScripts?: ShopScript[];
4509
4706
  /** Override the visitor id; defaults to the `behio_visitor_id` localStorage value. */
4510
4707
  visitorId?: string;
4511
4708
  }
@@ -4516,7 +4713,7 @@ interface StorefrontScriptsProps {
4516
4713
  * analytics cookie consent; the rest are injected on mount. Mount once in the
4517
4714
  * root layout, inside the BehioProvider.
4518
4715
  */
4519
- declare function StorefrontScripts({ visitorId: visitorIdProp }?: StorefrontScriptsProps): null;
4716
+ declare function StorefrontScripts({ visitorId: visitorIdProp, initialScripts }?: StorefrontScriptsProps): null;
4520
4717
 
4521
4718
  /**
4522
4719
  * Behio Analytics auto-tracker. Mount ONCE in the root layout (next to
@@ -4540,7 +4737,7 @@ declare function StorefrontScripts({ visitorId: visitorIdProp }?: StorefrontScri
4540
4737
  declare function BehioAnalyticsTracker(): null;
4541
4738
 
4542
4739
  /** List all active bundles. */
4543
- declare function useBundles(options?: {
4740
+ declare function useBundles(options?: BundleCatalogQuery & {
4544
4741
  enabled?: boolean;
4545
4742
  initialData?: {
4546
4743
  items: Bundle[];
@@ -4549,7 +4746,7 @@ declare function useBundles(options?: {
4549
4746
  items: Bundle[];
4550
4747
  }>, Error>;
4551
4748
  /** Get a single bundle by slug. */
4552
- declare function useBundle(slug: string | undefined, options?: {
4749
+ declare function useBundle(slug: string | undefined, options?: BundleCatalogQuery & {
4553
4750
  enabled?: boolean;
4554
4751
  initialData?: Bundle;
4555
4752
  }): _tanstack_react_query.UseQueryResult<NoInfer<Bundle>, Error>;
@@ -4855,6 +5052,7 @@ declare function useProductReviews(productId: string | undefined, options?: {
4855
5052
  page?: number;
4856
5053
  limit?: number;
4857
5054
  enabled?: boolean;
5055
+ initialData?: ProductReviewsResponse;
4858
5056
  }): _tanstack_react_query.UseQueryResult<NoInfer<ProductReviewsResponse>, Error>;
4859
5057
  declare function useSubmitReview(): _tanstack_react_query.UseMutationResult<{
4860
5058
  id: string;
@@ -5081,7 +5279,7 @@ declare function useBehioClient(): BehioStorefront;
5081
5279
  * @param locale - BCP 47 locale string (e.g. "cs", "en", "de"). Defaults to "cs".
5082
5280
  * @returns Formatted price string (e.g. "1 499 Kč", "24,99 €")
5083
5281
  */
5084
- 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;
5085
5283
 
5086
5284
  /**
5087
5285
  * GA4 e-commerce event helper.
@@ -5196,4 +5394,4 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
5196
5394
  success: boolean;
5197
5395
  }>>;
5198
5396
 
5199
- 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 };