@behio/storefront-sdk 2.12.0 → 2.14.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/{client-D1nNDDVw.d.mts → client-DB_ve5Fp.d.mts} +122 -23
- package/dist/{client-D1nNDDVw.d.ts → client-DB_ve5Fp.d.ts} +122 -23
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/react.d.mts +121 -22
- package/dist/react.d.ts +121 -22
- package/package.json +1 -1
package/dist/react.d.mts
CHANGED
|
@@ -538,6 +538,8 @@ interface ProductVariant {
|
|
|
538
538
|
stockQuantity?: number | null;
|
|
539
539
|
/** "Only X left" for this variant — same contract as ProductListItem.lowStockRemaining. */
|
|
540
540
|
lowStockRemaining?: number | null;
|
|
541
|
+
/** Most pieces the cart accepts for this variant; null = uncapped or hidden stock. SDK 2.13.0. */
|
|
542
|
+
maxPurchasableQuantity?: number | null;
|
|
541
543
|
/**
|
|
542
544
|
* Cover image URL for the variant. Falls back to the parent product's
|
|
543
545
|
* cover when the variant has no photo of its own — see `imageIsInherited`.
|
|
@@ -562,7 +564,7 @@ interface ProductLabel {
|
|
|
562
564
|
id: string;
|
|
563
565
|
slug: string;
|
|
564
566
|
name: string;
|
|
565
|
-
color?: string;
|
|
567
|
+
color?: string | null;
|
|
566
568
|
/** Merchant icon name. Render a trusted local icon, with a safe fallback. */
|
|
567
569
|
iconName?: string | null;
|
|
568
570
|
}
|
|
@@ -592,9 +594,9 @@ interface ProductListItem {
|
|
|
592
594
|
id: string;
|
|
593
595
|
slug: string;
|
|
594
596
|
name: string;
|
|
595
|
-
shortDescription?: string;
|
|
597
|
+
shortDescription?: string | null;
|
|
596
598
|
sku: string;
|
|
597
|
-
gtin?: string;
|
|
599
|
+
gtin?: string | null;
|
|
598
600
|
/** `null` when prices are gated behind login for guests (B2B mode). */
|
|
599
601
|
price: ProductPrice | null;
|
|
600
602
|
inStock: boolean;
|
|
@@ -683,6 +685,9 @@ interface ProductListItem {
|
|
|
683
685
|
url: string;
|
|
684
686
|
alt: string | null;
|
|
685
687
|
order: number;
|
|
688
|
+
/** COVER | LISTING | HOVER | GALLERY when the cover came from a roled
|
|
689
|
+
* product image; absent when it came from the inventory gallery (SDK 2.14.0). */
|
|
690
|
+
role?: string;
|
|
686
691
|
} | null;
|
|
687
692
|
labels: ProductLabel[];
|
|
688
693
|
isFeatured: boolean;
|
|
@@ -893,7 +898,23 @@ interface ProductAssetGroup {
|
|
|
893
898
|
items: ProductAssetItem[];
|
|
894
899
|
}
|
|
895
900
|
interface ProductDetail extends ProductListItem {
|
|
896
|
-
|
|
901
|
+
/** Most pieces the cart accepts (stock, plus safetyStock under BACKORDER);
|
|
902
|
+
* null when uncapped or the shop hides stock counts. Cap the PDP quantity
|
|
903
|
+
* stepper with it, it is exactly the cart rule. SDK 2.13.0. */
|
|
904
|
+
maxPurchasableQuantity?: number | null;
|
|
905
|
+
/**
|
|
906
|
+
* @deprecated Not sent on the product detail, only on list cards. Use
|
|
907
|
+
* `media` (or `images`) for the gallery.
|
|
908
|
+
*/
|
|
909
|
+
image?: ProductListItem["image"];
|
|
910
|
+
/** @deprecated Not sent on the product detail, only on list cards. */
|
|
911
|
+
hoverImageUrl?: string | null;
|
|
912
|
+
/**
|
|
913
|
+
* @deprecated Not sent on the product detail, only on list cards. Read the
|
|
914
|
+
* PDP promotions with `catalog.getProductPromotions(slug)`.
|
|
915
|
+
*/
|
|
916
|
+
activePromotion?: ProductPromotionSummary | null;
|
|
917
|
+
longDescription?: string | null;
|
|
897
918
|
/**
|
|
898
919
|
* @deprecated Legacy per-listing images. Prefer `media`. Each carries its
|
|
899
920
|
* `role` (COVER | LISTING | HOVER | GALLERY) so the storefront can pick a
|
|
@@ -901,7 +922,7 @@ interface ProductDetail extends ProductListItem {
|
|
|
901
922
|
*/
|
|
902
923
|
images: Array<{
|
|
903
924
|
url: string;
|
|
904
|
-
alt?: string;
|
|
925
|
+
alt?: string | null;
|
|
905
926
|
order: number;
|
|
906
927
|
role?: string;
|
|
907
928
|
}>;
|
|
@@ -969,6 +990,10 @@ interface ProductDetail extends ProductListItem {
|
|
|
969
990
|
ogDescription?: string | null;
|
|
970
991
|
ogImage?: string | null;
|
|
971
992
|
};
|
|
993
|
+
/**
|
|
994
|
+
* @deprecated Never sent by the API. Load a group with
|
|
995
|
+
* `catalog.getProductGroup(slug)`.
|
|
996
|
+
*/
|
|
972
997
|
productGroups?: Array<{
|
|
973
998
|
slug: string;
|
|
974
999
|
name: string;
|
|
@@ -990,8 +1015,8 @@ interface Category {
|
|
|
990
1015
|
id: string;
|
|
991
1016
|
slug: string;
|
|
992
1017
|
name: string;
|
|
993
|
-
description?: string;
|
|
994
|
-
imageUrl?: string;
|
|
1018
|
+
description?: string | null;
|
|
1019
|
+
imageUrl?: string | null;
|
|
995
1020
|
children: Category[];
|
|
996
1021
|
productCount?: number;
|
|
997
1022
|
}
|
|
@@ -1054,11 +1079,18 @@ interface Menu {
|
|
|
1054
1079
|
locale: string;
|
|
1055
1080
|
items: MenuItem[];
|
|
1056
1081
|
}
|
|
1057
|
-
interface CategoryDetail extends Category {
|
|
1082
|
+
interface CategoryDetail extends Omit<Category, "children"> {
|
|
1083
|
+
/**
|
|
1084
|
+
* @deprecated Never sent on the category detail (it was typed as always
|
|
1085
|
+
* present, so `children.map` crashed). Read subcategories from
|
|
1086
|
+
* `catalog.getCategories()`.
|
|
1087
|
+
*/
|
|
1088
|
+
children?: Category[];
|
|
1058
1089
|
/**
|
|
1059
1090
|
* SEO/Open Graph for the category page. Matches the backend's nested `seo`
|
|
1060
1091
|
* shape (the old flat `seoTitle`/`seoDescription` never matched what the API
|
|
1061
|
-
* returned). `keywords` is always null for categories.
|
|
1092
|
+
* returned). `keywords` is always null for categories. Null when the
|
|
1093
|
+
* category has no text in the requested language (SDK 2.14.0 types it).
|
|
1062
1094
|
*/
|
|
1063
1095
|
seo?: {
|
|
1064
1096
|
title?: string | null;
|
|
@@ -1067,7 +1099,7 @@ interface CategoryDetail extends Category {
|
|
|
1067
1099
|
ogTitle?: string | null;
|
|
1068
1100
|
ogDescription?: string | null;
|
|
1069
1101
|
ogImage?: string | null;
|
|
1070
|
-
};
|
|
1102
|
+
} | null;
|
|
1071
1103
|
}
|
|
1072
1104
|
/**
|
|
1073
1105
|
* One available filter, derived from a curated parameter the merchant marked
|
|
@@ -1085,7 +1117,7 @@ interface FilterField {
|
|
|
1085
1117
|
groupSlug: string;
|
|
1086
1118
|
groupName: string;
|
|
1087
1119
|
unit?: string | null;
|
|
1088
|
-
values?: string[];
|
|
1120
|
+
values?: string[] | null;
|
|
1089
1121
|
}
|
|
1090
1122
|
interface FacetValue {
|
|
1091
1123
|
/** Raw stored value (normalized), for exact filtering. */
|
|
@@ -1336,8 +1368,11 @@ interface CartItemProduct {
|
|
|
1336
1368
|
* arbitrary translation row, so this could come back in another language. */
|
|
1337
1369
|
name: string;
|
|
1338
1370
|
sku: string;
|
|
1339
|
-
imageUrl?: string;
|
|
1371
|
+
imageUrl?: string | null;
|
|
1340
1372
|
inStock: boolean;
|
|
1373
|
+
/** Pieces left for an "only X left" note on the cart line; null when the
|
|
1374
|
+
* shop does not track stock, hides the nudge or has plenty. SDK 2.13.0. */
|
|
1375
|
+
lowStockRemaining?: number | null;
|
|
1341
1376
|
currentPrice: number | null;
|
|
1342
1377
|
/** Minimum order quantity (units); null = no minimum. Clamp the cart
|
|
1343
1378
|
* stepper's lower bound to this (GAP-48). */
|
|
@@ -1431,7 +1466,7 @@ interface Cart {
|
|
|
1431
1466
|
* 200 net" was 20, now it is 24.20 at 21 %). It lowers base and VAT, see
|
|
1432
1467
|
* `taxBreakdown` and `vatTotal`. */
|
|
1433
1468
|
discountTotal: number;
|
|
1434
|
-
discount?: CartDiscount;
|
|
1469
|
+
discount?: CartDiscount | null;
|
|
1435
1470
|
/** Auto-apply promotion discount lines (sale/BOGO). */
|
|
1436
1471
|
appliedPromotions: CartPromotion[];
|
|
1437
1472
|
/** Sum of `appliedPromotions[].discountAmount`; already reflected in `grandTotal`. */
|
|
@@ -1568,6 +1603,14 @@ interface CheckoutInput {
|
|
|
1568
1603
|
termsConsent?: boolean;
|
|
1569
1604
|
gdprConsent?: boolean;
|
|
1570
1605
|
newsletterOptIn?: boolean;
|
|
1606
|
+
/**
|
|
1607
|
+
* Consent to start delivering digital content (courses, downloads,
|
|
1608
|
+
* services) before the withdrawal period ends, which waives the right of
|
|
1609
|
+
* withdrawal (EU Directive 2011/83 art. 16(m)). Render the checkbox for carts
|
|
1610
|
+
* without physical goods (`cart.requiresShipping === false`). Stored on the
|
|
1611
|
+
* order consent record; it does not block the order. SDK 2.13.0.
|
|
1612
|
+
*/
|
|
1613
|
+
digitalDeliveryConsent?: boolean;
|
|
1571
1614
|
/**
|
|
1572
1615
|
* Consent to marketing SMS, from the optional checkout checkbox. Render it
|
|
1573
1616
|
* only when `ShopInfo.checkout.collectSmsConsent` is true; shops that do not
|
|
@@ -1628,6 +1671,12 @@ interface CheckoutInput {
|
|
|
1628
1671
|
* guests. See `customer.getLoyalty()` for the available balance.
|
|
1629
1672
|
*/
|
|
1630
1673
|
redeemLoyaltyPoints?: number;
|
|
1674
|
+
/**
|
|
1675
|
+
* Cart session to order. The SDK sends it in the `X-Cart-Session` header on
|
|
1676
|
+
* its own, so leave it out; the body field is for clients without the
|
|
1677
|
+
* header (SDK 2.14.0 documents it, the backend has always accepted it).
|
|
1678
|
+
*/
|
|
1679
|
+
sessionToken?: string;
|
|
1631
1680
|
}
|
|
1632
1681
|
type OrderStatus = (typeof OrderStatuses)[keyof typeof OrderStatuses];
|
|
1633
1682
|
type PaymentStatus = (typeof PaymentStatuses)[keyof typeof PaymentStatuses];
|
|
@@ -1643,6 +1692,8 @@ interface OrderListItem {
|
|
|
1643
1692
|
createdAt: number;
|
|
1644
1693
|
}
|
|
1645
1694
|
interface OrderItem {
|
|
1695
|
+
/** Order line id (SDK 2.14.0). */
|
|
1696
|
+
id?: string;
|
|
1646
1697
|
productName: string;
|
|
1647
1698
|
sku: string;
|
|
1648
1699
|
/** Photo snapshot from checkout, or the product's current photo. */
|
|
@@ -1654,9 +1705,23 @@ interface OrderItem {
|
|
|
1654
1705
|
productSlug?: string | null;
|
|
1655
1706
|
quantity: number;
|
|
1656
1707
|
unitPrice: number;
|
|
1708
|
+
/** VAT rate of the line in percent, e.g. 21 (SDK 2.14.0). */
|
|
1709
|
+
taxRate?: number;
|
|
1710
|
+
/** VAT of the whole line (SDK 2.14.0). */
|
|
1711
|
+
taxAmount?: number;
|
|
1657
1712
|
totalPrice: number;
|
|
1658
1713
|
totalPriceWithTax: number;
|
|
1659
1714
|
}
|
|
1715
|
+
/** A discount code applied to an order (SDK 2.14.0). */
|
|
1716
|
+
interface OrderDiscount {
|
|
1717
|
+
code: string;
|
|
1718
|
+
/** PERCENTAGE, FIXED_AMOUNT or FREE_SHIPPING. */
|
|
1719
|
+
type: string;
|
|
1720
|
+
/** Percent or amount as configured on the code. */
|
|
1721
|
+
value: number;
|
|
1722
|
+
/** Money the code took off this order. */
|
|
1723
|
+
appliedAmount: number;
|
|
1724
|
+
}
|
|
1660
1725
|
/**
|
|
1661
1726
|
* PII-minimized order view returned by `orders.track(token)`. The tracking
|
|
1662
1727
|
* token is shared in URLs and e-mails, so this deliberately omits full
|
|
@@ -1709,12 +1774,29 @@ interface OrderShipment {
|
|
|
1709
1774
|
createdAt: number;
|
|
1710
1775
|
}
|
|
1711
1776
|
interface OrderStatusHistory {
|
|
1712
|
-
|
|
1777
|
+
/** Null for the first entry of an order. */
|
|
1778
|
+
fromStatus?: OrderStatus | null;
|
|
1713
1779
|
toStatus: OrderStatus;
|
|
1714
|
-
note?: string;
|
|
1780
|
+
note?: string | null;
|
|
1781
|
+
/**
|
|
1782
|
+
* @deprecated Never sent: who changed the status is internal to the shop.
|
|
1783
|
+
* Kept only so existing templates keep compiling.
|
|
1784
|
+
*/
|
|
1715
1785
|
changedBy?: string;
|
|
1716
1786
|
createdAt: number;
|
|
1717
1787
|
}
|
|
1788
|
+
/** Bank transfer details of an unpaid order (SDK 2.13.0). */
|
|
1789
|
+
interface OrderPaymentInstructions {
|
|
1790
|
+
accountNumber: string | null;
|
|
1791
|
+
iban: string | null;
|
|
1792
|
+
bic: string | null;
|
|
1793
|
+
bankName: string | null;
|
|
1794
|
+
/** Digits only, at most 10 (Czech banks); from the method pattern with the order number. */
|
|
1795
|
+
variableSymbol: string | null;
|
|
1796
|
+
amount: number;
|
|
1797
|
+
currency: string;
|
|
1798
|
+
instructions: string | null;
|
|
1799
|
+
}
|
|
1718
1800
|
interface OrderDetail extends OrderListItem {
|
|
1719
1801
|
/** Payment is recorded; access delivery will retry automatically. Do not place a duplicate order. */
|
|
1720
1802
|
contentDeliveryPending?: boolean;
|
|
@@ -1724,6 +1806,10 @@ interface OrderDetail extends OrderListItem {
|
|
|
1724
1806
|
shippingMethodName?: string | null;
|
|
1725
1807
|
/** Payment method in the order language (SDK 2.8.0). */
|
|
1726
1808
|
paymentMethodName?: string | null;
|
|
1809
|
+
/** Bank transfer details while the order is unpaid; render them on the
|
|
1810
|
+
* confirmation (account, IBAN, variable symbol, amount). Null for other
|
|
1811
|
+
* methods and paid orders. SDK 2.13.0. */
|
|
1812
|
+
paymentInstructions?: OrderPaymentInstructions | null;
|
|
1727
1813
|
/** Pickup point the customer chose, a public place (SDK 2.8.0). */
|
|
1728
1814
|
pickupPoint?: OrderPickupPoint | null;
|
|
1729
1815
|
/** Parcels the customer can follow (SDK 2.8.0). */
|
|
@@ -1732,8 +1818,8 @@ interface OrderDetail extends OrderListItem {
|
|
|
1732
1818
|
shippingAddress: CheckoutAddress;
|
|
1733
1819
|
billingAddress: CheckoutAddress;
|
|
1734
1820
|
email: string;
|
|
1735
|
-
phone?: string;
|
|
1736
|
-
customerNote?: string;
|
|
1821
|
+
phone?: string | null;
|
|
1822
|
+
customerNote?: string | null;
|
|
1737
1823
|
subtotal: number;
|
|
1738
1824
|
/** Goods VAT before order discounts (goods subtotal = `subtotal` + `taxTotal`). */
|
|
1739
1825
|
taxTotal: number;
|
|
@@ -1755,6 +1841,12 @@ interface OrderDetail extends OrderListItem {
|
|
|
1755
1841
|
discountTotal: number;
|
|
1756
1842
|
fulfillmentStatus: FulfillmentStatus;
|
|
1757
1843
|
statusHistory: OrderStatusHistory[];
|
|
1844
|
+
/** Discount codes applied to the order (SDK 2.14.0). */
|
|
1845
|
+
discounts?: OrderDiscount[];
|
|
1846
|
+
/**
|
|
1847
|
+
* @deprecated Not sent on the order detail. Only `checkout.createOrder()`
|
|
1848
|
+
* returns it, see `CheckoutResult.trackingToken`.
|
|
1849
|
+
*/
|
|
1758
1850
|
trackingToken?: string;
|
|
1759
1851
|
/**
|
|
1760
1852
|
* Digital product delivery (GAP-07): download grants for any digital assets
|
|
@@ -2074,10 +2166,12 @@ interface DownloadUrl {
|
|
|
2074
2166
|
interface CustomerProfile {
|
|
2075
2167
|
id: string;
|
|
2076
2168
|
email: string;
|
|
2077
|
-
firstName?: string;
|
|
2078
|
-
lastName?: string;
|
|
2079
|
-
phone?: string;
|
|
2169
|
+
firstName?: string | null;
|
|
2170
|
+
lastName?: string | null;
|
|
2171
|
+
phone?: string | null;
|
|
2080
2172
|
emailVerified: boolean;
|
|
2173
|
+
/** Registration time (Unix ms). */
|
|
2174
|
+
createdAt?: number;
|
|
2081
2175
|
/**
|
|
2082
2176
|
* B2B approval gate (GAP-19). `false` = the account is awaiting merchant
|
|
2083
2177
|
* approval (or was deactivated) — show a "pending approval" banner and gate
|
|
@@ -2093,7 +2187,8 @@ interface CustomerAddress {
|
|
|
2093
2187
|
isDefault: boolean;
|
|
2094
2188
|
firstName: string;
|
|
2095
2189
|
lastName: string;
|
|
2096
|
-
|
|
2190
|
+
/** Null when not set. Send null on update to clear it. */
|
|
2191
|
+
company?: string | null;
|
|
2097
2192
|
street: string;
|
|
2098
2193
|
city: string;
|
|
2099
2194
|
zip: string;
|
|
@@ -2111,7 +2206,8 @@ interface CustomerAddress {
|
|
|
2111
2206
|
vatIdValid?: boolean | null;
|
|
2112
2207
|
/** When the VAT ID was last checked (ms). Read-only. */
|
|
2113
2208
|
vatIdCheckedAt?: number | null;
|
|
2114
|
-
|
|
2209
|
+
/** Null when not set. Send null on update to clear it. */
|
|
2210
|
+
phone?: string | null;
|
|
2115
2211
|
}
|
|
2116
2212
|
interface Page {
|
|
2117
2213
|
slug: string;
|
|
@@ -3166,6 +3262,7 @@ declare class BehioStorefront {
|
|
|
3166
3262
|
visitorId: string;
|
|
3167
3263
|
email: string;
|
|
3168
3264
|
}): Promise<SdkResult<{
|
|
3265
|
+
/** Single-use code for the offered product, issued by this call. */
|
|
3169
3266
|
code: string;
|
|
3170
3267
|
percent: number;
|
|
3171
3268
|
expiresAt: number;
|
|
@@ -3932,6 +4029,8 @@ interface AddressDetail {
|
|
|
3932
4029
|
formattedAddress: string;
|
|
3933
4030
|
lat: number;
|
|
3934
4031
|
lng: number;
|
|
4032
|
+
/** Set (and the address fields empty) when the request had no `placeId`. */
|
|
4033
|
+
error?: string | null;
|
|
3935
4034
|
}
|
|
3936
4035
|
declare class AddressModule {
|
|
3937
4036
|
private client;
|
package/dist/react.d.ts
CHANGED
|
@@ -538,6 +538,8 @@ interface ProductVariant {
|
|
|
538
538
|
stockQuantity?: number | null;
|
|
539
539
|
/** "Only X left" for this variant — same contract as ProductListItem.lowStockRemaining. */
|
|
540
540
|
lowStockRemaining?: number | null;
|
|
541
|
+
/** Most pieces the cart accepts for this variant; null = uncapped or hidden stock. SDK 2.13.0. */
|
|
542
|
+
maxPurchasableQuantity?: number | null;
|
|
541
543
|
/**
|
|
542
544
|
* Cover image URL for the variant. Falls back to the parent product's
|
|
543
545
|
* cover when the variant has no photo of its own — see `imageIsInherited`.
|
|
@@ -562,7 +564,7 @@ interface ProductLabel {
|
|
|
562
564
|
id: string;
|
|
563
565
|
slug: string;
|
|
564
566
|
name: string;
|
|
565
|
-
color?: string;
|
|
567
|
+
color?: string | null;
|
|
566
568
|
/** Merchant icon name. Render a trusted local icon, with a safe fallback. */
|
|
567
569
|
iconName?: string | null;
|
|
568
570
|
}
|
|
@@ -592,9 +594,9 @@ interface ProductListItem {
|
|
|
592
594
|
id: string;
|
|
593
595
|
slug: string;
|
|
594
596
|
name: string;
|
|
595
|
-
shortDescription?: string;
|
|
597
|
+
shortDescription?: string | null;
|
|
596
598
|
sku: string;
|
|
597
|
-
gtin?: string;
|
|
599
|
+
gtin?: string | null;
|
|
598
600
|
/** `null` when prices are gated behind login for guests (B2B mode). */
|
|
599
601
|
price: ProductPrice | null;
|
|
600
602
|
inStock: boolean;
|
|
@@ -683,6 +685,9 @@ interface ProductListItem {
|
|
|
683
685
|
url: string;
|
|
684
686
|
alt: string | null;
|
|
685
687
|
order: number;
|
|
688
|
+
/** COVER | LISTING | HOVER | GALLERY when the cover came from a roled
|
|
689
|
+
* product image; absent when it came from the inventory gallery (SDK 2.14.0). */
|
|
690
|
+
role?: string;
|
|
686
691
|
} | null;
|
|
687
692
|
labels: ProductLabel[];
|
|
688
693
|
isFeatured: boolean;
|
|
@@ -893,7 +898,23 @@ interface ProductAssetGroup {
|
|
|
893
898
|
items: ProductAssetItem[];
|
|
894
899
|
}
|
|
895
900
|
interface ProductDetail extends ProductListItem {
|
|
896
|
-
|
|
901
|
+
/** Most pieces the cart accepts (stock, plus safetyStock under BACKORDER);
|
|
902
|
+
* null when uncapped or the shop hides stock counts. Cap the PDP quantity
|
|
903
|
+
* stepper with it, it is exactly the cart rule. SDK 2.13.0. */
|
|
904
|
+
maxPurchasableQuantity?: number | null;
|
|
905
|
+
/**
|
|
906
|
+
* @deprecated Not sent on the product detail, only on list cards. Use
|
|
907
|
+
* `media` (or `images`) for the gallery.
|
|
908
|
+
*/
|
|
909
|
+
image?: ProductListItem["image"];
|
|
910
|
+
/** @deprecated Not sent on the product detail, only on list cards. */
|
|
911
|
+
hoverImageUrl?: string | null;
|
|
912
|
+
/**
|
|
913
|
+
* @deprecated Not sent on the product detail, only on list cards. Read the
|
|
914
|
+
* PDP promotions with `catalog.getProductPromotions(slug)`.
|
|
915
|
+
*/
|
|
916
|
+
activePromotion?: ProductPromotionSummary | null;
|
|
917
|
+
longDescription?: string | null;
|
|
897
918
|
/**
|
|
898
919
|
* @deprecated Legacy per-listing images. Prefer `media`. Each carries its
|
|
899
920
|
* `role` (COVER | LISTING | HOVER | GALLERY) so the storefront can pick a
|
|
@@ -901,7 +922,7 @@ interface ProductDetail extends ProductListItem {
|
|
|
901
922
|
*/
|
|
902
923
|
images: Array<{
|
|
903
924
|
url: string;
|
|
904
|
-
alt?: string;
|
|
925
|
+
alt?: string | null;
|
|
905
926
|
order: number;
|
|
906
927
|
role?: string;
|
|
907
928
|
}>;
|
|
@@ -969,6 +990,10 @@ interface ProductDetail extends ProductListItem {
|
|
|
969
990
|
ogDescription?: string | null;
|
|
970
991
|
ogImage?: string | null;
|
|
971
992
|
};
|
|
993
|
+
/**
|
|
994
|
+
* @deprecated Never sent by the API. Load a group with
|
|
995
|
+
* `catalog.getProductGroup(slug)`.
|
|
996
|
+
*/
|
|
972
997
|
productGroups?: Array<{
|
|
973
998
|
slug: string;
|
|
974
999
|
name: string;
|
|
@@ -990,8 +1015,8 @@ interface Category {
|
|
|
990
1015
|
id: string;
|
|
991
1016
|
slug: string;
|
|
992
1017
|
name: string;
|
|
993
|
-
description?: string;
|
|
994
|
-
imageUrl?: string;
|
|
1018
|
+
description?: string | null;
|
|
1019
|
+
imageUrl?: string | null;
|
|
995
1020
|
children: Category[];
|
|
996
1021
|
productCount?: number;
|
|
997
1022
|
}
|
|
@@ -1054,11 +1079,18 @@ interface Menu {
|
|
|
1054
1079
|
locale: string;
|
|
1055
1080
|
items: MenuItem[];
|
|
1056
1081
|
}
|
|
1057
|
-
interface CategoryDetail extends Category {
|
|
1082
|
+
interface CategoryDetail extends Omit<Category, "children"> {
|
|
1083
|
+
/**
|
|
1084
|
+
* @deprecated Never sent on the category detail (it was typed as always
|
|
1085
|
+
* present, so `children.map` crashed). Read subcategories from
|
|
1086
|
+
* `catalog.getCategories()`.
|
|
1087
|
+
*/
|
|
1088
|
+
children?: Category[];
|
|
1058
1089
|
/**
|
|
1059
1090
|
* SEO/Open Graph for the category page. Matches the backend's nested `seo`
|
|
1060
1091
|
* shape (the old flat `seoTitle`/`seoDescription` never matched what the API
|
|
1061
|
-
* returned). `keywords` is always null for categories.
|
|
1092
|
+
* returned). `keywords` is always null for categories. Null when the
|
|
1093
|
+
* category has no text in the requested language (SDK 2.14.0 types it).
|
|
1062
1094
|
*/
|
|
1063
1095
|
seo?: {
|
|
1064
1096
|
title?: string | null;
|
|
@@ -1067,7 +1099,7 @@ interface CategoryDetail extends Category {
|
|
|
1067
1099
|
ogTitle?: string | null;
|
|
1068
1100
|
ogDescription?: string | null;
|
|
1069
1101
|
ogImage?: string | null;
|
|
1070
|
-
};
|
|
1102
|
+
} | null;
|
|
1071
1103
|
}
|
|
1072
1104
|
/**
|
|
1073
1105
|
* One available filter, derived from a curated parameter the merchant marked
|
|
@@ -1085,7 +1117,7 @@ interface FilterField {
|
|
|
1085
1117
|
groupSlug: string;
|
|
1086
1118
|
groupName: string;
|
|
1087
1119
|
unit?: string | null;
|
|
1088
|
-
values?: string[];
|
|
1120
|
+
values?: string[] | null;
|
|
1089
1121
|
}
|
|
1090
1122
|
interface FacetValue {
|
|
1091
1123
|
/** Raw stored value (normalized), for exact filtering. */
|
|
@@ -1336,8 +1368,11 @@ interface CartItemProduct {
|
|
|
1336
1368
|
* arbitrary translation row, so this could come back in another language. */
|
|
1337
1369
|
name: string;
|
|
1338
1370
|
sku: string;
|
|
1339
|
-
imageUrl?: string;
|
|
1371
|
+
imageUrl?: string | null;
|
|
1340
1372
|
inStock: boolean;
|
|
1373
|
+
/** Pieces left for an "only X left" note on the cart line; null when the
|
|
1374
|
+
* shop does not track stock, hides the nudge or has plenty. SDK 2.13.0. */
|
|
1375
|
+
lowStockRemaining?: number | null;
|
|
1341
1376
|
currentPrice: number | null;
|
|
1342
1377
|
/** Minimum order quantity (units); null = no minimum. Clamp the cart
|
|
1343
1378
|
* stepper's lower bound to this (GAP-48). */
|
|
@@ -1431,7 +1466,7 @@ interface Cart {
|
|
|
1431
1466
|
* 200 net" was 20, now it is 24.20 at 21 %). It lowers base and VAT, see
|
|
1432
1467
|
* `taxBreakdown` and `vatTotal`. */
|
|
1433
1468
|
discountTotal: number;
|
|
1434
|
-
discount?: CartDiscount;
|
|
1469
|
+
discount?: CartDiscount | null;
|
|
1435
1470
|
/** Auto-apply promotion discount lines (sale/BOGO). */
|
|
1436
1471
|
appliedPromotions: CartPromotion[];
|
|
1437
1472
|
/** Sum of `appliedPromotions[].discountAmount`; already reflected in `grandTotal`. */
|
|
@@ -1568,6 +1603,14 @@ interface CheckoutInput {
|
|
|
1568
1603
|
termsConsent?: boolean;
|
|
1569
1604
|
gdprConsent?: boolean;
|
|
1570
1605
|
newsletterOptIn?: boolean;
|
|
1606
|
+
/**
|
|
1607
|
+
* Consent to start delivering digital content (courses, downloads,
|
|
1608
|
+
* services) before the withdrawal period ends, which waives the right of
|
|
1609
|
+
* withdrawal (EU Directive 2011/83 art. 16(m)). Render the checkbox for carts
|
|
1610
|
+
* without physical goods (`cart.requiresShipping === false`). Stored on the
|
|
1611
|
+
* order consent record; it does not block the order. SDK 2.13.0.
|
|
1612
|
+
*/
|
|
1613
|
+
digitalDeliveryConsent?: boolean;
|
|
1571
1614
|
/**
|
|
1572
1615
|
* Consent to marketing SMS, from the optional checkout checkbox. Render it
|
|
1573
1616
|
* only when `ShopInfo.checkout.collectSmsConsent` is true; shops that do not
|
|
@@ -1628,6 +1671,12 @@ interface CheckoutInput {
|
|
|
1628
1671
|
* guests. See `customer.getLoyalty()` for the available balance.
|
|
1629
1672
|
*/
|
|
1630
1673
|
redeemLoyaltyPoints?: number;
|
|
1674
|
+
/**
|
|
1675
|
+
* Cart session to order. The SDK sends it in the `X-Cart-Session` header on
|
|
1676
|
+
* its own, so leave it out; the body field is for clients without the
|
|
1677
|
+
* header (SDK 2.14.0 documents it, the backend has always accepted it).
|
|
1678
|
+
*/
|
|
1679
|
+
sessionToken?: string;
|
|
1631
1680
|
}
|
|
1632
1681
|
type OrderStatus = (typeof OrderStatuses)[keyof typeof OrderStatuses];
|
|
1633
1682
|
type PaymentStatus = (typeof PaymentStatuses)[keyof typeof PaymentStatuses];
|
|
@@ -1643,6 +1692,8 @@ interface OrderListItem {
|
|
|
1643
1692
|
createdAt: number;
|
|
1644
1693
|
}
|
|
1645
1694
|
interface OrderItem {
|
|
1695
|
+
/** Order line id (SDK 2.14.0). */
|
|
1696
|
+
id?: string;
|
|
1646
1697
|
productName: string;
|
|
1647
1698
|
sku: string;
|
|
1648
1699
|
/** Photo snapshot from checkout, or the product's current photo. */
|
|
@@ -1654,9 +1705,23 @@ interface OrderItem {
|
|
|
1654
1705
|
productSlug?: string | null;
|
|
1655
1706
|
quantity: number;
|
|
1656
1707
|
unitPrice: number;
|
|
1708
|
+
/** VAT rate of the line in percent, e.g. 21 (SDK 2.14.0). */
|
|
1709
|
+
taxRate?: number;
|
|
1710
|
+
/** VAT of the whole line (SDK 2.14.0). */
|
|
1711
|
+
taxAmount?: number;
|
|
1657
1712
|
totalPrice: number;
|
|
1658
1713
|
totalPriceWithTax: number;
|
|
1659
1714
|
}
|
|
1715
|
+
/** A discount code applied to an order (SDK 2.14.0). */
|
|
1716
|
+
interface OrderDiscount {
|
|
1717
|
+
code: string;
|
|
1718
|
+
/** PERCENTAGE, FIXED_AMOUNT or FREE_SHIPPING. */
|
|
1719
|
+
type: string;
|
|
1720
|
+
/** Percent or amount as configured on the code. */
|
|
1721
|
+
value: number;
|
|
1722
|
+
/** Money the code took off this order. */
|
|
1723
|
+
appliedAmount: number;
|
|
1724
|
+
}
|
|
1660
1725
|
/**
|
|
1661
1726
|
* PII-minimized order view returned by `orders.track(token)`. The tracking
|
|
1662
1727
|
* token is shared in URLs and e-mails, so this deliberately omits full
|
|
@@ -1709,12 +1774,29 @@ interface OrderShipment {
|
|
|
1709
1774
|
createdAt: number;
|
|
1710
1775
|
}
|
|
1711
1776
|
interface OrderStatusHistory {
|
|
1712
|
-
|
|
1777
|
+
/** Null for the first entry of an order. */
|
|
1778
|
+
fromStatus?: OrderStatus | null;
|
|
1713
1779
|
toStatus: OrderStatus;
|
|
1714
|
-
note?: string;
|
|
1780
|
+
note?: string | null;
|
|
1781
|
+
/**
|
|
1782
|
+
* @deprecated Never sent: who changed the status is internal to the shop.
|
|
1783
|
+
* Kept only so existing templates keep compiling.
|
|
1784
|
+
*/
|
|
1715
1785
|
changedBy?: string;
|
|
1716
1786
|
createdAt: number;
|
|
1717
1787
|
}
|
|
1788
|
+
/** Bank transfer details of an unpaid order (SDK 2.13.0). */
|
|
1789
|
+
interface OrderPaymentInstructions {
|
|
1790
|
+
accountNumber: string | null;
|
|
1791
|
+
iban: string | null;
|
|
1792
|
+
bic: string | null;
|
|
1793
|
+
bankName: string | null;
|
|
1794
|
+
/** Digits only, at most 10 (Czech banks); from the method pattern with the order number. */
|
|
1795
|
+
variableSymbol: string | null;
|
|
1796
|
+
amount: number;
|
|
1797
|
+
currency: string;
|
|
1798
|
+
instructions: string | null;
|
|
1799
|
+
}
|
|
1718
1800
|
interface OrderDetail extends OrderListItem {
|
|
1719
1801
|
/** Payment is recorded; access delivery will retry automatically. Do not place a duplicate order. */
|
|
1720
1802
|
contentDeliveryPending?: boolean;
|
|
@@ -1724,6 +1806,10 @@ interface OrderDetail extends OrderListItem {
|
|
|
1724
1806
|
shippingMethodName?: string | null;
|
|
1725
1807
|
/** Payment method in the order language (SDK 2.8.0). */
|
|
1726
1808
|
paymentMethodName?: string | null;
|
|
1809
|
+
/** Bank transfer details while the order is unpaid; render them on the
|
|
1810
|
+
* confirmation (account, IBAN, variable symbol, amount). Null for other
|
|
1811
|
+
* methods and paid orders. SDK 2.13.0. */
|
|
1812
|
+
paymentInstructions?: OrderPaymentInstructions | null;
|
|
1727
1813
|
/** Pickup point the customer chose, a public place (SDK 2.8.0). */
|
|
1728
1814
|
pickupPoint?: OrderPickupPoint | null;
|
|
1729
1815
|
/** Parcels the customer can follow (SDK 2.8.0). */
|
|
@@ -1732,8 +1818,8 @@ interface OrderDetail extends OrderListItem {
|
|
|
1732
1818
|
shippingAddress: CheckoutAddress;
|
|
1733
1819
|
billingAddress: CheckoutAddress;
|
|
1734
1820
|
email: string;
|
|
1735
|
-
phone?: string;
|
|
1736
|
-
customerNote?: string;
|
|
1821
|
+
phone?: string | null;
|
|
1822
|
+
customerNote?: string | null;
|
|
1737
1823
|
subtotal: number;
|
|
1738
1824
|
/** Goods VAT before order discounts (goods subtotal = `subtotal` + `taxTotal`). */
|
|
1739
1825
|
taxTotal: number;
|
|
@@ -1755,6 +1841,12 @@ interface OrderDetail extends OrderListItem {
|
|
|
1755
1841
|
discountTotal: number;
|
|
1756
1842
|
fulfillmentStatus: FulfillmentStatus;
|
|
1757
1843
|
statusHistory: OrderStatusHistory[];
|
|
1844
|
+
/** Discount codes applied to the order (SDK 2.14.0). */
|
|
1845
|
+
discounts?: OrderDiscount[];
|
|
1846
|
+
/**
|
|
1847
|
+
* @deprecated Not sent on the order detail. Only `checkout.createOrder()`
|
|
1848
|
+
* returns it, see `CheckoutResult.trackingToken`.
|
|
1849
|
+
*/
|
|
1758
1850
|
trackingToken?: string;
|
|
1759
1851
|
/**
|
|
1760
1852
|
* Digital product delivery (GAP-07): download grants for any digital assets
|
|
@@ -2074,10 +2166,12 @@ interface DownloadUrl {
|
|
|
2074
2166
|
interface CustomerProfile {
|
|
2075
2167
|
id: string;
|
|
2076
2168
|
email: string;
|
|
2077
|
-
firstName?: string;
|
|
2078
|
-
lastName?: string;
|
|
2079
|
-
phone?: string;
|
|
2169
|
+
firstName?: string | null;
|
|
2170
|
+
lastName?: string | null;
|
|
2171
|
+
phone?: string | null;
|
|
2080
2172
|
emailVerified: boolean;
|
|
2173
|
+
/** Registration time (Unix ms). */
|
|
2174
|
+
createdAt?: number;
|
|
2081
2175
|
/**
|
|
2082
2176
|
* B2B approval gate (GAP-19). `false` = the account is awaiting merchant
|
|
2083
2177
|
* approval (or was deactivated) — show a "pending approval" banner and gate
|
|
@@ -2093,7 +2187,8 @@ interface CustomerAddress {
|
|
|
2093
2187
|
isDefault: boolean;
|
|
2094
2188
|
firstName: string;
|
|
2095
2189
|
lastName: string;
|
|
2096
|
-
|
|
2190
|
+
/** Null when not set. Send null on update to clear it. */
|
|
2191
|
+
company?: string | null;
|
|
2097
2192
|
street: string;
|
|
2098
2193
|
city: string;
|
|
2099
2194
|
zip: string;
|
|
@@ -2111,7 +2206,8 @@ interface CustomerAddress {
|
|
|
2111
2206
|
vatIdValid?: boolean | null;
|
|
2112
2207
|
/** When the VAT ID was last checked (ms). Read-only. */
|
|
2113
2208
|
vatIdCheckedAt?: number | null;
|
|
2114
|
-
|
|
2209
|
+
/** Null when not set. Send null on update to clear it. */
|
|
2210
|
+
phone?: string | null;
|
|
2115
2211
|
}
|
|
2116
2212
|
interface Page {
|
|
2117
2213
|
slug: string;
|
|
@@ -3166,6 +3262,7 @@ declare class BehioStorefront {
|
|
|
3166
3262
|
visitorId: string;
|
|
3167
3263
|
email: string;
|
|
3168
3264
|
}): Promise<SdkResult<{
|
|
3265
|
+
/** Single-use code for the offered product, issued by this call. */
|
|
3169
3266
|
code: string;
|
|
3170
3267
|
percent: number;
|
|
3171
3268
|
expiresAt: number;
|
|
@@ -3932,6 +4029,8 @@ interface AddressDetail {
|
|
|
3932
4029
|
formattedAddress: string;
|
|
3933
4030
|
lat: number;
|
|
3934
4031
|
lng: number;
|
|
4032
|
+
/** Set (and the address fields empty) when the request had no `placeId`. */
|
|
4033
|
+
error?: string | null;
|
|
3935
4034
|
}
|
|
3936
4035
|
declare class AddressModule {
|
|
3937
4036
|
private client;
|