@wix/auto_sdk_ecom_totals-calculator 1.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.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  11. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js +23 -0
  12. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  13. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  14. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js +144 -0
  15. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  16. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  17. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js +47 -0
  18. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  19. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  20. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js +28 -0
  21. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  22. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1365 -0
  23. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js +144 -0
  24. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  25. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1434 -0
  26. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js +271 -0
  27. package/build/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  39. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.context.js +5 -0
  40. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  41. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  42. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.http.js +140 -0
  43. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  44. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  45. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js +20 -0
  46. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  47. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  48. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.public.js +9 -0
  49. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  50. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1365 -0
  51. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.types.js +141 -0
  52. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  53. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1434 -0
  54. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js +244 -0
  55. package/build/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  66. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js +23 -0
  67. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  68. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  69. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js +144 -0
  70. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  71. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  72. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js +47 -0
  73. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  75. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js +28 -0
  76. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  77. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1372 -0
  78. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js +144 -0
  79. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  80. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1499 -0
  81. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js +271 -0
  82. package/build/internal/cjs/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.context.d.ts +5 -0
  93. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.context.js +5 -0
  94. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.context.js.map +1 -0
  95. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.http.d.ts +3 -0
  96. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.http.js +140 -0
  97. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.http.js.map +1 -0
  98. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.meta.d.ts +13 -0
  99. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js +20 -0
  100. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.meta.js.map +1 -0
  101. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.public.d.ts +13 -0
  102. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.public.js +9 -0
  103. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.public.js.map +1 -0
  104. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.types.d.ts +1372 -0
  105. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.types.js +141 -0
  106. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.types.js.map +1 -0
  107. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.universal.d.ts +1499 -0
  108. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js +244 -0
  109. package/build/internal/es/src/ecom-v1-totals-calculation-totals-calculator.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,1365 @@
1
+ export interface TotalsCalculationEntity {
2
+ }
3
+ export interface CalculateTotalsRequest extends CalculateTotalsRequestCouponOneOf, CalculateTotalsRequestGiftCardOneOf {
4
+ /** Coupon ID. */
5
+ couponId?: string | null;
6
+ /** Coupon code. */
7
+ couponCode?: string | null;
8
+ /** Gift card ID. */
9
+ giftCardId?: string | null;
10
+ /** Gift card code. */
11
+ giftCardCode?: string | null;
12
+ /**
13
+ * Calculation ID. An identifier of the entity that you are calculating totals for, for example, cart ID or checkout ID.
14
+ * This value will be used in order to optimise calculations by caching.
15
+ * If not passed, calculation might be slower in some cases.
16
+ */
17
+ calculationId?: string | null;
18
+ /** Line items for calculation. */
19
+ lineItems?: LineItem[];
20
+ /** Shipping address for tax and shipping calculation (if applicable). */
21
+ shippingAddress?: Address;
22
+ /** Billing address. Used for calculating tax if all the items in the cart are not shippable. */
23
+ billingAddress?: Address;
24
+ /** Details about selected shipping option. */
25
+ selectedShippingOption?: SelectedShippingOption;
26
+ /**
27
+ * Merchant discounts to apply to specific line items. If no `lineItemIds` are passed, the discount will be applied to the whole cart/checkout.
28
+ * @deprecated
29
+ */
30
+ merchantDiscounts?: MerchantDiscountInput[];
31
+ /** Buyer email. Used to enforce coupon [single-use per customer](https://support.wix.com/en/article/wix-stores-limiting-coupon-usage). If not passed, single coupon usage per customer will not be enforced. */
32
+ buyerEmail?: string | null;
33
+ /**
34
+ * Member id to use for this calculation
35
+ * When not provided, given that the caller is a member, its member id will be used
36
+ * Providing this require elevated permissions - ECOM.ADMIN_CALCULATE_TOTALS
37
+ */
38
+ memberId?: string | null;
39
+ /**
40
+ * The selected memberships and which line items they apply to
41
+ * When not provided, default selection will be returned
42
+ * You can also set it to empty selection
43
+ */
44
+ selectedMemberships?: SelectedMemberships;
45
+ /** Buyer phone number. Used to get shipping rates. */
46
+ buyerPhone?: string | null;
47
+ /** Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order. */
48
+ purchaseFlowId?: string | null;
49
+ }
50
+ /** @oneof */
51
+ export interface CalculateTotalsRequestCouponOneOf {
52
+ /** Coupon ID. */
53
+ couponId?: string | null;
54
+ /** Coupon code. */
55
+ couponCode?: string | null;
56
+ }
57
+ /** @oneof */
58
+ export interface CalculateTotalsRequestGiftCardOneOf {
59
+ /** Gift card ID. */
60
+ giftCardId?: string | null;
61
+ /** Gift card code. */
62
+ giftCardCode?: string | null;
63
+ }
64
+ export interface LineItem {
65
+ /** Line item ID. */
66
+ id?: string;
67
+ /** Quantity. */
68
+ quantity?: number | null;
69
+ /**
70
+ * Optional references to the line item's origin catalog.
71
+ * See [Catalog SPI](https://bo.wix.com/wix-docs/rest/ecommerce/catalog-spi/introduction) for more details.
72
+ * This field may be empty in the case of a custom line item.
73
+ * currently we only use the catalog app id to set tax=0 for specific apps.
74
+ */
75
+ catalogReference?: CatalogReference;
76
+ /** Product/booking/event name. */
77
+ productName?: string | null;
78
+ /** Price. */
79
+ price?: string;
80
+ /** Physical properties (if applicable). */
81
+ physicalProperties?: PhysicalProperties;
82
+ /** Subscription settings. */
83
+ subscriptionSettings?: SubscriptionSettings;
84
+ /**
85
+ * Type of selected payment option for current item. Defaults to `FULL_PAYMENT_ONLINE`.
86
+ * + `FULL_PAYMENT_ONLINE` - The entire payment for this item happens as part of the checkout.
87
+ * + `FULL_PAYMENT_OFFLINE` - The entire payment for this item happens after the checkout. For example, when using cash, check, or other offline payment methods.
88
+ * + `MEMBERSHIP` - Payment for this item is done by charging a membership. When this option is used, `lineItem.price.amount` is 0.
89
+ * + `DEPOSIT_ONLINE` - Partial payment for the given item to be paid upfront during the checkout. Amount to be paid is defined by deposit_amount field.
90
+ */
91
+ paymentOption?: PaymentOptionType;
92
+ /** Service properties. When relevant, this contains information such as date and number of participants. */
93
+ serviceProperties?: ServiceProperties;
94
+ /**
95
+ * In cases where `catalogReference.catalogItemId` is NOT the actual catalog item ID, this field will return the true item's ID.
96
+ * + For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID. Therefore this value is set to the service ID.
97
+ * + In most cases, this field has the same value as `catalogReference.catalogItemId`.
98
+ * + Used in membership validation.
99
+ */
100
+ rootCatalogItemId?: string | null;
101
+ /**
102
+ * Optional - partial amount of item's price to be paid now for checkout cases with DEPOSIT_ONLINE payment option
103
+ * If omitted - item's price will not be split and is expected to be paid in single installment
104
+ */
105
+ depositAmount?: string | null;
106
+ /** full price of the item before all the discounts */
107
+ fullPrice?: string | null;
108
+ /** The Item's Delivery Profile Id */
109
+ deliveryProfileId?: string | null;
110
+ /** Item type. Either a preset type or custom. */
111
+ itemType?: ItemType;
112
+ }
113
+ /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
114
+ export interface CatalogReference {
115
+ /** ID of the item within the catalog it belongs to. */
116
+ catalogItemId?: string;
117
+ /**
118
+ * ID of the app providing the catalog.
119
+ *
120
+ * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
121
+ *
122
+ * For items from Wix catalogs, the following values always apply:
123
+ * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
124
+ * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
125
+ * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
126
+ */
127
+ appId?: string;
128
+ /**
129
+ * Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.
130
+ *
131
+ * For products and variants from a Wix Stores catalog, learn more about [eCommerce integration](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration).
132
+ */
133
+ options?: Record<string, any> | null;
134
+ }
135
+ export interface PhysicalProperties {
136
+ /** Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request. */
137
+ weight?: number | null;
138
+ /** Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). */
139
+ sku?: string | null;
140
+ /** Whether this line item is shippable. */
141
+ shippable?: boolean;
142
+ }
143
+ export interface Scope {
144
+ /** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
145
+ namespace?: string;
146
+ /** Coupon scope's applied group (e.g., event or ticket in Wix Events) */
147
+ group?: Group;
148
+ }
149
+ export interface Group {
150
+ /** Coupon scope's group (e.g., product or collection in Wix Stores). See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
151
+ name?: string;
152
+ /** Item ID (when the coupon scope is limited to just one item). */
153
+ entityId?: string | null;
154
+ }
155
+ export interface SubscriptionSettings {
156
+ /** Frequency of recurring payment. Every day/week/month/year. */
157
+ frequency?: SubscriptionFrequency;
158
+ }
159
+ /** Frequency unit of recurring payment */
160
+ export declare enum SubscriptionFrequency {
161
+ UNDEFINED = "UNDEFINED",
162
+ DAY = "DAY",
163
+ WEEK = "WEEK",
164
+ MONTH = "MONTH",
165
+ YEAR = "YEAR"
166
+ }
167
+ /** Type of selected payment option for catalog item */
168
+ export declare enum PaymentOptionType {
169
+ /** The entire payment for this item happens as part of the checkout. */
170
+ FULL_PAYMENT_ONLINE = "FULL_PAYMENT_ONLINE",
171
+ /** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
172
+ FULL_PAYMENT_OFFLINE = "FULL_PAYMENT_OFFLINE",
173
+ /** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
174
+ MEMBERSHIP = "MEMBERSHIP",
175
+ /** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
176
+ DEPOSIT_ONLINE = "DEPOSIT_ONLINE",
177
+ /** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
178
+ MEMBERSHIP_OFFLINE = "MEMBERSHIP_OFFLINE"
179
+ }
180
+ export interface ServiceProperties {
181
+ /**
182
+ * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.
183
+ * For example, the start time of a class.
184
+ */
185
+ scheduledDate?: Date | null;
186
+ /** The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room. */
187
+ numberOfParticipants?: number | null;
188
+ }
189
+ export interface ItemType extends ItemTypeItemTypeDataOneOf {
190
+ /** Preset item type. */
191
+ preset?: ItemTypeItemType;
192
+ /** Custom item type. When none of the preset types are suitable, specifies the custom type. */
193
+ custom?: string;
194
+ }
195
+ /** @oneof */
196
+ export interface ItemTypeItemTypeDataOneOf {
197
+ /** Preset item type. */
198
+ preset?: ItemTypeItemType;
199
+ /** Custom item type. When none of the preset types are suitable, specifies the custom type. */
200
+ custom?: string;
201
+ }
202
+ export declare enum ItemTypeItemType {
203
+ UNRECOGNISED = "UNRECOGNISED",
204
+ PHYSICAL = "PHYSICAL",
205
+ DIGITAL = "DIGITAL",
206
+ GIFT_CARD = "GIFT_CARD",
207
+ SERVICE = "SERVICE"
208
+ }
209
+ export interface TaxableAddress extends TaxableAddressTaxableAddressDataOneOf {
210
+ /** taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly. */
211
+ addressType?: TaxableAddressType;
212
+ }
213
+ /** @oneof */
214
+ export interface TaxableAddressTaxableAddressDataOneOf {
215
+ /** taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly. */
216
+ addressType?: TaxableAddressType;
217
+ }
218
+ export declare enum TaxableAddressType {
219
+ UNKNOWN_TAXABLE_ADDRESS = "UNKNOWN_TAXABLE_ADDRESS",
220
+ BUSINESS = "BUSINESS",
221
+ BILLING = "BILLING",
222
+ SHIPPING = "SHIPPING"
223
+ }
224
+ export interface ApiV1AdditionalFee {
225
+ /** Additional fee's unique code or ID. */
226
+ code?: string | null;
227
+ /**
228
+ * Additional fee's name.
229
+ *
230
+ * Max: 50 characters
231
+ */
232
+ name?: string;
233
+ /** Total additional fees. This `price` does not include any taxes that may apply to these additional fees. */
234
+ price?: string;
235
+ /**
236
+ * Tax details.
237
+ *
238
+ * > **Note:** Tax is not calculated in the returned `price` even when `taxDetails.taxable` is `true`.
239
+ */
240
+ taxDetails?: V1TaxDetails;
241
+ }
242
+ /** Tax details. */
243
+ export interface V1TaxDetails {
244
+ /** Whether additional fee is taxable. */
245
+ taxable?: boolean;
246
+ /** Reserved for internal use. */
247
+ taxGroupId?: string | null;
248
+ }
249
+ /** Physical address */
250
+ export interface Address {
251
+ /** Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format. */
252
+ country?: string | null;
253
+ /** Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format. */
254
+ subdivision?: string | null;
255
+ /** City name. */
256
+ city?: string | null;
257
+ /** Postal or zip code. */
258
+ postalCode?: string | null;
259
+ /** Street address. */
260
+ streetAddress?: StreetAddress;
261
+ /** Main address line (usually street name and number). */
262
+ addressLine?: string | null;
263
+ /** Free text providing more detailed address info. Usually contains apt, suite, floor. */
264
+ addressLine2?: string | null;
265
+ /**
266
+ * Country's full name.
267
+ * @readonly
268
+ */
269
+ countryFullname?: string | null;
270
+ /**
271
+ * Subdivision full-name.
272
+ * @readonly
273
+ */
274
+ subdivisionFullname?: string | null;
275
+ }
276
+ export interface StreetAddress {
277
+ /** Street number. */
278
+ number?: string;
279
+ /** Street name. */
280
+ name?: string;
281
+ }
282
+ export interface AddressLocation {
283
+ /** Address latitude. */
284
+ latitude?: number | null;
285
+ /** Address longitude. */
286
+ longitude?: number | null;
287
+ }
288
+ export interface SelectedShippingOption {
289
+ /** Carrier ID. */
290
+ carrierId?: string | null;
291
+ /** Selected shipping option code. For example, "usps_std_overnight". */
292
+ code?: string;
293
+ }
294
+ export interface MerchantDiscountInput {
295
+ /** Discount amount. */
296
+ amount?: string;
297
+ /** IDs of line items the discount applies to. */
298
+ lineItemIds?: string[];
299
+ }
300
+ export interface SelectedMemberships {
301
+ /** Selected memberships. */
302
+ memberships?: SelectedMembership[];
303
+ }
304
+ export interface SelectedMembership {
305
+ /** Membership ID. */
306
+ id?: string;
307
+ /** ID of the app providing this payment option. */
308
+ appId?: string;
309
+ /** IDs of the line items this membership applies to. */
310
+ lineItemIds?: string[];
311
+ }
312
+ export interface CarrierShippingOption {
313
+ /** This carrier's unique ID */
314
+ carrierId?: string | null;
315
+ /** Shipping service options offered by this carrier for this request */
316
+ shippingOptions?: ShippingOption;
317
+ }
318
+ export interface ShippingOption {
319
+ /**
320
+ * Unique code of provided shipping option like "usps_std_overnight".
321
+ * For legacy calculators this would be the UUID of the option.
322
+ */
323
+ code?: string;
324
+ /**
325
+ * Title of the option, such as USPS Standard Overnight Delivery (in the requested locale).
326
+ * For example, "Standard" or "First-Class Package International".
327
+ */
328
+ title?: string;
329
+ /** Delivery logistics. */
330
+ logistics?: DeliveryLogistics;
331
+ /** Sipping price information. */
332
+ cost?: ShippingPrice;
333
+ /** Delivery solution allocations to different delivery carriers and delivery regions */
334
+ deliveryAllocations?: DeliveryAllocation[];
335
+ /** If the delivery solution is a partial and doesn't apply to all items. */
336
+ partial?: boolean | null;
337
+ }
338
+ export interface DeliveryLogistics {
339
+ /** Expected delivery time, in free text. For example, "3-5 business days". */
340
+ deliveryTime?: string | null;
341
+ /** Instructions for caller, e.g for pickup: "Please deliver during opening hours, and please don't park in disabled parking spot". */
342
+ instructions?: string | null;
343
+ /** Pickup details. */
344
+ pickupDetails?: PickupDetails;
345
+ }
346
+ export interface PickupDetails {
347
+ /** Pickup address. */
348
+ address?: Address;
349
+ /**
350
+ * Whether the pickup address is that of a business - this may effect tax calculation.
351
+ * @deprecated
352
+ */
353
+ businessLocation?: boolean;
354
+ /** Pickup method */
355
+ pickupMethod?: PickupMethod;
356
+ }
357
+ export declare enum PickupMethod {
358
+ UNKNOWN_METHOD = "UNKNOWN_METHOD",
359
+ STORE_PICKUP = "STORE_PICKUP",
360
+ PICKUP_POINT = "PICKUP_POINT"
361
+ }
362
+ export interface DeliveryTimeSlot {
363
+ /** starting time of the delivery time slot */
364
+ from?: Date | null;
365
+ /** ending time of the delivery time slot */
366
+ to?: Date | null;
367
+ }
368
+ export interface ShippingPrice {
369
+ /** Shipping price. */
370
+ price?: MultiCurrencyPrice;
371
+ /** Other costs such as insurance, handling & packaging for fragile items, etc. */
372
+ otherCharges?: OtherCharge[];
373
+ }
374
+ export interface MultiCurrencyPrice {
375
+ /** Amount. */
376
+ amount?: string;
377
+ /**
378
+ * Converted amount.
379
+ * @readonly
380
+ */
381
+ convertedAmount?: string;
382
+ /**
383
+ * Amount formatted with currency symbol.
384
+ * @readonly
385
+ */
386
+ formattedAmount?: string;
387
+ /**
388
+ * Converted amount formatted with currency symbol.
389
+ * @readonly
390
+ */
391
+ formattedConvertedAmount?: string;
392
+ }
393
+ export interface OtherCharge {
394
+ /** Type of additional cost. */
395
+ type?: ChargeType;
396
+ /** Price of added cost. */
397
+ price?: MultiCurrencyPrice;
398
+ }
399
+ export declare enum ChargeType {
400
+ HANDLING_FEE = "HANDLING_FEE",
401
+ INSURANCE = "INSURANCE"
402
+ }
403
+ export interface DeliveryAllocation {
404
+ /** The delivery option's carrier details, could be multiple if the delivery option is a combination of multiple carriers */
405
+ deliveryCarrier?: Carrier;
406
+ /** The delivery region that are relevant for this delivery solution. */
407
+ deliveryRegion?: Region;
408
+ /** Populated if the delivery solution is a partially supplied by this carrier. */
409
+ applicableLineItems?: ApplicableLineItems;
410
+ }
411
+ export interface Carrier {
412
+ /** The carrier app id */
413
+ appId?: string | null;
414
+ /** Unique code that acts as an ID for a shipping rate. For example, `"usps_std_overnight"`. */
415
+ code?: string;
416
+ }
417
+ export interface Region {
418
+ /** The delivery region id. */
419
+ id?: string | null;
420
+ /** The delivery region name. */
421
+ name?: string | null;
422
+ }
423
+ export interface ApplicableLineItems {
424
+ /** Line items that the delivery solution is for. */
425
+ lineItemIds?: string[];
426
+ }
427
+ export interface AppliedDiscount extends AppliedDiscountDiscountSourceOneOf {
428
+ /** Coupon details. */
429
+ coupon?: Coupon;
430
+ /** Merchant discount. */
431
+ merchantDiscount?: MerchantDiscount;
432
+ /** Discount rule */
433
+ discountRule?: DiscountRule;
434
+ /** Discount type. */
435
+ discountType?: DiscountType;
436
+ /**
437
+ * IDs of line items the discount applies to.
438
+ * @deprecated IDs of line items the discount applies to.
439
+ * @replacedBy line_items_discounts
440
+ * @targetRemovalDate 2024-06-01
441
+ */
442
+ lineItemIds?: string[];
443
+ }
444
+ /** @oneof */
445
+ export interface AppliedDiscountDiscountSourceOneOf {
446
+ /** Coupon details. */
447
+ coupon?: Coupon;
448
+ /** Merchant discount. */
449
+ merchantDiscount?: MerchantDiscount;
450
+ /** Discount rule */
451
+ discountRule?: DiscountRule;
452
+ }
453
+ export declare enum DiscountType {
454
+ GLOBAL = "GLOBAL",
455
+ SPECIFIC_ITEMS = "SPECIFIC_ITEMS",
456
+ SHIPPING = "SHIPPING"
457
+ }
458
+ /** Coupon */
459
+ export interface Coupon {
460
+ /** Coupon ID. */
461
+ id?: string;
462
+ /** Coupon code. */
463
+ code?: string;
464
+ /** Coupon value. */
465
+ amount?: MultiCurrencyPrice;
466
+ /** Coupon name. */
467
+ name?: string;
468
+ }
469
+ export interface MerchantDiscount {
470
+ /** Discount value. */
471
+ amount?: MultiCurrencyPrice;
472
+ /** Discount Percentage. Will be calculated from items price before other discounts. */
473
+ percentage?: number | null;
474
+ }
475
+ export interface DiscountRule {
476
+ /** Discount rule ID */
477
+ id?: string;
478
+ /** Discount rule name */
479
+ name?: DiscountRuleName;
480
+ /** Discount value. */
481
+ amount?: MultiCurrencyPrice;
482
+ }
483
+ export interface DiscountRuleName {
484
+ /** Original discount rule name (in site's default language). */
485
+ original?: string;
486
+ /** Translated discount rule name according to buyer language. Defaults to `original` when not provided. */
487
+ translated?: string | null;
488
+ }
489
+ export interface LineItemDiscount {
490
+ /** ID of line item the discount applies to. */
491
+ id?: string;
492
+ /** Discount value. */
493
+ totalDiscountAmount?: MultiCurrencyPrice;
494
+ }
495
+ export interface AdditionalFee {
496
+ /** Additional fee's unique code (or ID) for future processing */
497
+ code?: string | null;
498
+ /** Translated additional fee's name */
499
+ name?: string;
500
+ /** Additional fee's price */
501
+ price?: string;
502
+ /** Currency */
503
+ currency?: string;
504
+ /** Tax details */
505
+ taxDetails?: TaxDetails;
506
+ /** Provider's app id */
507
+ providerAppId?: string | null;
508
+ /**
509
+ * Optional - Line items associated with this additional fee.
510
+ * If no `lineItemIds` are provided, the fee will be associated with the whole cart/checkout/order.
511
+ */
512
+ lineItemIds?: string[];
513
+ }
514
+ /** Tax Details. */
515
+ export interface TaxDetails {
516
+ /** Indication if additional fee is taxable or not */
517
+ taxable?: boolean;
518
+ /** Optional tax group ID to use when calculating tax for this additional fee */
519
+ taxGroupId?: string | null;
520
+ }
521
+ export declare enum DataFetchType {
522
+ SHIPPING = "SHIPPING",
523
+ DISCOUNT = "DISCOUNT",
524
+ ADDITIONAL_FEES = "ADDITIONAL_FEES",
525
+ ORDER_VALIDATION = "ORDER_VALIDATION"
526
+ }
527
+ export interface ExternalReference {
528
+ /**
529
+ * ID of the app associated with the purchase flow.
530
+ * For example, the Wix Pay Links app ID.
531
+ */
532
+ appId?: string;
533
+ /**
534
+ * Reference to an external resource ID. Used to link the purchase flow to a specific entity in an external system.
535
+ * For example, a Wix Pay Link ID.
536
+ */
537
+ resourceId?: string | null;
538
+ }
539
+ export interface CalculateTotalsResponse {
540
+ /** Calculate line items. */
541
+ calculatedLineItems?: CalculatedLineItem[];
542
+ /** Price summary. */
543
+ priceSummary?: PriceSummary;
544
+ /** Details of applied gift card. */
545
+ giftCard?: GiftCard;
546
+ /** Tax summary. */
547
+ taxSummary?: TaxSummary;
548
+ /** Shipping information. */
549
+ shippingInfo?: ShippingInformation;
550
+ /** Applied discounts. */
551
+ appliedDiscounts?: AppliedDiscount[];
552
+ /** Calculation errors. */
553
+ calculationErrors?: CalculationErrors;
554
+ /** Weight unit. */
555
+ weightUnit?: WeightUnit;
556
+ /** Currency. */
557
+ currency?: string;
558
+ /**
559
+ * This is the display currency. Converted prices are presented in this currency.
560
+ * @readonly
561
+ */
562
+ conversionCurrency?: string;
563
+ /** Whether tax is included in price. */
564
+ taxIncludedInPrice?: boolean;
565
+ /**
566
+ * Minimal amount to pay in order to place the order.
567
+ * @readonly
568
+ */
569
+ payNow?: PriceSummary;
570
+ /**
571
+ * Remaining amount for the order to be fully paid.
572
+ * @readonly
573
+ */
574
+ payLater?: PriceSummary;
575
+ /** Information about valid and invalid memberships, and which ones are selected for usage. */
576
+ membershipOptions?: MembershipOptions;
577
+ /** Additional Fees */
578
+ additionalFees?: V1AdditionalFee[];
579
+ /**
580
+ * The site currency.
581
+ * @readonly
582
+ */
583
+ siteCurrency?: string;
584
+ /**
585
+ * The rate used when converting from the site currency to the checkout currency.
586
+ * @readonly
587
+ */
588
+ checkoutConversionRate?: string | null;
589
+ /**
590
+ * The pay now total amount after the gift card is applied.
591
+ * @readonly
592
+ */
593
+ payNowTotalAfterGiftCard?: MultiCurrencyPrice;
594
+ /**
595
+ * The total amount after gift card is applied.
596
+ * @readonly
597
+ */
598
+ totalAfterGiftCard?: MultiCurrencyPrice;
599
+ }
600
+ export interface CalculatedLineItem {
601
+ /** Line item ID. */
602
+ lineItemId?: string;
603
+ /** Price breakdown for this line item. */
604
+ pricesBreakdown?: LineItemPricesData;
605
+ /**
606
+ * Type of selected payment option for current item. Supported values:
607
+ * + `"FULL_PAYMENT_ONLINE"` - The entire payment for this item will happen as part of the checkout
608
+ * + `"FULL_PAYMENT_OFFLINE"` - The entire payment for this item will happen after the checkout
609
+ * + `"MEMBERSHIP"` - This item cannot be paid via monetary payment options, only via non monetary option such membership. When this option is used, price must be set to 0
610
+ * + `"DEPOSIT_ONLINE"` - Partial payment of the given item will happen as part of the checkout. Amount to be paid is defined by deposit_amount field.
611
+ */
612
+ paymentOption?: PaymentOptionType;
613
+ }
614
+ export interface LineItemPricesData {
615
+ /** Total price after discounts and after tax. */
616
+ totalPriceAfterTax?: MultiCurrencyPrice;
617
+ /** Total price after discounts, and before tax. */
618
+ totalPriceBeforeTax?: MultiCurrencyPrice;
619
+ /** Tax details. */
620
+ taxDetails?: ItemTaxFullDetails;
621
+ /** Total discount for all line items. */
622
+ totalDiscount?: MultiCurrencyPrice;
623
+ /** Catalog price after catalog discount and automatic discounts. */
624
+ price?: MultiCurrencyPrice;
625
+ /** Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided. */
626
+ priceBeforeDiscounts?: MultiCurrencyPrice;
627
+ /** Total price **after** catalog-defined discount and line item discounts. */
628
+ lineItemPrice?: MultiCurrencyPrice;
629
+ /** Item price **before** line item discounts and **before** catalog-defined discount. Defaults to `price` when not provided. */
630
+ fullPrice?: MultiCurrencyPrice;
631
+ }
632
+ export interface ItemTaxFullDetails {
633
+ /** Amount for which tax is calculated. */
634
+ taxableAmount?: MultiCurrencyPrice;
635
+ /** Tax rate %, as a decimal point between 0 and 1. */
636
+ taxRate?: string;
637
+ /** Calculated tax, based on `taxable_amount` and `tax_rate`. */
638
+ totalTax?: MultiCurrencyPrice;
639
+ /**
640
+ * If breakdown exists, the sum of rates in the breakdown must equal `tax_rate`. Deprecated - use 'tax_breakdown' instead.
641
+ * @readonly
642
+ * @deprecated
643
+ */
644
+ rateBreakdown?: TaxRateBreakdown[];
645
+ }
646
+ export interface TaxRateBreakdown {
647
+ /** Name of tax against which the calculation was performed. */
648
+ name?: string;
649
+ /** Rate at which this tax detail was calculated. */
650
+ rate?: string;
651
+ /** Amount of tax for this tax detail. */
652
+ tax?: MultiCurrencyPrice;
653
+ }
654
+ /**
655
+ * TaxBreakdown represents tax information for a line item.
656
+ * It holds the tax amount and the tax rate for each tax authority that apply on the line item.
657
+ */
658
+ export interface TaxBreakdown {
659
+ /** The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec". */
660
+ jurisdiction?: string | null;
661
+ /** The amount of this line item price that was considered nontaxable. (Decimal value) */
662
+ nonTaxableAmount?: MultiCurrencyPrice;
663
+ /** The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value) */
664
+ rate?: string | null;
665
+ /** The amount of tax estimated for this line item. (Decimal value) */
666
+ taxAmount?: MultiCurrencyPrice;
667
+ /** The taxable amount of this line item. */
668
+ taxableAmount?: MultiCurrencyPrice;
669
+ /** The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc. */
670
+ taxType?: string | null;
671
+ /**
672
+ * The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc.
673
+ * This name should be explicit enough to allow the merchant to understand what tax was calculated.
674
+ */
675
+ taxName?: string | null;
676
+ /** The type of the jurisdiction in which this tax detail applies. */
677
+ jurisdictionType?: JurisdictionType;
678
+ }
679
+ /** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
680
+ export declare enum JurisdictionType {
681
+ UNDEFINED = "UNDEFINED",
682
+ COUNTRY = "COUNTRY",
683
+ STATE = "STATE",
684
+ COUNTY = "COUNTY",
685
+ CITY = "CITY",
686
+ SPECIAL = "SPECIAL"
687
+ }
688
+ export interface PriceSummary {
689
+ /** Subtotal of all line items, before discounts and before tax. */
690
+ subtotal?: MultiCurrencyPrice;
691
+ /** Total shipping price, before discounts and before tax. */
692
+ shipping?: MultiCurrencyPrice;
693
+ /** Total tax. */
694
+ tax?: MultiCurrencyPrice;
695
+ /** Total calculated discount value. */
696
+ discount?: MultiCurrencyPrice;
697
+ /** Total price after discounts, gift cards, and tax. */
698
+ total?: MultiCurrencyPrice;
699
+ /** Total additional fees price before tax. */
700
+ additionalFees?: MultiCurrencyPrice;
701
+ }
702
+ export interface GiftCard {
703
+ /**
704
+ * Gift Card ID.
705
+ * @deprecated
706
+ */
707
+ id?: string;
708
+ /** Gift card obfuscated code. */
709
+ obfuscatedCode?: string;
710
+ /** Gift card value. */
711
+ amount?: MultiCurrencyPrice;
712
+ /** App ID of the gift card provider. */
713
+ appId?: string;
714
+ /**
715
+ * External ID in the gift card provider's system.
716
+ * Used for integration and tracking across different platforms.
717
+ */
718
+ externalId?: string | null;
719
+ }
720
+ export interface TaxSummary {
721
+ /**
722
+ * Amount for which tax is calculated, added from line items.
723
+ * @readonly
724
+ */
725
+ taxableAmount?: MultiCurrencyPrice;
726
+ /**
727
+ * Calculated tax, added from line items.
728
+ * @readonly
729
+ */
730
+ totalTax?: MultiCurrencyPrice;
731
+ /**
732
+ * Tax calculator that was active when the order was created.
733
+ * @deprecated
734
+ */
735
+ calculationDetails?: TaxCalculationDetails;
736
+ }
737
+ export interface TaxCalculationDetails extends TaxCalculationDetailsCalculationDetailsOneOf {
738
+ /** Reason the manual calculation was used. */
739
+ manualRateReason?: ManualCalculationReason;
740
+ /** Details of the fallback rate calculation. */
741
+ autoTaxFallbackDetails?: AutoTaxFallbackCalculationDetails;
742
+ /** Rate calculation type. */
743
+ rateType?: RateType;
744
+ }
745
+ /** @oneof */
746
+ export interface TaxCalculationDetailsCalculationDetailsOneOf {
747
+ /** Reason the manual calculation was used. */
748
+ manualRateReason?: ManualCalculationReason;
749
+ /** Details of the fallback rate calculation. */
750
+ autoTaxFallbackDetails?: AutoTaxFallbackCalculationDetails;
751
+ }
752
+ export declare enum RateType {
753
+ /** no tax being collected for this request due to location of purchase */
754
+ NO_TAX_COLLECTED = "NO_TAX_COLLECTED",
755
+ /** manual rate used for calculation */
756
+ MANUAL_RATE = "MANUAL_RATE",
757
+ /** autotax rate used for calculation */
758
+ AUTO_RATE = "AUTO_RATE",
759
+ /** fallback rate used for calculation */
760
+ FALLBACK_RATE = "FALLBACK_RATE"
761
+ }
762
+ export declare enum ManualCalculationReason {
763
+ /** user set calculator in Business Manager to be Manual */
764
+ GLOBAL_SETTING_TO_MANUAL = "GLOBAL_SETTING_TO_MANUAL",
765
+ /** specific region is on manual even though Global setting is Auto-tax */
766
+ REGION_SETTING_TO_MANUAL = "REGION_SETTING_TO_MANUAL"
767
+ }
768
+ export interface AutoTaxFallbackCalculationDetails {
769
+ /** reason for fallback */
770
+ fallbackReason?: FallbackReason;
771
+ /** invalid request (i.e. address), timeout, internal error, license error, and others will be encoded here */
772
+ error?: ApplicationError;
773
+ }
774
+ export declare enum FallbackReason {
775
+ /** auto-tax failed to be calculated */
776
+ AUTO_TAX_FAILED = "AUTO_TAX_FAILED",
777
+ /** auto-tax was temporarily deactivated on a system-level */
778
+ AUTO_TAX_DEACTIVATED = "AUTO_TAX_DEACTIVATED"
779
+ }
780
+ export interface ApplicationError {
781
+ /** Error code. */
782
+ code?: string;
783
+ /** Description of the error. */
784
+ description?: string;
785
+ /** Data related to the error. */
786
+ data?: Record<string, any> | null;
787
+ }
788
+ /**
789
+ * The summary of the tax breakdown for all the line items. It will hold for each tax name, the aggregated tax amount paid for it and the tax rate.
790
+ * Tax breakdown is the tax amount split to the tax authorities that applied on the line item.
791
+ */
792
+ export interface AggregatedTaxBreakdown {
793
+ /** The name of the tax against which this tax amount was calculated. */
794
+ taxName?: string;
795
+ /** The type of tax that was calculated. Depends on the company's nexus settings as well as the jurisdiction's tax laws. */
796
+ taxType?: string;
797
+ /** The name of the jurisdiction in which this tax detail applies. */
798
+ jurisdiction?: string;
799
+ /** The type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
800
+ jurisdictionTypeEnum?: JurisdictionType;
801
+ /** The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.000 signifies 200% tax. (Decimal value) */
802
+ rate?: string;
803
+ /** The sum of all the tax from line items that calculated by the tax identifiers. */
804
+ aggregatedTaxAmount?: MultiCurrencyPrice;
805
+ }
806
+ export interface ShippingInformation {
807
+ /** Shipping region. */
808
+ region?: ShippingRegion;
809
+ /** Selected shipping option. */
810
+ selectedCarrierServiceOption?: SelectedCarrierServiceOption;
811
+ /** All shipping options. */
812
+ carrierServiceOptions?: CarrierServiceOption[];
813
+ }
814
+ export interface ShippingRegion {
815
+ /**
816
+ * Shipping region ID.
817
+ * @readonly
818
+ */
819
+ id?: string;
820
+ /** Shipping region name. */
821
+ name?: string;
822
+ }
823
+ export interface SelectedCarrierServiceOption {
824
+ /** Unique identifier of selected option. For example, "usps_std_overnight". */
825
+ code?: string;
826
+ /**
827
+ * Title of the option, such as USPS Standard Overnight Delivery (in the requested locale).
828
+ * For example, "Standard" or "First-Class Package International".
829
+ * @readonly
830
+ */
831
+ title?: string;
832
+ /**
833
+ * Delivery logistics.
834
+ * @readonly
835
+ */
836
+ logistics?: DeliveryLogistics;
837
+ /**
838
+ * Shipping costs.
839
+ * @readonly
840
+ */
841
+ cost?: SelectedCarrierServiceOptionPrices;
842
+ /**
843
+ * Were we able to find the requested shipping option, or otherwise we fallback to the default one (the first)
844
+ * @readonly
845
+ */
846
+ requestedShippingOption?: boolean;
847
+ /** Other charges */
848
+ otherCharges?: SelectedCarrierServiceOptionOtherCharge[];
849
+ /** This carrier's unique ID */
850
+ carrierId?: string | null;
851
+ /** Delivery solution allocations to different delivery carriers and delivery regions */
852
+ deliveryAllocations?: DeliveryAllocation[];
853
+ /** If the delivery solution is a partial and doesn't apply to all items. */
854
+ partial?: boolean | null;
855
+ }
856
+ export interface SelectedCarrierServiceOptionPrices {
857
+ /** Total shipping price, after discount and after tax. */
858
+ totalPriceAfterTax?: MultiCurrencyPrice;
859
+ /** Total price of shipping after discounts (when relevant), and before tax. */
860
+ totalPriceBeforeTax?: MultiCurrencyPrice;
861
+ /** Tax details. */
862
+ taxDetails?: ItemTaxFullDetails;
863
+ /** Shipping discount before tax. */
864
+ totalDiscount?: MultiCurrencyPrice;
865
+ /** Shipping price before discount and before tax. */
866
+ price?: MultiCurrencyPrice;
867
+ }
868
+ export interface SelectedCarrierServiceOptionOtherCharge {
869
+ /** Type of additional cost. */
870
+ type?: ChargeType;
871
+ /** Details of the charge, such as 'Full Coverage Insurance of up to 80% of value of shipment'. */
872
+ details?: string | null;
873
+ /** Price of added charge. */
874
+ cost?: SelectedCarrierServiceOptionPrices;
875
+ }
876
+ export interface CarrierServiceOption {
877
+ /** Carrier ID. */
878
+ carrierId?: string;
879
+ /** Shipping options offered by this carrier for this request. */
880
+ shippingOptions?: ShippingOption[];
881
+ }
882
+ export interface CalculationErrors extends CalculationErrorsShippingCalculationErrorOneOf {
883
+ /** General shipping calculation error. */
884
+ generalShippingCalculationError?: Details;
885
+ /** Carrier errors. */
886
+ carrierErrors?: CarrierErrors;
887
+ /** Tax calculation error. */
888
+ taxCalculationError?: Details;
889
+ /** Coupon calculation error. */
890
+ couponCalculationError?: Details;
891
+ /** Gift card calculation error. */
892
+ giftCardCalculationError?: Details;
893
+ /** Order validation errors. */
894
+ orderValidationErrors?: ApplicationError[];
895
+ /**
896
+ * Membership payment methods calculation errors
897
+ * For example, will indicate that a line item that must be paid with membership payment doesn't have one or selected memberships are invalid
898
+ */
899
+ membershipError?: Details;
900
+ /** Discount Rule calculation error. */
901
+ discountsCalculationError?: Details;
902
+ }
903
+ /** @oneof */
904
+ export interface CalculationErrorsShippingCalculationErrorOneOf {
905
+ /** General shipping calculation error. */
906
+ generalShippingCalculationError?: Details;
907
+ /** Carrier errors. */
908
+ carrierErrors?: CarrierErrors;
909
+ }
910
+ export interface Details extends DetailsKindOneOf {
911
+ applicationError?: ApplicationError;
912
+ validationError?: ValidationError;
913
+ systemError?: SystemError;
914
+ /**
915
+ * deprecated in API's - to enable migration from rendering arbitrary tracing to rest response
916
+ * @deprecated
917
+ */
918
+ tracing?: Record<string, string>;
919
+ }
920
+ /** @oneof */
921
+ export interface DetailsKindOneOf {
922
+ applicationError?: ApplicationError;
923
+ validationError?: ValidationError;
924
+ systemError?: SystemError;
925
+ }
926
+ /**
927
+ * example result:
928
+ * {
929
+ * "fieldViolations": [
930
+ * {
931
+ * "field": "fieldA",
932
+ * "description": "invalid music note. supported notes: [do,re,mi,fa,sol,la,ti]",
933
+ * "violatedRule": "OTHER",
934
+ * "ruleName": "INVALID_NOTE",
935
+ * "data": {
936
+ * "value": "FI"
937
+ * }
938
+ * },
939
+ * {
940
+ * "field": "fieldB",
941
+ * "description": "field value out of range. supported range: [0-20]",
942
+ * "violatedRule": "MAX",
943
+ * "data": {
944
+ * "threshold": 20
945
+ * }
946
+ * },
947
+ * {
948
+ * "field": "fieldC",
949
+ * "description": "invalid phone number. provide a valid phone number of size: [7-12], supported characters: [0-9, +, -, (, )]",
950
+ * "violatedRule": "FORMAT",
951
+ * "data": {
952
+ * "type": "PHONE"
953
+ * }
954
+ * }
955
+ * ]
956
+ * }
957
+ */
958
+ export interface ValidationError {
959
+ fieldViolations?: FieldViolation[];
960
+ }
961
+ export declare enum RuleType {
962
+ VALIDATION = "VALIDATION",
963
+ OTHER = "OTHER",
964
+ MAX = "MAX",
965
+ MIN = "MIN",
966
+ MAX_LENGTH = "MAX_LENGTH",
967
+ MIN_LENGTH = "MIN_LENGTH",
968
+ MAX_SIZE = "MAX_SIZE",
969
+ MIN_SIZE = "MIN_SIZE",
970
+ FORMAT = "FORMAT",
971
+ DECIMAL_LTE = "DECIMAL_LTE",
972
+ DECIMAL_GTE = "DECIMAL_GTE",
973
+ DECIMAL_LT = "DECIMAL_LT",
974
+ DECIMAL_GT = "DECIMAL_GT",
975
+ DECIMAL_MAX_SCALE = "DECIMAL_MAX_SCALE",
976
+ INVALID_ENUM_VALUE = "INVALID_ENUM_VALUE",
977
+ REQUIRED_FIELD = "REQUIRED_FIELD",
978
+ FIELD_NOT_ALLOWED = "FIELD_NOT_ALLOWED",
979
+ ONE_OF_ALIGNMENT = "ONE_OF_ALIGNMENT",
980
+ EXACT_LENGTH = "EXACT_LENGTH",
981
+ EXACT_SIZE = "EXACT_SIZE",
982
+ REQUIRED_ONE_OF_FIELD = "REQUIRED_ONE_OF_FIELD"
983
+ }
984
+ export interface FieldViolation {
985
+ field?: string;
986
+ description?: string;
987
+ violatedRule?: RuleType;
988
+ /** applicable when violated_rule=OTHER */
989
+ ruleName?: string | null;
990
+ data?: Record<string, any> | null;
991
+ }
992
+ export interface SystemError {
993
+ /** Error code. */
994
+ errorCode?: string | null;
995
+ }
996
+ export interface CarrierErrors {
997
+ /** Carrier errors. */
998
+ errors?: CarrierError[];
999
+ }
1000
+ export interface CarrierError {
1001
+ /** Carrier ID. */
1002
+ carrierId?: string;
1003
+ /** Error details. */
1004
+ error?: Details;
1005
+ }
1006
+ export declare enum WeightUnit {
1007
+ /** Weight unit can't be classified, due to an error */
1008
+ UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT",
1009
+ /** Kilograms */
1010
+ KG = "KG",
1011
+ /** Pounds */
1012
+ LB = "LB"
1013
+ }
1014
+ export interface MembershipOptions {
1015
+ /** List of payment options that can be used. */
1016
+ eligibleMemberships?: Membership[];
1017
+ /** List of payment options that are owned by the member, but cannot be used due to reason provided. */
1018
+ invalidMemberships?: InvalidMembership[];
1019
+ /** The selected membership payment options and which line items they apply to. */
1020
+ selectedMemberships?: SelectedMembership[];
1021
+ }
1022
+ export interface Membership {
1023
+ /** Membership ID. */
1024
+ id?: string;
1025
+ /** ID of the application providing this payment option. */
1026
+ appId?: string;
1027
+ /** The name of this membership. */
1028
+ name?: MembershipName;
1029
+ /** Line item IDs which are "paid" for by this membership. */
1030
+ lineItemIds?: string[];
1031
+ /** Optional - For a membership that has limited credits, information about credit usage. */
1032
+ credits?: MembershipPaymentCredits;
1033
+ /** Optional - TMembership expiry date. */
1034
+ expirationDate?: Date | null;
1035
+ /** Additional data about this membership. */
1036
+ additionalData?: Record<string, any> | null;
1037
+ }
1038
+ export interface MembershipName {
1039
+ /** Membership name. */
1040
+ original?: string;
1041
+ /** Translated membership name. Defaults to `original` when not provided. */
1042
+ translated?: string | null;
1043
+ }
1044
+ export interface MembershipPaymentCredits {
1045
+ /** Membership's total amount of credits. */
1046
+ total?: number;
1047
+ /** Membership's remaining amount of credits. */
1048
+ remaining?: number;
1049
+ }
1050
+ export interface InvalidMembership {
1051
+ /** Membership details. */
1052
+ membership?: Membership;
1053
+ /** Reason why this membership is invalid and cannot be used. */
1054
+ reason?: string;
1055
+ }
1056
+ export interface V1AdditionalFee {
1057
+ /** Additional fee's unique code (or ID) for future processing. */
1058
+ code?: string | null;
1059
+ /** Translated additional fee's name. */
1060
+ name?: string;
1061
+ /** Additional fee's price. */
1062
+ price?: MultiCurrencyPrice;
1063
+ /** Tax details. */
1064
+ taxDetails?: ItemTaxFullDetails;
1065
+ /** Provider's app id. */
1066
+ providerAppId?: string | null;
1067
+ /** Additional fee's price before tax. */
1068
+ priceBeforeTax?: MultiCurrencyPrice;
1069
+ /** Additional fee's price after tax. */
1070
+ priceAfterTax?: MultiCurrencyPrice;
1071
+ /**
1072
+ * Optional - Line items associated with this additional fee.
1073
+ * If no `lineItemIds` are provided, the fee will be associated with the whole cart/checkout/order.
1074
+ */
1075
+ lineItemIds?: string[];
1076
+ /** the source the additional fee was added from */
1077
+ source?: AdditionalFeeSource;
1078
+ }
1079
+ export declare enum AdditionalFeeSource {
1080
+ UNKNOWN_ADDITIONAL_FEE_SOURCE = "UNKNOWN_ADDITIONAL_FEE_SOURCE",
1081
+ /** The additional fee was added by an additional fee service plugin */
1082
+ SERVICE_PLUGIN = "SERVICE_PLUGIN",
1083
+ /** The additional fee was added on the item either via the catalog or on custom line item */
1084
+ ITEM = "ITEM",
1085
+ /** The additional fee was added manually on the request */
1086
+ MANUAL = "MANUAL"
1087
+ }
1088
+ interface MultiCurrencyPriceNonNullableFields {
1089
+ amount: string;
1090
+ convertedAmount: string;
1091
+ formattedAmount: string;
1092
+ formattedConvertedAmount: string;
1093
+ }
1094
+ interface TaxRateBreakdownNonNullableFields {
1095
+ name: string;
1096
+ rate: string;
1097
+ tax?: MultiCurrencyPriceNonNullableFields;
1098
+ exemptAmount?: MultiCurrencyPriceNonNullableFields;
1099
+ exemptionIds: number[];
1100
+ taxableAmount?: MultiCurrencyPriceNonNullableFields;
1101
+ }
1102
+ interface TaxBreakdownNonNullableFields {
1103
+ nonTaxableAmount?: MultiCurrencyPriceNonNullableFields;
1104
+ taxAmount?: MultiCurrencyPriceNonNullableFields;
1105
+ taxableAmount?: MultiCurrencyPriceNonNullableFields;
1106
+ jurisdictionType: JurisdictionType;
1107
+ }
1108
+ interface ItemTaxFullDetailsNonNullableFields {
1109
+ taxableAmount?: MultiCurrencyPriceNonNullableFields;
1110
+ taxRate: string;
1111
+ totalTax?: MultiCurrencyPriceNonNullableFields;
1112
+ rateBreakdown: TaxRateBreakdownNonNullableFields[];
1113
+ exemptAmount?: MultiCurrencyPriceNonNullableFields;
1114
+ taxBreakdown: TaxBreakdownNonNullableFields[];
1115
+ }
1116
+ interface LineItemPricesDataNonNullableFields {
1117
+ totalPriceAfterTax?: MultiCurrencyPriceNonNullableFields;
1118
+ totalPriceBeforeTax?: MultiCurrencyPriceNonNullableFields;
1119
+ taxDetails?: ItemTaxFullDetailsNonNullableFields;
1120
+ totalDiscount?: MultiCurrencyPriceNonNullableFields;
1121
+ price?: MultiCurrencyPriceNonNullableFields;
1122
+ priceBeforeDiscounts?: MultiCurrencyPriceNonNullableFields;
1123
+ lineItemPrice?: MultiCurrencyPriceNonNullableFields;
1124
+ fullPrice?: MultiCurrencyPriceNonNullableFields;
1125
+ }
1126
+ interface CalculatedLineItemNonNullableFields {
1127
+ lineItemId: string;
1128
+ pricesBreakdown?: LineItemPricesDataNonNullableFields;
1129
+ paymentOption: PaymentOptionType;
1130
+ }
1131
+ interface PriceSummaryNonNullableFields {
1132
+ subtotal?: MultiCurrencyPriceNonNullableFields;
1133
+ shipping?: MultiCurrencyPriceNonNullableFields;
1134
+ tax?: MultiCurrencyPriceNonNullableFields;
1135
+ discount?: MultiCurrencyPriceNonNullableFields;
1136
+ total?: MultiCurrencyPriceNonNullableFields;
1137
+ additionalFees?: MultiCurrencyPriceNonNullableFields;
1138
+ }
1139
+ interface GiftCardNonNullableFields {
1140
+ id: string;
1141
+ obfuscatedCode: string;
1142
+ amount?: MultiCurrencyPriceNonNullableFields;
1143
+ appId: string;
1144
+ }
1145
+ interface ApplicationErrorNonNullableFields {
1146
+ code: string;
1147
+ description: string;
1148
+ }
1149
+ interface AutoTaxFallbackCalculationDetailsNonNullableFields {
1150
+ fallbackReason: FallbackReason;
1151
+ error?: ApplicationErrorNonNullableFields;
1152
+ }
1153
+ interface TaxCalculationDetailsNonNullableFields {
1154
+ manualRateReason: ManualCalculationReason;
1155
+ autoTaxFallbackDetails?: AutoTaxFallbackCalculationDetailsNonNullableFields;
1156
+ rateType: RateType;
1157
+ }
1158
+ interface AggregatedTaxBreakdownNonNullableFields {
1159
+ taxName: string;
1160
+ taxType: string;
1161
+ jurisdiction: string;
1162
+ jurisdictionTypeEnum: JurisdictionType;
1163
+ rate: string;
1164
+ aggregatedTaxAmount?: MultiCurrencyPriceNonNullableFields;
1165
+ aggregatedTaxableAmount?: MultiCurrencyPriceNonNullableFields;
1166
+ }
1167
+ interface TaxSummaryNonNullableFields {
1168
+ taxableAmount?: MultiCurrencyPriceNonNullableFields;
1169
+ totalTax?: MultiCurrencyPriceNonNullableFields;
1170
+ manualTaxRate: string;
1171
+ calculationDetails?: TaxCalculationDetailsNonNullableFields;
1172
+ totalExempt?: MultiCurrencyPriceNonNullableFields;
1173
+ aggregatedTaxBreakdown: AggregatedTaxBreakdownNonNullableFields[];
1174
+ }
1175
+ interface ShippingRegionNonNullableFields {
1176
+ id: string;
1177
+ name: string;
1178
+ }
1179
+ interface StreetAddressNonNullableFields {
1180
+ number: string;
1181
+ name: string;
1182
+ apt: string;
1183
+ }
1184
+ interface AddressNonNullableFields {
1185
+ streetAddress?: StreetAddressNonNullableFields;
1186
+ }
1187
+ interface PickupDetailsNonNullableFields {
1188
+ address?: AddressNonNullableFields;
1189
+ businessLocation: boolean;
1190
+ pickupMethod: PickupMethod;
1191
+ }
1192
+ interface DeliveryLogisticsNonNullableFields {
1193
+ pickupDetails?: PickupDetailsNonNullableFields;
1194
+ }
1195
+ interface SelectedCarrierServiceOptionPricesNonNullableFields {
1196
+ totalPriceAfterTax?: MultiCurrencyPriceNonNullableFields;
1197
+ totalPriceBeforeTax?: MultiCurrencyPriceNonNullableFields;
1198
+ taxDetails?: ItemTaxFullDetailsNonNullableFields;
1199
+ totalDiscount?: MultiCurrencyPriceNonNullableFields;
1200
+ price?: MultiCurrencyPriceNonNullableFields;
1201
+ }
1202
+ interface SelectedCarrierServiceOptionOtherChargeNonNullableFields {
1203
+ type: ChargeType;
1204
+ cost?: SelectedCarrierServiceOptionPricesNonNullableFields;
1205
+ }
1206
+ interface CarrierNonNullableFields {
1207
+ code: string;
1208
+ }
1209
+ interface ApplicableLineItemsNonNullableFields {
1210
+ lineItemIds: string[];
1211
+ }
1212
+ interface DeliveryAllocationNonNullableFields {
1213
+ deliveryCarrier?: CarrierNonNullableFields;
1214
+ applicableLineItems?: ApplicableLineItemsNonNullableFields;
1215
+ }
1216
+ interface SelectedCarrierServiceOptionNonNullableFields {
1217
+ code: string;
1218
+ title: string;
1219
+ logistics?: DeliveryLogisticsNonNullableFields;
1220
+ cost?: SelectedCarrierServiceOptionPricesNonNullableFields;
1221
+ requestedShippingOption: boolean;
1222
+ otherCharges: SelectedCarrierServiceOptionOtherChargeNonNullableFields[];
1223
+ deliveryAllocations: DeliveryAllocationNonNullableFields[];
1224
+ }
1225
+ interface OtherChargeNonNullableFields {
1226
+ type: ChargeType;
1227
+ price?: MultiCurrencyPriceNonNullableFields;
1228
+ }
1229
+ interface ShippingPriceNonNullableFields {
1230
+ price?: MultiCurrencyPriceNonNullableFields;
1231
+ otherCharges: OtherChargeNonNullableFields[];
1232
+ }
1233
+ interface ShippingOptionNonNullableFields {
1234
+ code: string;
1235
+ title: string;
1236
+ logistics?: DeliveryLogisticsNonNullableFields;
1237
+ cost?: ShippingPriceNonNullableFields;
1238
+ deliveryAllocations: DeliveryAllocationNonNullableFields[];
1239
+ }
1240
+ interface CarrierServiceOptionNonNullableFields {
1241
+ carrierId: string;
1242
+ shippingOptions: ShippingOptionNonNullableFields[];
1243
+ }
1244
+ interface ShippingInformationNonNullableFields {
1245
+ region?: ShippingRegionNonNullableFields;
1246
+ selectedCarrierServiceOption?: SelectedCarrierServiceOptionNonNullableFields;
1247
+ carrierServiceOptions: CarrierServiceOptionNonNullableFields[];
1248
+ }
1249
+ interface CouponNonNullableFields {
1250
+ id: string;
1251
+ code: string;
1252
+ amount?: MultiCurrencyPriceNonNullableFields;
1253
+ name: string;
1254
+ couponType: string;
1255
+ }
1256
+ interface MerchantDiscountNonNullableFields {
1257
+ amount?: MultiCurrencyPriceNonNullableFields;
1258
+ }
1259
+ interface DiscountRuleNameNonNullableFields {
1260
+ original: string;
1261
+ }
1262
+ interface DiscountRuleNonNullableFields {
1263
+ id: string;
1264
+ name?: DiscountRuleNameNonNullableFields;
1265
+ amount?: MultiCurrencyPriceNonNullableFields;
1266
+ }
1267
+ interface LineItemDiscountNonNullableFields {
1268
+ id: string;
1269
+ totalDiscountAmount?: MultiCurrencyPriceNonNullableFields;
1270
+ }
1271
+ interface AppliedDiscountNonNullableFields {
1272
+ coupon?: CouponNonNullableFields;
1273
+ merchantDiscount?: MerchantDiscountNonNullableFields;
1274
+ discountRule?: DiscountRuleNonNullableFields;
1275
+ discountType: DiscountType;
1276
+ lineItemIds: string[];
1277
+ lineItemDiscounts: LineItemDiscountNonNullableFields[];
1278
+ }
1279
+ interface FieldViolationNonNullableFields {
1280
+ field: string;
1281
+ description: string;
1282
+ violatedRule: RuleType;
1283
+ }
1284
+ interface ValidationErrorNonNullableFields {
1285
+ fieldViolations: FieldViolationNonNullableFields[];
1286
+ }
1287
+ interface DetailsNonNullableFields {
1288
+ applicationError?: ApplicationErrorNonNullableFields;
1289
+ validationError?: ValidationErrorNonNullableFields;
1290
+ }
1291
+ interface CarrierErrorNonNullableFields {
1292
+ carrierId: string;
1293
+ error?: DetailsNonNullableFields;
1294
+ }
1295
+ interface CarrierErrorsNonNullableFields {
1296
+ errors: CarrierErrorNonNullableFields[];
1297
+ }
1298
+ interface CalculationErrorsNonNullableFields {
1299
+ generalShippingCalculationError?: DetailsNonNullableFields;
1300
+ carrierErrors?: CarrierErrorsNonNullableFields;
1301
+ taxCalculationError?: DetailsNonNullableFields;
1302
+ couponCalculationError?: DetailsNonNullableFields;
1303
+ giftCardCalculationError?: DetailsNonNullableFields;
1304
+ orderValidationErrors: ApplicationErrorNonNullableFields[];
1305
+ membershipError?: DetailsNonNullableFields;
1306
+ discountsCalculationError?: DetailsNonNullableFields;
1307
+ }
1308
+ interface MembershipNameNonNullableFields {
1309
+ original: string;
1310
+ }
1311
+ interface MembershipPaymentCreditsNonNullableFields {
1312
+ total: number;
1313
+ remaining: number;
1314
+ }
1315
+ interface MembershipNonNullableFields {
1316
+ id: string;
1317
+ appId: string;
1318
+ name?: MembershipNameNonNullableFields;
1319
+ lineItemIds: string[];
1320
+ credits?: MembershipPaymentCreditsNonNullableFields;
1321
+ }
1322
+ interface InvalidMembershipNonNullableFields {
1323
+ membership?: MembershipNonNullableFields;
1324
+ reason: string;
1325
+ }
1326
+ interface SelectedMembershipNonNullableFields {
1327
+ id: string;
1328
+ appId: string;
1329
+ lineItemIds: string[];
1330
+ }
1331
+ interface MembershipOptionsNonNullableFields {
1332
+ eligibleMemberships: MembershipNonNullableFields[];
1333
+ invalidMemberships: InvalidMembershipNonNullableFields[];
1334
+ selectedMemberships: SelectedMembershipNonNullableFields[];
1335
+ }
1336
+ interface V1AdditionalFeeNonNullableFields {
1337
+ name: string;
1338
+ price?: MultiCurrencyPriceNonNullableFields;
1339
+ taxDetails?: ItemTaxFullDetailsNonNullableFields;
1340
+ priceBeforeTax?: MultiCurrencyPriceNonNullableFields;
1341
+ priceAfterTax?: MultiCurrencyPriceNonNullableFields;
1342
+ lineItemIds: string[];
1343
+ source: AdditionalFeeSource;
1344
+ }
1345
+ export interface CalculateTotalsResponseNonNullableFields {
1346
+ calculatedLineItems: CalculatedLineItemNonNullableFields[];
1347
+ priceSummary?: PriceSummaryNonNullableFields;
1348
+ giftCard?: GiftCardNonNullableFields;
1349
+ taxSummary?: TaxSummaryNonNullableFields;
1350
+ shippingInfo?: ShippingInformationNonNullableFields;
1351
+ appliedDiscounts: AppliedDiscountNonNullableFields[];
1352
+ calculationErrors?: CalculationErrorsNonNullableFields;
1353
+ weightUnit: WeightUnit;
1354
+ currency: string;
1355
+ conversionCurrency: string;
1356
+ taxIncludedInPrice: boolean;
1357
+ payNow?: PriceSummaryNonNullableFields;
1358
+ payLater?: PriceSummaryNonNullableFields;
1359
+ membershipOptions?: MembershipOptionsNonNullableFields;
1360
+ additionalFees: V1AdditionalFeeNonNullableFields[];
1361
+ siteCurrency: string;
1362
+ payNowTotalAfterGiftCard?: MultiCurrencyPriceNonNullableFields;
1363
+ totalAfterGiftCard?: MultiCurrencyPriceNonNullableFields;
1364
+ }
1365
+ export {};