@wix/auto_sdk_ecom_current-cart-v-2 1.0.0 → 1.0.2

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.
@@ -23,11 +23,6 @@ interface Cart {
23
23
  * @readonly
24
24
  */
25
25
  revision?: string | null;
26
- /**
27
- * Custom fields.
28
- * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
29
- */
30
- extendedFields?: ExtendedFields;
31
26
  /**
32
27
  * Line items added to the Cart by the customer.
33
28
  * This list may include both valid items (in stock) and invalid ones (e.g., out of stock).
@@ -36,6 +31,14 @@ interface Cart {
36
31
  * @readonly
37
32
  */
38
33
  lineItems?: V2LineItem[];
34
+ /** The sum of all line item final prices. */
35
+ subtotal?: MultiCurrencyPrice;
36
+ /**
37
+ * Optional message left by the customer.
38
+ * Usually intended for the merchant and contain special instructions, requests, or clarifications related to the order.
39
+ * @maxLength 1000
40
+ */
41
+ note?: string | null;
39
42
  /**
40
43
  * The discounts of the Cart.
41
44
  * Automatic discounts are removed from the Cart entirely when they are no longer valid.
@@ -47,7 +50,7 @@ interface Cart {
47
50
  /** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
48
51
  source?: CartSource;
49
52
  /** Information about the site from which the Cart's line items were added. */
50
- siteInfo?: SiteInfo;
53
+ businessInfo?: BusinessInfo;
51
54
  /** Information about the customer that owns the Cart. */
52
55
  customerInfo?: CustomerInfo;
53
56
  /** Delivery-related information associated with the Cart. */
@@ -57,15 +60,24 @@ interface Cart {
57
60
  /** Payment-related information associated with the Cart. */
58
61
  paymentInfo?: PaymentInfo;
59
62
  /**
60
- * The estimated costs that the customer will pay.
63
+ * Whether the Cart has been placed as an Order.
64
+ * Defaults to `false`.
61
65
  * @readonly
62
66
  */
63
- pricingInfo?: PricingInfo;
67
+ orderPlaced?: boolean;
64
68
  /**
65
- * The current status of the Cart.
69
+ * The ID of the Order created from the Cart.
70
+ * This field is empty until the checkout process is completed.
71
+ * @format GUID
66
72
  * @readonly
67
73
  */
68
- status?: CartStatusWithLiterals;
74
+ orderId?: string | null;
75
+ /**
76
+ * Persistent ID that correlates between the Cart and the created Order (after the checkout is completed).
77
+ * @format GUID
78
+ * @readonly
79
+ */
80
+ purchaseFlowId?: string | null;
69
81
  /**
70
82
  * Additional Cart settings.
71
83
  *
@@ -74,7 +86,7 @@ interface Cart {
74
86
  * > * To access and manage custom checkout page content, your app must have the permission scope named "Manage eCommerce - Admin Permissions". Learn more about [permission scopes](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).
75
87
  * @immutable
76
88
  */
77
- customSettings?: CustomSettings;
89
+ settings?: CartSettings;
78
90
  /**
79
91
  * Custom checkout URL to redirect the customer to a checkout page.
80
92
  * By default, customers are redirected to the standard Wix checkout page.
@@ -84,29 +96,10 @@ interface Cart {
84
96
  */
85
97
  customCheckoutUrl?: string | null;
86
98
  /**
87
- * The ID of the Order created from the Cart.
88
- * This field is empty until the checkout process is completed.
89
- * @format GUID
90
- * @readonly
91
- */
92
- orderId?: string | null;
93
- /**
94
- * Persistent ID that correlates between the Cart and the created Order (after the checkout is completed).
95
- * @format GUID
96
- * @readonly
97
- */
98
- purchaseFlowId?: string | null;
99
- }
100
- interface ExtendedFields {
101
- /**
102
- * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
103
- * The value of each key is structured according to the schema defined when the extended fields were configured.
104
- *
105
- * You can only access fields for which you have the appropriate permissions.
106
- *
107
- * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
99
+ * Custom fields.
100
+ * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
108
101
  */
109
- namespaces?: Record<string, Record<string, any>>;
102
+ extendedFields?: ExtendedFields;
110
103
  }
111
104
  interface V2LineItem {
112
105
  /**
@@ -149,10 +142,10 @@ interface V2LineItem {
149
142
  */
150
143
  modifierGroups?: ModifierGroup[];
151
144
  /**
152
- * Whether the item can only be purchased by site members.
153
- * Default: `false`
145
+ * Whether the line item is a custom line item.
146
+ * Custom line items don't trigger the Catalog service plugin.
154
147
  */
155
- membersOnly?: boolean;
148
+ customLineItem?: boolean;
156
149
  }
157
150
  interface TranslatableString {
158
151
  /**
@@ -191,7 +184,10 @@ interface ItemQuantityInfo {
191
184
  requestedQuantity?: number;
192
185
  /** The maximum quantity of items available for purchase. */
193
186
  availableQuantity?: number | null;
194
- /** Whether the line item quantity is fixed and cannot be changed. */
187
+ /**
188
+ * Whether the line item quantity is fixed and cannot be changed.
189
+ * Default: `false`.
190
+ */
195
191
  fixedQuantity?: boolean;
196
192
  }
197
193
  interface ItemPricingInfo {
@@ -274,11 +270,6 @@ interface ItemPriceBreakdown {
274
270
  totalDiscount?: MultiCurrencyPrice;
275
271
  }
276
272
  interface ItemSource {
277
- /**
278
- * Whether the line item is a custom line item.
279
- * Custom line items don't trigger the Catalog service plugin.
280
- */
281
- customLineItem?: boolean;
282
273
  /**
283
274
  * Catalog and item reference.
284
275
  * Holds IDs for the item and the catalog it came from, as well as further optional info.
@@ -532,6 +523,11 @@ interface ItemAttributes {
532
523
  subscriptionInfo?: SubscriptionOptionInfo;
533
524
  /** Service properties. When relevant, this contains information such as date and number of participants. */
534
525
  serviceProperties?: ServiceProperties;
526
+ /**
527
+ * Whether the item can only be purchased by site members.
528
+ * Default: `false`
529
+ */
530
+ membersOnly?: boolean;
535
531
  }
536
532
  interface PageUrlV2 {
537
533
  /**
@@ -762,16 +758,27 @@ interface V2SelectedMembership {
762
758
  declare enum ItemStatus {
763
759
  UNKNOWN_ITEM_STATUS = "UNKNOWN_ITEM_STATUS",
764
760
  /** The item is available in the requested quantity. */
765
- AVAILABLE = "AVAILABLE",
761
+ IN_STOCK = "IN_STOCK",
766
762
  /** Only part of the requested quantity is available. */
767
- PARTIALLY_AVAILABLE = "PARTIALLY_AVAILABLE",
763
+ PARTIALLY_IN_STOCK = "PARTIALLY_IN_STOCK",
768
764
  /** The item is out of stock. */
769
765
  OUT_OF_STOCK = "OUT_OF_STOCK",
770
766
  /** The item is no longer exists in the catalog. */
771
- NOT_EXISTS = "NOT_EXISTS"
767
+ REMOVED_FROM_CATALOG = "REMOVED_FROM_CATALOG"
772
768
  }
773
769
  /** @enumType */
774
- type ItemStatusWithLiterals = ItemStatus | 'UNKNOWN_ITEM_STATUS' | 'AVAILABLE' | 'PARTIALLY_AVAILABLE' | 'OUT_OF_STOCK' | 'NOT_EXISTS';
770
+ type ItemStatusWithLiterals = ItemStatus | 'UNKNOWN_ITEM_STATUS' | 'IN_STOCK' | 'PARTIALLY_IN_STOCK' | 'OUT_OF_STOCK' | 'REMOVED_FROM_CATALOG';
771
+ interface ExtendedFields {
772
+ /**
773
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
774
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
775
+ *
776
+ * You can only access fields for which you have the appropriate permissions.
777
+ *
778
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
779
+ */
780
+ namespaces?: Record<string, Record<string, any>>;
781
+ }
775
782
  interface AdditionalFee {
776
783
  /**
777
784
  * Additional fee's unique code or ID.
@@ -1084,18 +1091,13 @@ interface CustomContentReference {
1084
1091
  */
1085
1092
  componentId?: string;
1086
1093
  }
1087
- interface SiteInfo {
1094
+ interface BusinessInfo {
1088
1095
  /**
1089
1096
  * The ID of the business location associated with the cart.
1090
1097
  * Learn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction).
1091
1098
  * @format GUID
1092
1099
  */
1093
- businessLocationId?: string | null;
1094
- /**
1095
- * The business’s unit of weight measurement (e.g., KG, LB).
1096
- * @readonly
1097
- */
1098
- weightUnit?: WeightUnitWithLiterals;
1100
+ locationId?: string | null;
1099
1101
  /**
1100
1102
  * The business’s default language, represented as a two-letter ISO 639-1 code.
1101
1103
  * @format LANGUAGE
@@ -1109,16 +1111,6 @@ interface SiteInfo {
1109
1111
  */
1110
1112
  currencyCode?: string;
1111
1113
  }
1112
- declare enum WeightUnit {
1113
- /** Weight unit can't be classified due to an error. */
1114
- UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT",
1115
- /** Kilograms. */
1116
- KG = "KG",
1117
- /** Pounds. */
1118
- LB = "LB"
1119
- }
1120
- /** @enumType */
1121
- type WeightUnitWithLiterals = WeightUnit | 'UNSPECIFIED_WEIGHT_UNIT' | 'KG' | 'LB';
1122
1114
  interface CustomerInfo extends CustomerInfoIdOneOf {
1123
1115
  /**
1124
1116
  * Site visitor ID (if site visitor is **not** a member).
@@ -1166,11 +1158,6 @@ interface CustomerInfo extends CustomerInfoIdOneOf {
1166
1158
  * @readonly
1167
1159
  */
1168
1160
  currencyCode?: string;
1169
- /**
1170
- * The [buyer note](https://support.wix.com/en/article/wix-stores-viewing-customer-notes) left by the customer.
1171
- * @maxLength 1000
1172
- */
1173
- buyerNote?: string | null;
1174
1161
  }
1175
1162
  /** @oneof */
1176
1163
  interface CustomerInfoIdOneOf {
@@ -1201,6 +1188,11 @@ interface DeliveryInfo {
1201
1188
  recipient?: FullAddressContactDetails;
1202
1189
  /** The selected delivery method by the customer. */
1203
1190
  method?: DeliveryMethod;
1191
+ /**
1192
+ * The unit of weight measurement when shipping items (e.g., KG, LB).
1193
+ * @readonly
1194
+ */
1195
+ weightUnit?: WeightUnitWithLiterals;
1204
1196
  }
1205
1197
  /** Physical address */
1206
1198
  interface Address {
@@ -1324,6 +1316,16 @@ interface DeliveryMethod {
1324
1316
  */
1325
1317
  pickup?: boolean;
1326
1318
  }
1319
+ declare enum WeightUnit {
1320
+ /** Weight unit can't be classified due to an error. */
1321
+ UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT",
1322
+ /** Kilograms. */
1323
+ KG = "KG",
1324
+ /** Pounds. */
1325
+ LB = "LB"
1326
+ }
1327
+ /** @enumType */
1328
+ type WeightUnitWithLiterals = WeightUnit | 'UNSPECIFIED_WEIGHT_UNIT' | 'KG' | 'LB';
1327
1329
  interface TaxInfo {
1328
1330
  /**
1329
1331
  * Indicates whether tax is already included in prices (line items, discounts, delivery, additional fess).
@@ -1377,23 +1379,7 @@ interface GiftCard {
1377
1379
  */
1378
1380
  externalId?: string | null;
1379
1381
  }
1380
- interface PricingInfo {
1381
- /** The sum of all line items after applying automatic discounts. */
1382
- subtotal?: MultiCurrencyPrice;
1383
- /** The coupon discount amount. Automatic discounts are not included in this amount. */
1384
- discount?: MultiCurrencyPrice;
1385
- /** The sum of all line items after applying all discounts. */
1386
- discountedSubtotal?: MultiCurrencyPrice;
1387
- }
1388
- declare enum CartStatus {
1389
- /** A new Cart. */
1390
- CREATED = "CREATED",
1391
- /** The checkout process is completed. */
1392
- CHECKOUT_COMPLETED = "CHECKOUT_COMPLETED"
1393
- }
1394
- /** @enumType */
1395
- type CartStatusWithLiterals = CartStatus | 'CREATED' | 'CHECKOUT_COMPLETED';
1396
- interface CustomSettings {
1382
+ interface CartSettings {
1397
1383
  /**
1398
1384
  * Whether to restrict the option to add or remove a gift card on the checkout page.
1399
1385
  * Default: `false`
@@ -1597,7 +1583,7 @@ interface AdditionalFeeTax {
1597
1583
  interface PriceSummary {
1598
1584
  /**
1599
1585
  * Total price of all line items after applying item-level discounts.
1600
- * FIXME: Currently we don't know if the subtotal includes tax or not.
1586
+ * Before tax TODO: Change it to include tax if the 'prices_include_tax' flag is true.
1601
1587
  */
1602
1588
  subtotal?: MultiCurrencyPrice;
1603
1589
  /**
@@ -1608,20 +1594,17 @@ interface PriceSummary {
1608
1594
  discount?: MultiCurrencyPrice;
1609
1595
  /**
1610
1596
  * Final delivery cost for the cart.
1611
- * FIXME: Currently we don't know if the subtotal includes tax or not.
1597
+ * Before tax TODO: Change it to include tax if the 'prices_include_tax' flag is true.
1612
1598
  */
1613
1599
  delivery?: MultiCurrencyPrice;
1614
1600
  /**
1615
1601
  * Total additional fees associated with the cart.
1616
- * FIXME: Currently we don't know if the subtotal includes tax or not.
1602
+ * Before tax TODO: Change it to include tax if the 'prices_include_tax' flag is true.
1617
1603
  */
1618
1604
  additionalFees?: MultiCurrencyPrice;
1619
1605
  /** Total tax amount calculated across all applicable components (items, discounts, delivery, and fees). */
1620
1606
  tax?: MultiCurrencyPrice;
1621
- /**
1622
- * Total amount to be paid.
1623
- * Curenntly, total = subtotal - discount + delivery + additional_fees + tax.
1624
- */
1607
+ /** Total amount to be paid. */
1625
1608
  total?: MultiCurrencyPrice;
1626
1609
  }
1627
1610
  interface PaymentSummary {
@@ -1852,11 +1835,6 @@ interface CustomItemInput {
1852
1835
  * @maxSize 25
1853
1836
  */
1854
1837
  modifierGroups?: ModifierGroup[];
1855
- /**
1856
- * Whether the item can only be purchased by site members.
1857
- * Default: `false`
1858
- */
1859
- membersOnly?: boolean;
1860
1838
  }
1861
1839
  interface CustomItemQuantityInfo {
1862
1840
  /**
@@ -1937,6 +1915,11 @@ interface CustomItemAttributes {
1937
1915
  subscriptionInfo?: SubscriptionOptionInfo;
1938
1916
  /** Service properties. When relevant, this contains information such as date and number of participants. */
1939
1917
  serviceProperties?: ServiceProperties;
1918
+ /**
1919
+ * Whether the item can only be purchased by site members.
1920
+ * Default: `false`
1921
+ */
1922
+ membersOnly?: boolean;
1940
1923
  }
1941
1924
  interface CustomItemDeliveryConfig {
1942
1925
  /**
@@ -2082,7 +2065,7 @@ interface UpdateLineItemsInCurrentCartRequest {
2082
2065
  * @minSize 1
2083
2066
  * @maxSize 100
2084
2067
  */
2085
- lineItemUpdates?: LineItemUpdate[];
2068
+ lineItems?: LineItemUpdate[];
2086
2069
  }
2087
2070
  interface LineItemUpdate {
2088
2071
  /**
@@ -2091,9 +2074,9 @@ interface LineItemUpdate {
2091
2074
  */
2092
2075
  lineItemId?: string;
2093
2076
  /** Quantity update (optional - if not provided, quantity is not updated) */
2094
- quantityUpdate?: QuantityUpdate;
2077
+ quantity?: QuantityUpdate;
2095
2078
  /** Selected membership update (optional - if not provided, membership is not updated) */
2096
- selectedMembershipUpdate?: SelectedMembershipUpdate;
2079
+ selectedMembership?: SelectedMembershipUpdate;
2097
2080
  }
2098
2081
  interface QuantityUpdate {
2099
2082
  /**
@@ -2101,7 +2084,7 @@ interface QuantityUpdate {
2101
2084
  * @min 1
2102
2085
  * @max 100000
2103
2086
  */
2104
- quantity?: number;
2087
+ newQuantity?: number;
2105
2088
  }
2106
2089
  interface SelectedMembershipUpdate {
2107
2090
  /**
@@ -2109,7 +2092,7 @@ interface SelectedMembershipUpdate {
2109
2092
  *
2110
2093
  * To just remove current selected membership, and not replace with a new one, pass an empty value here.
2111
2094
  */
2112
- membership?: V2SelectedMembership;
2095
+ newMembership?: V2SelectedMembership;
2113
2096
  }
2114
2097
  interface UpdateLineItemsInCurrentCartResponse {
2115
2098
  /** Updated Cart. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_ecom_current-cart-v-2",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -50,5 +50,5 @@
50
50
  "fqdn": "wix.ecom.v2.cart"
51
51
  }
52
52
  },
53
- "falconPackageHash": "9bc772b64a2582276fad8efcb83ffd0498da93e4252aa8504eab9e93"
53
+ "falconPackageHash": "02899c4b308983da40efe1ba05bd3501a51c2227fee5714d0599bab5"
54
54
  }