@wix/auto_sdk_ecom_discount-rules 1.0.6 → 1.0.8

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 (134) 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-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
  11. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +36 -0
  12. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
  13. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
  14. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +271 -0
  15. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
  16. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
  17. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +123 -0
  18. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
  19. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
  20. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +98 -0
  21. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
  22. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
  23. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +76 -0
  24. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
  25. package/build/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.mts → cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
  26. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +359 -0
  27. package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.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-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
  39. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +25 -0
  40. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
  41. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
  42. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +263 -0
  43. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
  44. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
  45. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +92 -0
  46. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
  47. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
  48. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +82 -0
  49. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
  50. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
  51. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +73 -0
  52. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
  53. package/build/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.ts → es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
  54. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +328 -0
  55. package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.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-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
  66. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +36 -0
  67. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
  68. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
  69. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +271 -0
  70. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
  71. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
  72. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +123 -0
  73. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
  75. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +98 -0
  76. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
  77. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
  78. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +76 -0
  79. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
  80. package/build/internal/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.ts → cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
  81. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +359 -0
  82. package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.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-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
  93. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +25 -0
  94. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
  95. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
  96. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +263 -0
  97. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
  98. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
  99. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +92 -0
  100. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
  101. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
  102. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +82 -0
  103. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
  104. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
  105. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +73 -0
  106. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
  107. package/build/internal/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.mts → es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
  108. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +328 -0
  109. package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js.map +1 -0
  110. package/package.json +11 -12
  111. package/build/index.d.mts +0 -96
  112. package/build/index.d.ts +0 -96
  113. package/build/index.js +0 -606
  114. package/build/index.js.map +0 -1
  115. package/build/index.mjs +0 -567
  116. package/build/index.mjs.map +0 -1
  117. package/build/internal/index.d.mts +0 -96
  118. package/build/internal/index.d.ts +0 -96
  119. package/build/internal/index.js +0 -606
  120. package/build/internal/index.js.map +0 -1
  121. package/build/internal/index.mjs +0 -567
  122. package/build/internal/index.mjs.map +0 -1
  123. package/build/internal/meta.d.mts +0 -472
  124. package/build/internal/meta.d.ts +0 -472
  125. package/build/internal/meta.js +0 -352
  126. package/build/internal/meta.js.map +0 -1
  127. package/build/internal/meta.mjs +0 -321
  128. package/build/internal/meta.mjs.map +0 -1
  129. package/build/meta.d.mts +0 -472
  130. package/build/meta.d.ts +0 -472
  131. package/build/meta.js +0 -352
  132. package/build/meta.js.map +0 -1
  133. package/build/meta.mjs +0 -321
  134. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,823 @@
1
+ export interface DiscountRule {
2
+ /**
3
+ * Discount rule ID.
4
+ * @format GUID
5
+ * @readonly
6
+ */
7
+ id?: string | null;
8
+ /**
9
+ * Revision number, which increments by 1 each time the discount rule is updated.
10
+ * To prevent conflicting changes, the current `revision` must be passed when updating the discount rule.
11
+ * @readonly
12
+ */
13
+ revision?: string | null;
14
+ /**
15
+ * Date and time the discount rule was created.
16
+ * @readonly
17
+ */
18
+ createdDate?: Date | null;
19
+ /**
20
+ * Date and time the discount rule was last updated.
21
+ * @readonly
22
+ */
23
+ updatedDate?: Date | null;
24
+ /**
25
+ * Whether the discount rule is active.
26
+ *
27
+ * Default: `true`
28
+ */
29
+ active?: boolean | null;
30
+ /**
31
+ * Discount rule name.
32
+ * @minLength 1
33
+ * @maxLength 50
34
+ */
35
+ name?: string | null;
36
+ /**
37
+ * Discount rule trigger.
38
+ * A set of conditions that must be met for the `discounts` to be applied.
39
+ * Not passing a trigger will cause the discount to always apply.
40
+ */
41
+ trigger?: DiscountTrigger;
42
+ /** Time frame in which the discount rule is active. */
43
+ activeTimeInfo?: ActiveTimeInfo;
44
+ /**
45
+ * List of discounts that are applied when one or more triggers are met.
46
+ *
47
+ * > **Notes:**
48
+ * >
49
+ * > + Currently, only 1 discount can be defined per discount rule.
50
+ * > + A discount rule can be applied on multiple items per cart.
51
+ * > + A discount rule can only be applied once per item.
52
+ */
53
+ discounts?: Discounts;
54
+ /**
55
+ * Discount rule status.
56
+ * Default: `UNDEFINED`
57
+ * @readonly
58
+ */
59
+ status?: Status;
60
+ /**
61
+ * Number of times the discount rule was used.
62
+ * @readonly
63
+ */
64
+ usageCount?: number;
65
+ }
66
+ /** DiscountTrigger - description of a set of conditions, that if met, will trigger the associated rule actions */
67
+ export interface DiscountTrigger extends DiscountTriggerTriggerOneOf {
68
+ /** Chain multiple triggers with the `and` operator. */
69
+ and?: And;
70
+ /** Chain multiple triggers with the `or` operator. */
71
+ or?: Or;
72
+ /** Custom trigger. */
73
+ customTrigger?: Custom;
74
+ /** Subtotal trigger range. */
75
+ subtotalRange?: SubtotalRange;
76
+ /** Item quantity trigger range. */
77
+ itemQuantityRange?: ItemQuantityRange;
78
+ /** Trigger type. */
79
+ triggerType?: TriggerType;
80
+ }
81
+ /** @oneof */
82
+ export interface DiscountTriggerTriggerOneOf {
83
+ /** Chain multiple triggers with the `and` operator. */
84
+ and?: And;
85
+ /** Chain multiple triggers with the `or` operator. */
86
+ or?: Or;
87
+ /** Custom trigger. */
88
+ customTrigger?: Custom;
89
+ /** Subtotal trigger range. */
90
+ subtotalRange?: SubtotalRange;
91
+ /** Item quantity trigger range. */
92
+ itemQuantityRange?: ItemQuantityRange;
93
+ }
94
+ /**
95
+ * This object represents a scope of catalog items. Examples:
96
+ * 1. All catalog items of a specific app - type = CATALOG_ITEM, CatalogItemFilter with `catalog_app_id`
97
+ * 2. Specific catalog item - type = CATALOG_ITEM, CatalogItemFilter with `catalog_app_id` + `catalog_item_ids`
98
+ * 3. External catalog filter - type = CUSTOM_FILTER, CustomFilter with 'app_id' + 'params'
99
+ */
100
+ export interface Scope extends ScopeScopeItemsOneOf {
101
+ /** Catalog item filter. Must be passed with `type."CATALOG_ITEM"`. */
102
+ catalogItemFilter?: CatalogItemFilter;
103
+ /** Custom filter. Must be passed with `type."CATALOG_ITEM"`. */
104
+ customFilter?: CustomFilter;
105
+ /**
106
+ * Scope ID.
107
+ * @minLength 1
108
+ * @maxLength 100
109
+ */
110
+ id?: string;
111
+ /** Scope type. */
112
+ type?: ScopeType;
113
+ }
114
+ /** @oneof */
115
+ export interface ScopeScopeItemsOneOf {
116
+ /** Catalog item filter. Must be passed with `type."CATALOG_ITEM"`. */
117
+ catalogItemFilter?: CatalogItemFilter;
118
+ /** Custom filter. Must be passed with `type."CATALOG_ITEM"`. */
119
+ customFilter?: CustomFilter;
120
+ }
121
+ export declare enum ScopeType {
122
+ UNDEFINED_SCOPE = "UNDEFINED_SCOPE",
123
+ /** Specific catalog items */
124
+ CATALOG_ITEM = "CATALOG_ITEM",
125
+ /** Specific items by custom filters */
126
+ CUSTOM_FILTER = "CUSTOM_FILTER"
127
+ }
128
+ export interface CatalogItemFilter {
129
+ /**
130
+ * Catalog App ID. For example, the Wix Stores, Wix Bookings, or 3rd-party `appId`.
131
+ * @format GUID
132
+ */
133
+ catalogAppId?: string;
134
+ /**
135
+ * ID of the item within its Wix or 3rd-party catalog. For example, `productId` for Wix Stores.
136
+ * @minLength 1
137
+ * @maxLength 36
138
+ * @maxSize 50
139
+ */
140
+ catalogItemIds?: string[];
141
+ }
142
+ export interface CustomFilter {
143
+ /**
144
+ * Custom filter app ID, when relevant.
145
+ * @format GUID
146
+ */
147
+ appId?: string;
148
+ /**
149
+ * Custom filter in `{ "key": "value" }` form.
150
+ * For example, an array of `collectionIDs`:
151
+ * `{ ["collectionId": "12345"], ["collectionId": "67890"] }`.
152
+ */
153
+ params?: Record<string, any> | null;
154
+ }
155
+ export interface And {
156
+ /**
157
+ * List of triggers to have an "AND" operator between their results.
158
+ * @minSize 2
159
+ * @maxSize 5
160
+ */
161
+ triggers?: DiscountTrigger[];
162
+ }
163
+ export interface Or {
164
+ /**
165
+ * List of triggers to have an "OR" operator between their results.
166
+ * @minSize 2
167
+ * @maxSize 5
168
+ */
169
+ triggers?: DiscountTrigger[];
170
+ }
171
+ export interface Custom {
172
+ /**
173
+ * Trigger ID.
174
+ * @minLength 1
175
+ * @maxLength 100
176
+ */
177
+ id?: string;
178
+ /**
179
+ * ID of the app that created the trigger.
180
+ * @format GUID
181
+ */
182
+ appId?: string;
183
+ }
184
+ export interface SubtotalRange {
185
+ /**
186
+ * Relevant scopes for `SPECIFIC_ITEMS` target type.
187
+ * @maxSize 50
188
+ */
189
+ scopes?: Scope[];
190
+ /**
191
+ * Minimum subtotal price (inclusive).
192
+ * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }
193
+ */
194
+ from?: string | null;
195
+ /**
196
+ * Maximum subtotal price (inclusive).
197
+ * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }
198
+ */
199
+ to?: string | null;
200
+ }
201
+ export interface ItemQuantityRange {
202
+ /**
203
+ * Relevant scopes for `SPECIFIC_ITEMS` target type.
204
+ * @maxSize 50
205
+ */
206
+ scopes?: Scope[];
207
+ /**
208
+ * Minimum item quantity (inclusive).
209
+ * @min 1
210
+ */
211
+ from?: number | null;
212
+ /**
213
+ * Maximum item quantity (inclusive).
214
+ * @min 1
215
+ */
216
+ to?: number | null;
217
+ }
218
+ export declare enum TriggerType {
219
+ UNDEFINED = "UNDEFINED",
220
+ /** Operator used for chaining multiple triggers. Currently 1 `AND` chain operator is supported. */
221
+ AND = "AND",
222
+ /** Subtotal must be within the specified `subtotalRange` values. */
223
+ SUBTOTAL_RANGE = "SUBTOTAL_RANGE",
224
+ /** Quantity of items in scope must be within specified `itemQuantityRange` values. */
225
+ ITEM_QUANTITY_RANGE = "ITEM_QUANTITY_RANGE",
226
+ /** Custom trigger type defined in `customTrigger` object. */
227
+ CUSTOM = "CUSTOM",
228
+ /** Chain multiple triggers with OR operator */
229
+ OR = "OR"
230
+ }
231
+ export interface ActiveTimeInfo {
232
+ /** Date and time the discount rule is active **from**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format. */
233
+ start?: Date | null;
234
+ /** Date and time the discount rule is active **till**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format. */
235
+ end?: Date | null;
236
+ }
237
+ export interface Discounts {
238
+ /**
239
+ * Discounts.
240
+ * @minSize 1
241
+ * @maxSize 1
242
+ */
243
+ values?: Discount[];
244
+ }
245
+ export interface Discount extends DiscountDiscountOneOf {
246
+ /**
247
+ * Percentage to discount from original price.
248
+ * @min 0.1
249
+ * @max 100
250
+ */
251
+ percentage?: number;
252
+ /**
253
+ * Amount to discount from original price.
254
+ * @decimalValue options { gt:0, lte:1000000000000000, maxScale:4 }
255
+ */
256
+ fixedAmount?: string;
257
+ /**
258
+ * Fixed price. Line item will be fixed to this price.
259
+ * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }
260
+ */
261
+ fixedPrice?: string;
262
+ /**
263
+ * Discount target.
264
+ *
265
+ * + `SPECIFIC_ITEMS`: Discount applies to a specific set of items.
266
+ */
267
+ targetType?: Type;
268
+ /** Data related to `SPECIFIC_ITEMS` target type. */
269
+ specificItemsInfo?: SpecificItemsInfo;
270
+ /** Discount type. */
271
+ discountType?: DiscountType;
272
+ }
273
+ /** @oneof */
274
+ export interface DiscountDiscountOneOf {
275
+ /**
276
+ * Percentage to discount from original price.
277
+ * @min 0.1
278
+ * @max 100
279
+ */
280
+ percentage?: number;
281
+ /**
282
+ * Amount to discount from original price.
283
+ * @decimalValue options { gt:0, lte:1000000000000000, maxScale:4 }
284
+ */
285
+ fixedAmount?: string;
286
+ /**
287
+ * Fixed price. Line item will be fixed to this price.
288
+ * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }
289
+ */
290
+ fixedPrice?: string;
291
+ }
292
+ export declare enum Type {
293
+ /** Target type is not defined */
294
+ UNDEFINED = "UNDEFINED",
295
+ /** Target type is a set of specific items */
296
+ SPECIFIC_ITEMS = "SPECIFIC_ITEMS"
297
+ }
298
+ export interface SpecificItemsInfo {
299
+ /**
300
+ * All associated scopes for `SPECIFIC_ITEMS` target type.
301
+ * @minSize 1
302
+ * @maxSize 50
303
+ */
304
+ scopes?: Scope[];
305
+ }
306
+ export declare enum DiscountType {
307
+ UNDEFINED = "UNDEFINED",
308
+ /** Price is reduced by percentage value. */
309
+ PERCENTAGE = "PERCENTAGE",
310
+ /** Price is reduced by fixed amount. */
311
+ FIXED_AMOUNT = "FIXED_AMOUNT",
312
+ /** Price will be set to fixed amount. */
313
+ FIXED_PRICE = "FIXED_PRICE"
314
+ }
315
+ export interface BuyXGetYInfo {
316
+ /** Information about which items must be in the cart (buy X) for the discount to apply (get Y). */
317
+ customerBuys?: CustomerBuy;
318
+ /** Information about which items will be discounted (get Y). */
319
+ customerGets?: CustomerGet;
320
+ /**
321
+ * The maximum number of times the 'buy X get Y' discount can be applied.
322
+ * For example, when the value of `limit` is `2`, with a "2+1" sale on all items, the following logic applies:
323
+ * + Buy 2 get 1, buy 3 get 1.
324
+ * + Buy 4 get 2, buy 6 get 2, buy 9 get 2, and so on.
325
+ * @min 1
326
+ */
327
+ limit?: number | null;
328
+ }
329
+ export interface CustomerBuy extends CustomerBuyConditionOneOf {
330
+ /**
331
+ * Minimum number of items the customer must add to the cart to be eligible for a discount.
332
+ * @min 1
333
+ */
334
+ minimumQuantity?: number;
335
+ /**
336
+ * Minimum price the customer must add to the cart to be eligible for a discount.
337
+ * @decimalValue options { gte:0, lte:1000000000000000 }
338
+ */
339
+ minimumSpend?: string | null;
340
+ /**
341
+ * Scopes of the items that must be added to the cart to enable the discount.
342
+ * @minSize 1
343
+ * @maxSize 50
344
+ */
345
+ scopes?: Scope[];
346
+ }
347
+ /** @oneof */
348
+ export interface CustomerBuyConditionOneOf {
349
+ /**
350
+ * Minimum number of items the customer must add to the cart to be eligible for a discount.
351
+ * @min 1
352
+ */
353
+ minimumQuantity?: number;
354
+ /**
355
+ * Minimum price the customer must add to the cart to be eligible for a discount.
356
+ * @decimalValue options { gte:0, lte:1000000000000000 }
357
+ */
358
+ minimumSpend?: string | null;
359
+ }
360
+ export interface CustomerGet {
361
+ /**
362
+ * Exact number of items in the cart that will be discounted.
363
+ * If the cart contains fewer items than the value of quantity, the discount will not apply.
364
+ * @min 1
365
+ */
366
+ quantity?: number;
367
+ /**
368
+ * Scopes of the items that will be discounted.
369
+ * @minSize 1
370
+ * @maxSize 50
371
+ */
372
+ scopes?: Scope[];
373
+ }
374
+ export declare enum Status {
375
+ /** Rule status is not defined. */
376
+ UNDEFINED = "UNDEFINED",
377
+ /** Rule status is live. */
378
+ LIVE = "LIVE",
379
+ /** Rule status is expired, it might have been live in the past. */
380
+ EXPIRED = "EXPIRED",
381
+ /** Rule status is pending, it might be live in the future. */
382
+ PENDING = "PENDING"
383
+ }
384
+ /** The discount settings */
385
+ export interface DiscountSettings {
386
+ /** Discount applies to either `ALL_ITEMS`, or to the `LOWEST_PRICED_ITEM`. */
387
+ appliesTo?: AppliedSubjectType;
388
+ /**
389
+ * Whether the discount will apply to subscriptions.
390
+ *
391
+ * Default: `false`
392
+ */
393
+ includeSubscription?: boolean | null;
394
+ /**
395
+ * Maximum total number of uses allowed for the discount rule.
396
+ * @min 1
397
+ * @max 2147483646
398
+ */
399
+ usageLimit?: number | null;
400
+ /**
401
+ * The usage limit per user per discount.
402
+ * When not provided, this setting will not apply.
403
+ * @min 1
404
+ * @max 2147483646
405
+ */
406
+ usageLimitPerUser?: number | null;
407
+ }
408
+ /** TODO: check if can be removed */
409
+ export declare enum AppliedSubjectType {
410
+ UNDEFINED = "UNDEFINED",
411
+ /** Discount applies to all items at checkout. */
412
+ ALL_ITEMS = "ALL_ITEMS",
413
+ /** Discount applies to the lowest priced item at checkout. */
414
+ LOWEST_PRICED_ITEM = "LOWEST_PRICED_ITEM"
415
+ }
416
+ export interface ExtendedFields {
417
+ /**
418
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
419
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
420
+ *
421
+ * You can only access fields for which you have the appropriate permissions.
422
+ *
423
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
424
+ */
425
+ namespaces?: Record<string, Record<string, any>>;
426
+ }
427
+ export interface CreateDiscountRuleRequest {
428
+ /** Discount rule info. */
429
+ discountRule: DiscountRule;
430
+ }
431
+ export interface CreateDiscountRuleResponse {
432
+ /** Discount rule. */
433
+ discountRule?: DiscountRule;
434
+ }
435
+ export interface GetDiscountRuleRequest {
436
+ /**
437
+ * ID of the discount rule to retrieve.
438
+ * @format GUID
439
+ */
440
+ discountRuleId: string;
441
+ }
442
+ export interface GetDiscountRuleResponse {
443
+ /** The requested discount rule. */
444
+ discountRule?: DiscountRule;
445
+ }
446
+ export interface UpdateDiscountRuleRequest {
447
+ /** Discount rule info. */
448
+ discountRule: DiscountRule;
449
+ }
450
+ export interface UpdateDiscountRuleResponse {
451
+ /** Updated discount rule. */
452
+ discountRule?: DiscountRule;
453
+ }
454
+ export interface DeleteDiscountRuleRequest {
455
+ /**
456
+ * ID of the discount rule to delete.
457
+ * @format GUID
458
+ */
459
+ discountRuleId: string;
460
+ }
461
+ export interface DeleteDiscountRuleResponse {
462
+ }
463
+ export interface QueryDiscountRulesRequest {
464
+ /** Query options. */
465
+ query?: PlatformQuery;
466
+ }
467
+ export interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
468
+ /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
469
+ paging?: PlatformPaging;
470
+ /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
471
+ cursorPaging?: CursorPaging;
472
+ /** Filter object. */
473
+ filter?: Record<string, any> | null;
474
+ /** Sorting options. For example, `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`. */
475
+ sort?: Sorting[];
476
+ }
477
+ /** @oneof */
478
+ export interface PlatformQueryPagingMethodOneOf {
479
+ /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
480
+ paging?: PlatformPaging;
481
+ /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
482
+ cursorPaging?: CursorPaging;
483
+ }
484
+ export interface Sorting {
485
+ /**
486
+ * Name of the field to sort by.
487
+ * @maxLength 512
488
+ */
489
+ fieldName?: string;
490
+ /** Sort order. */
491
+ order?: SortOrder;
492
+ }
493
+ export declare enum SortOrder {
494
+ ASC = "ASC",
495
+ DESC = "DESC"
496
+ }
497
+ export interface PlatformPaging {
498
+ /**
499
+ * Number of items to load.
500
+ * @max 100
501
+ */
502
+ limit?: number | null;
503
+ /** Number of items to skip in the current sort order. */
504
+ offset?: number | null;
505
+ }
506
+ export interface CursorPaging {
507
+ /**
508
+ * Maximum number of items to return in the results.
509
+ * @max 100
510
+ */
511
+ limit?: number | null;
512
+ /**
513
+ * Pointer to the next or previous page in the list of results.
514
+ *
515
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
516
+ * Not relevant for the first request.
517
+ * @maxLength 16000
518
+ */
519
+ cursor?: string | null;
520
+ }
521
+ export interface QueryDiscountRulesResponse {
522
+ /** List of discount rules. */
523
+ discountRules?: DiscountRule[];
524
+ /** Details on the paged set of results returned. */
525
+ pagingMetadata?: PlatformPagingMetadata;
526
+ }
527
+ export interface PlatformPagingMetadata {
528
+ /** The number of items returned in this response. */
529
+ count?: number | null;
530
+ /** The offset which was requested. Returned if offset paging was used. */
531
+ offset?: number | null;
532
+ /** The total number of items that match the query. Returned if offset paging was used. */
533
+ total?: number | null;
534
+ /** Cursors to navigate through result pages. Returned if cursor paging was used. */
535
+ cursors?: Cursors;
536
+ }
537
+ export interface Cursors {
538
+ /**
539
+ * Cursor string pointing to the next page in the list of results.
540
+ * @maxLength 16000
541
+ */
542
+ next?: string | null;
543
+ /**
544
+ * Cursor pointing to the previous page in the list of results.
545
+ * @maxLength 16000
546
+ */
547
+ prev?: string | null;
548
+ }
549
+ export interface GetAppliedDiscountsRequest {
550
+ /**
551
+ * Line items for which to check for discount rules.
552
+ * @maxSize 1000
553
+ */
554
+ lineItems?: LineItem[];
555
+ /**
556
+ * Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.
557
+ * @format GUID
558
+ */
559
+ purchaseFlowId?: string | null;
560
+ }
561
+ export interface LineItem {
562
+ /**
563
+ * Line item ID.
564
+ * @minLength 1
565
+ * @maxLength 100
566
+ */
567
+ id?: string;
568
+ /**
569
+ * Line item quantity.
570
+ * @max 100000
571
+ */
572
+ quantity?: number | null;
573
+ /** Catalog and item reference info. Learn more about [integrating Wix Stores products with Wix eCommerce](https://dev.wix.com/api/rest/wix-stores/catalog/ecommerce-integration). */
574
+ catalogReference?: CatalogReference;
575
+ /**
576
+ * Line item price.
577
+ * @decimalValue options { gte:0 }
578
+ */
579
+ price?: string;
580
+ }
581
+ /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
582
+ export interface CatalogReference {
583
+ /**
584
+ * ID of the item within the catalog it belongs to.
585
+ * @minLength 1
586
+ * @maxLength 36
587
+ */
588
+ catalogItemId?: string;
589
+ /**
590
+ * ID of the app providing the catalog.
591
+ *
592
+ * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
593
+ *
594
+ * For items from Wix catalogs, the following values always apply:
595
+ * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
596
+ * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
597
+ * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
598
+ * @minLength 1
599
+ */
600
+ appId?: string;
601
+ /**
602
+ * 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.
603
+ *
604
+ * For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).
605
+ */
606
+ options?: Record<string, any> | null;
607
+ }
608
+ export interface GetAppliedDiscountsResponse {
609
+ /** All eligible discounts. */
610
+ appliedDiscounts?: AppliedDiscount[];
611
+ }
612
+ export interface AppliedDiscount {
613
+ /** Discount type. */
614
+ discountType?: Type;
615
+ /**
616
+ * IDs of line items the discount applies to, in GUID format.
617
+ * @format GUID
618
+ * @maxSize 1000
619
+ */
620
+ lineItemIds?: string[];
621
+ /** Applied discount rule. */
622
+ appliedDiscountRule?: AppliedDiscountRule;
623
+ }
624
+ export interface AppliedDiscountRule {
625
+ /**
626
+ * Applied discount rule ID.
627
+ * @format GUID
628
+ */
629
+ id?: string;
630
+ /** Discount rule name. */
631
+ name?: DiscountRuleName;
632
+ /** Total amount reduced from all discounted line items. */
633
+ amount?: MultiCurrencyPrice;
634
+ /** Discount rule type. */
635
+ discountRuleType?: DiscountType;
636
+ }
637
+ export interface DiscountRuleName {
638
+ /**
639
+ * Original discount rule name (in site's default language).
640
+ * @minLength 1
641
+ * @maxLength 256
642
+ */
643
+ original?: string;
644
+ /**
645
+ * Translated discount rule name according to buyer language.
646
+ *
647
+ * Default: `original`
648
+ * @minLength 1
649
+ * @maxLength 500
650
+ */
651
+ translated?: string | null;
652
+ }
653
+ export interface MultiCurrencyPrice {
654
+ /**
655
+ * Amount.
656
+ * @decimalValue options { gte:0, lte:1000000000000000 }
657
+ */
658
+ amount?: string;
659
+ /**
660
+ * Converted amount.
661
+ * @readonly
662
+ * @decimalValue options { gte:0, lte:1000000000000000 }
663
+ */
664
+ convertedAmount?: string;
665
+ /**
666
+ * Amount formatted with currency symbol.
667
+ * @readonly
668
+ */
669
+ formattedAmount?: string;
670
+ /**
671
+ * Converted amount formatted with currency symbol.
672
+ * @readonly
673
+ */
674
+ formattedConvertedAmount?: string;
675
+ }
676
+ export interface DomainEvent extends DomainEventBodyOneOf {
677
+ createdEvent?: EntityCreatedEvent;
678
+ updatedEvent?: EntityUpdatedEvent;
679
+ deletedEvent?: EntityDeletedEvent;
680
+ actionEvent?: ActionEvent;
681
+ /**
682
+ * Unique event ID.
683
+ * Allows clients to ignore duplicate webhooks.
684
+ */
685
+ id?: string;
686
+ /**
687
+ * Assumes actions are also always typed to an entity_type
688
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
689
+ */
690
+ entityFqdn?: string;
691
+ /**
692
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
693
+ * This is although the created/updated/deleted notion is duplication of the oneof types
694
+ * Example: created/updated/deleted/started/completed/email_opened
695
+ */
696
+ slug?: string;
697
+ /** ID of the entity associated with the event. */
698
+ entityId?: string;
699
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
700
+ eventTime?: Date | null;
701
+ /**
702
+ * Whether the event was triggered as a result of a privacy regulation application
703
+ * (for example, GDPR).
704
+ */
705
+ triggeredByAnonymizeRequest?: boolean | null;
706
+ /** If present, indicates the action that triggered the event. */
707
+ originatedFrom?: string | null;
708
+ /**
709
+ * A sequence number defining the order of updates to the underlying entity.
710
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
711
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
712
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
713
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
714
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
715
+ */
716
+ entityEventSequence?: string | null;
717
+ }
718
+ /** @oneof */
719
+ export interface DomainEventBodyOneOf {
720
+ createdEvent?: EntityCreatedEvent;
721
+ updatedEvent?: EntityUpdatedEvent;
722
+ deletedEvent?: EntityDeletedEvent;
723
+ actionEvent?: ActionEvent;
724
+ }
725
+ export interface EntityCreatedEvent {
726
+ entityAsJson?: string;
727
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
728
+ restoreInfo?: RestoreInfo;
729
+ }
730
+ export interface RestoreInfo {
731
+ deletedDate?: Date | null;
732
+ }
733
+ export interface EntityUpdatedEvent {
734
+ /**
735
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
736
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
737
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
738
+ */
739
+ currentEntityAsJson?: string;
740
+ }
741
+ export interface EntityDeletedEvent {
742
+ /** Entity that was deleted */
743
+ deletedEntityAsJson?: string | null;
744
+ }
745
+ export interface ActionEvent {
746
+ bodyAsJson?: string;
747
+ }
748
+ export interface Empty {
749
+ }
750
+ export interface DiscountRuleUsageLimitReached {
751
+ /** Discount Rule */
752
+ rule?: DiscountRule;
753
+ }
754
+ export interface MessageEnvelope {
755
+ /**
756
+ * App instance ID.
757
+ * @format GUID
758
+ */
759
+ instanceId?: string | null;
760
+ /**
761
+ * Event type.
762
+ * @maxLength 150
763
+ */
764
+ eventType?: string;
765
+ /** The identification type and identity data. */
766
+ identity?: IdentificationData;
767
+ /** Stringify payload. */
768
+ data?: string;
769
+ }
770
+ export interface IdentificationData extends IdentificationDataIdOneOf {
771
+ /**
772
+ * ID of a site visitor that has not logged in to the site.
773
+ * @format GUID
774
+ */
775
+ anonymousVisitorId?: string;
776
+ /**
777
+ * ID of a site visitor that has logged in to the site.
778
+ * @format GUID
779
+ */
780
+ memberId?: string;
781
+ /**
782
+ * ID of a Wix user (site owner, contributor, etc.).
783
+ * @format GUID
784
+ */
785
+ wixUserId?: string;
786
+ /**
787
+ * ID of an app.
788
+ * @format GUID
789
+ */
790
+ appId?: string;
791
+ /** @readonly */
792
+ identityType?: WebhookIdentityType;
793
+ }
794
+ /** @oneof */
795
+ export interface IdentificationDataIdOneOf {
796
+ /**
797
+ * ID of a site visitor that has not logged in to the site.
798
+ * @format GUID
799
+ */
800
+ anonymousVisitorId?: string;
801
+ /**
802
+ * ID of a site visitor that has logged in to the site.
803
+ * @format GUID
804
+ */
805
+ memberId?: string;
806
+ /**
807
+ * ID of a Wix user (site owner, contributor, etc.).
808
+ * @format GUID
809
+ */
810
+ wixUserId?: string;
811
+ /**
812
+ * ID of an app.
813
+ * @format GUID
814
+ */
815
+ appId?: string;
816
+ }
817
+ export declare enum WebhookIdentityType {
818
+ UNKNOWN = "UNKNOWN",
819
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
820
+ MEMBER = "MEMBER",
821
+ WIX_USER = "WIX_USER",
822
+ APP = "APP"
823
+ }