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