@wix/auto_sdk_loyalty_rewards 1.0.4 → 1.0.6

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/loyalty-v1-reward-rewards.context.d.ts +28 -0
  11. package/build/cjs/src/loyalty-v1-reward-rewards.context.js +34 -0
  12. package/build/cjs/src/loyalty-v1-reward-rewards.context.js.map +1 -0
  13. package/build/cjs/src/loyalty-v1-reward-rewards.http.d.ts +56 -0
  14. package/build/cjs/src/loyalty-v1-reward-rewards.http.js +464 -0
  15. package/build/cjs/src/loyalty-v1-reward-rewards.http.js.map +1 -0
  16. package/build/cjs/src/loyalty-v1-reward-rewards.meta.d.ts +26 -0
  17. package/build/cjs/src/loyalty-v1-reward-rewards.meta.js +180 -0
  18. package/build/cjs/src/loyalty-v1-reward-rewards.meta.js.map +1 -0
  19. package/build/cjs/src/loyalty-v1-reward-rewards.public.d.ts +107 -0
  20. package/build/cjs/src/loyalty-v1-reward-rewards.public.js +119 -0
  21. package/build/cjs/src/loyalty-v1-reward-rewards.public.js.map +1 -0
  22. package/build/{internal/loyalty-v1-reward-rewards.universal-DJFLdOGr.d.mts → cjs/src/loyalty-v1-reward-rewards.types.d.ts} +84 -193
  23. package/build/cjs/src/loyalty-v1-reward-rewards.types.js +29 -0
  24. package/build/cjs/src/loyalty-v1-reward-rewards.types.js.map +1 -0
  25. package/build/cjs/src/loyalty-v1-reward-rewards.universal.d.ts +920 -0
  26. package/build/cjs/src/loyalty-v1-reward-rewards.universal.js +373 -0
  27. package/build/cjs/src/loyalty-v1-reward-rewards.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/loyalty-v1-reward-rewards.context.d.ts +28 -0
  39. package/build/es/src/loyalty-v1-reward-rewards.context.js +28 -0
  40. package/build/es/src/loyalty-v1-reward-rewards.context.js.map +1 -0
  41. package/build/es/src/loyalty-v1-reward-rewards.http.d.ts +56 -0
  42. package/build/es/src/loyalty-v1-reward-rewards.http.js +453 -0
  43. package/build/es/src/loyalty-v1-reward-rewards.http.js.map +1 -0
  44. package/build/es/src/loyalty-v1-reward-rewards.meta.d.ts +26 -0
  45. package/build/es/src/loyalty-v1-reward-rewards.meta.js +146 -0
  46. package/build/es/src/loyalty-v1-reward-rewards.meta.js.map +1 -0
  47. package/build/es/src/loyalty-v1-reward-rewards.public.d.ts +107 -0
  48. package/build/es/src/loyalty-v1-reward-rewards.public.js +105 -0
  49. package/build/es/src/loyalty-v1-reward-rewards.public.js.map +1 -0
  50. package/build/{loyalty-v1-reward-rewards.universal-DJFLdOGr.d.mts → es/src/loyalty-v1-reward-rewards.types.d.ts} +84 -193
  51. package/build/es/src/loyalty-v1-reward-rewards.types.js +26 -0
  52. package/build/es/src/loyalty-v1-reward-rewards.types.js.map +1 -0
  53. package/build/es/src/loyalty-v1-reward-rewards.universal.d.ts +920 -0
  54. package/build/es/src/loyalty-v1-reward-rewards.universal.js +339 -0
  55. package/build/es/src/loyalty-v1-reward-rewards.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/loyalty-v1-reward-rewards.context.d.ts +28 -0
  66. package/build/internal/cjs/src/loyalty-v1-reward-rewards.context.js +34 -0
  67. package/build/internal/cjs/src/loyalty-v1-reward-rewards.context.js.map +1 -0
  68. package/build/internal/cjs/src/loyalty-v1-reward-rewards.http.d.ts +56 -0
  69. package/build/internal/cjs/src/loyalty-v1-reward-rewards.http.js +464 -0
  70. package/build/internal/cjs/src/loyalty-v1-reward-rewards.http.js.map +1 -0
  71. package/build/internal/cjs/src/loyalty-v1-reward-rewards.meta.d.ts +26 -0
  72. package/build/internal/cjs/src/loyalty-v1-reward-rewards.meta.js +180 -0
  73. package/build/internal/cjs/src/loyalty-v1-reward-rewards.meta.js.map +1 -0
  74. package/build/internal/cjs/src/loyalty-v1-reward-rewards.public.d.ts +107 -0
  75. package/build/internal/cjs/src/loyalty-v1-reward-rewards.public.js +119 -0
  76. package/build/internal/cjs/src/loyalty-v1-reward-rewards.public.js.map +1 -0
  77. package/build/{loyalty-v1-reward-rewards.universal-DJFLdOGr.d.ts → internal/cjs/src/loyalty-v1-reward-rewards.types.d.ts} +84 -193
  78. package/build/internal/cjs/src/loyalty-v1-reward-rewards.types.js +29 -0
  79. package/build/internal/cjs/src/loyalty-v1-reward-rewards.types.js.map +1 -0
  80. package/build/internal/cjs/src/loyalty-v1-reward-rewards.universal.d.ts +920 -0
  81. package/build/internal/cjs/src/loyalty-v1-reward-rewards.universal.js +373 -0
  82. package/build/internal/cjs/src/loyalty-v1-reward-rewards.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/loyalty-v1-reward-rewards.context.d.ts +28 -0
  93. package/build/internal/es/src/loyalty-v1-reward-rewards.context.js +28 -0
  94. package/build/internal/es/src/loyalty-v1-reward-rewards.context.js.map +1 -0
  95. package/build/internal/es/src/loyalty-v1-reward-rewards.http.d.ts +56 -0
  96. package/build/internal/es/src/loyalty-v1-reward-rewards.http.js +453 -0
  97. package/build/internal/es/src/loyalty-v1-reward-rewards.http.js.map +1 -0
  98. package/build/internal/es/src/loyalty-v1-reward-rewards.meta.d.ts +26 -0
  99. package/build/internal/es/src/loyalty-v1-reward-rewards.meta.js +146 -0
  100. package/build/internal/es/src/loyalty-v1-reward-rewards.meta.js.map +1 -0
  101. package/build/internal/es/src/loyalty-v1-reward-rewards.public.d.ts +107 -0
  102. package/build/internal/es/src/loyalty-v1-reward-rewards.public.js +105 -0
  103. package/build/internal/es/src/loyalty-v1-reward-rewards.public.js.map +1 -0
  104. package/build/internal/{loyalty-v1-reward-rewards.universal-DJFLdOGr.d.ts → es/src/loyalty-v1-reward-rewards.types.d.ts} +84 -193
  105. package/build/internal/es/src/loyalty-v1-reward-rewards.types.js +26 -0
  106. package/build/internal/es/src/loyalty-v1-reward-rewards.types.js.map +1 -0
  107. package/build/internal/es/src/loyalty-v1-reward-rewards.universal.d.ts +920 -0
  108. package/build/internal/es/src/loyalty-v1-reward-rewards.universal.js +339 -0
  109. package/build/internal/es/src/loyalty-v1-reward-rewards.universal.js.map +1 -0
  110. package/package.json +13 -14
  111. package/build/index.d.mts +0 -126
  112. package/build/index.d.ts +0 -126
  113. package/build/index.js +0 -834
  114. package/build/index.js.map +0 -1
  115. package/build/index.mjs +0 -797
  116. package/build/index.mjs.map +0 -1
  117. package/build/internal/index.d.mts +0 -126
  118. package/build/internal/index.d.ts +0 -126
  119. package/build/internal/index.js +0 -834
  120. package/build/internal/index.js.map +0 -1
  121. package/build/internal/index.mjs +0 -797
  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 -597
  126. package/build/internal/meta.js.map +0 -1
  127. package/build/internal/meta.mjs +0 -563
  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 -597
  132. package/build/meta.js.map +0 -1
  133. package/build/meta.mjs +0 -563
  134. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,920 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+ /**
3
+ * A loyalty reward is an object a customer can redeem with loyalty points.
4
+ * Redeeming a reward then creates a loyalty coupon that the customer can use.
5
+ */
6
+ export interface Reward extends RewardTypeDetailsOneOf {
7
+ /** Discount details. */
8
+ discountAmount?: DiscountAmount;
9
+ /** Coupon details. */
10
+ couponReward?: CouponReward;
11
+ /**
12
+ * Reward ID.
13
+ * @format GUID
14
+ * @readonly
15
+ */
16
+ _id?: string | null;
17
+ /**
18
+ * Reward name.
19
+ * @minLength 1
20
+ * @maxLength 50
21
+ */
22
+ name?: string;
23
+ /** Whether the reward is active. Default: `FALSE` */
24
+ active?: boolean;
25
+ /** Reward type. */
26
+ type?: RewardType;
27
+ /**
28
+ * Revision number, which increments by 1 each time the loyalty reward is updated.
29
+ *
30
+ * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty reward.
31
+ * @readonly
32
+ */
33
+ revision?: string | null;
34
+ /**
35
+ * Date and time the reward was created.
36
+ * @readonly
37
+ */
38
+ _createdDate?: Date | null;
39
+ /**
40
+ * Date and time the reward was last updated.
41
+ * @readonly
42
+ */
43
+ _updatedDate?: Date | null;
44
+ }
45
+ /** @oneof */
46
+ export interface RewardTypeDetailsOneOf {
47
+ /** Discount details. */
48
+ discountAmount?: DiscountAmount;
49
+ /** Coupon details. */
50
+ couponReward?: CouponReward;
51
+ }
52
+ /** Available reward types. */
53
+ export declare enum RewardType {
54
+ /** Undefined reward type. */
55
+ UNDEFINED = "UNDEFINED",
56
+ /** Discount reward. Special flexible reward type used in checkout. */
57
+ DISCOUNT_AMOUNT = "DISCOUNT_AMOUNT",
58
+ /** Coupon reward. [Learn more about coupons.](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards) */
59
+ COUPON_REWARD = "COUPON_REWARD",
60
+ /** For internal use. */
61
+ SPI_DISCOUNT_AMOUNT = "SPI_DISCOUNT_AMOUNT"
62
+ }
63
+ export interface DiscountAmount {
64
+ /**
65
+ * Discount details for each tier.
66
+ * @maxSize 21
67
+ */
68
+ configsByTier?: DiscountAmountConfig[];
69
+ }
70
+ export interface DiscountAmountConfig {
71
+ /**
72
+ * Discount amount. Must be a positive value.
73
+ * @format DECIMAL_VALUE
74
+ * @decimalValue options { gt:0, maxScale:2 }
75
+ */
76
+ amount?: string;
77
+ /**
78
+ * Tier ID, or empty if config applies to the base tier.
79
+ * @format GUID
80
+ */
81
+ tierId?: string | null;
82
+ /**
83
+ * Amount of points required to redeem the reward.
84
+ * @min 1
85
+ * @max 9999999
86
+ */
87
+ costInPoints?: number;
88
+ }
89
+ export interface CouponReward extends CouponRewardDiscountTypeOneOf, CouponRewardScopeOrMinSubtotalOneOf {
90
+ /** Discount as a fixed amount. */
91
+ fixedAmount?: FixedAmountDiscount;
92
+ /** Discount as a percentage. */
93
+ percentage?: PercentageDiscount;
94
+ /** Free shipping. */
95
+ freeShipping?: FreeShippingDiscount;
96
+ /** Limit the coupon to carts with a subtotal greater than this number. */
97
+ minimumSubtotal?: number;
98
+ /**
99
+ * Specifies the type of line items this coupon will apply to.
100
+ *
101
+ * For more information, see the Coupons API.
102
+ */
103
+ scope?: CouponScope;
104
+ /** Whether the coupon is limited to one item. */
105
+ limitedToOneItem?: boolean | null;
106
+ /**
107
+ * Whether the coupon applies to subscription products.
108
+ *
109
+ * If set to `true`, the discount will apply to all billing cycles.
110
+ */
111
+ appliesToSubscriptions?: boolean | null;
112
+ /**
113
+ * Reserved for internal use.
114
+ * @min 1
115
+ * @max 999
116
+ */
117
+ discountedCycleCount?: number | null;
118
+ }
119
+ /** @oneof */
120
+ export interface CouponRewardDiscountTypeOneOf {
121
+ /** Discount as a fixed amount. */
122
+ fixedAmount?: FixedAmountDiscount;
123
+ /** Discount as a percentage. */
124
+ percentage?: PercentageDiscount;
125
+ /** Free shipping. */
126
+ freeShipping?: FreeShippingDiscount;
127
+ }
128
+ /** @oneof */
129
+ export interface CouponRewardScopeOrMinSubtotalOneOf {
130
+ /** Limit the coupon to carts with a subtotal greater than this number. */
131
+ minimumSubtotal?: number;
132
+ /**
133
+ * Specifies the type of line items this coupon will apply to.
134
+ *
135
+ * For more information, see the Coupons API.
136
+ */
137
+ scope?: CouponScope;
138
+ }
139
+ export interface FixedAmountDiscount {
140
+ /**
141
+ * Discount details for each tier.
142
+ * @minSize 1
143
+ * @maxSize 21
144
+ */
145
+ configsByTier?: FixedAmountDiscountConfig[];
146
+ }
147
+ export interface FixedAmountDiscountConfig {
148
+ /**
149
+ * Tier ID, or empty if config applies to the base tier.
150
+ * @format GUID
151
+ */
152
+ tierId?: string | null;
153
+ /**
154
+ * Amount of points required to redeem the reward.
155
+ * @min 1
156
+ * @max 9999999
157
+ */
158
+ costInPoints?: number;
159
+ /** Discount amount. */
160
+ amount?: number;
161
+ }
162
+ export interface PercentageDiscount {
163
+ /**
164
+ * Discount details for each tier.
165
+ * @minSize 1
166
+ * @maxSize 21
167
+ */
168
+ configsByTier?: PercentageDiscountConfig[];
169
+ }
170
+ export interface PercentageDiscountConfig {
171
+ /**
172
+ * Tier ID, or empty if config applies to the base tier.
173
+ * @format GUID
174
+ */
175
+ tierId?: string | null;
176
+ /**
177
+ * Amount of points required to redeem the reward.
178
+ * @min 1
179
+ * @max 9999999
180
+ */
181
+ costInPoints?: number;
182
+ /** Percentage discount. */
183
+ percentage?: number;
184
+ }
185
+ export interface FreeShippingDiscount {
186
+ /**
187
+ * Discount details for each tier.
188
+ * @minSize 1
189
+ * @maxSize 21
190
+ */
191
+ configsByTier?: FreeShippingDiscountConfig[];
192
+ }
193
+ export interface FreeShippingDiscountConfig {
194
+ /**
195
+ * Tier ID, or empty if config applies to the base tier.
196
+ * @format GUID
197
+ */
198
+ tierId?: string | null;
199
+ /**
200
+ * Amount of points required to redeem the reward.
201
+ * @min 1
202
+ * @max 9999999
203
+ */
204
+ costInPoints?: number;
205
+ }
206
+ export interface CouponScope {
207
+ /**
208
+ * Scope namespace.
209
+ *
210
+ * See the Coupons API for valid namespaces.
211
+ */
212
+ namespace?: string;
213
+ /**
214
+ * Coupon scope's applied group.
215
+ *
216
+ * See the Coupons API for valid groups.
217
+ */
218
+ group?: Group;
219
+ }
220
+ export interface Group {
221
+ /**
222
+ * Name of coupon scope's group.
223
+ *
224
+ * See the Coupons API for valid groups.
225
+ */
226
+ name?: string;
227
+ /** Entity ID, if the coupon scope is limited to just one item. */
228
+ entityId?: string | null;
229
+ }
230
+ export interface SpiDiscountAmount {
231
+ /**
232
+ * Discount details for each tier.
233
+ * @maxSize 21
234
+ */
235
+ configsByTier?: DiscountAmountConfig[];
236
+ /**
237
+ * Description of the SPI discount amount reward. Taken from user input in the SPI config.
238
+ * @maxLength 200
239
+ */
240
+ description?: string;
241
+ }
242
+ export interface RewardDisabled {
243
+ }
244
+ export interface CreateRewardRequest {
245
+ /** Reward to create. */
246
+ reward: Reward;
247
+ }
248
+ export interface CreateRewardResponse {
249
+ /** Created reward. */
250
+ reward?: Reward;
251
+ }
252
+ export interface BulkCreateRewardsRequest {
253
+ /**
254
+ * Rewards to create.
255
+ * @minSize 1
256
+ * @maxSize 10
257
+ */
258
+ rewards: Reward[];
259
+ }
260
+ export interface BulkCreateRewardsResponse {
261
+ /** Created rewards. */
262
+ results?: BulkRewardResult[];
263
+ /** Total successes and failures of the bulk create rewards action. */
264
+ bulkActionMetadata?: BulkActionMetadata;
265
+ }
266
+ export interface BulkRewardResult {
267
+ /** Item metadata. */
268
+ itemMetadata?: ItemMetadata;
269
+ /** Created reward. */
270
+ item?: Reward;
271
+ }
272
+ export interface ItemMetadata {
273
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
274
+ _id?: string | null;
275
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
276
+ originalIndex?: number;
277
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
278
+ success?: boolean;
279
+ /** Details about the error in case of failure. */
280
+ error?: ApplicationError;
281
+ }
282
+ export interface ApplicationError {
283
+ /** Error code. */
284
+ code?: string;
285
+ /** Description of the error. */
286
+ description?: string;
287
+ /** Data related to the error. */
288
+ data?: Record<string, any> | null;
289
+ }
290
+ export interface BulkActionMetadata {
291
+ /** Number of items that were successfully processed. */
292
+ totalSuccesses?: number;
293
+ /** Number of items that couldn't be processed. */
294
+ totalFailures?: number;
295
+ /** Number of failures without details because detailed failure threshold was exceeded. */
296
+ undetailedFailures?: number;
297
+ }
298
+ export interface GetRewardRequest {
299
+ /**
300
+ * ID of the reward to retrieve.
301
+ * @format GUID
302
+ */
303
+ _id: string;
304
+ }
305
+ export interface GetRewardResponse {
306
+ /** Retrieved reward. */
307
+ reward?: Reward;
308
+ }
309
+ export interface BulkGetRewardsRequest {
310
+ }
311
+ export interface BulkGetRewardsResponse {
312
+ /** Found rewards per site. */
313
+ rewardsInSite?: RewardsInSite[];
314
+ }
315
+ export interface RewardsInSite {
316
+ /**
317
+ * Metasite id.
318
+ * @format GUID
319
+ */
320
+ metaSiteId?: string;
321
+ /** Rewards. */
322
+ rewards?: Reward[];
323
+ }
324
+ export interface QueryRewardsRequest {
325
+ /** Query parameters. */
326
+ query: CursorQuery;
327
+ }
328
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
329
+ /**
330
+ * Cursor paging options.
331
+ *
332
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
333
+ */
334
+ cursorPaging?: CursorPaging;
335
+ /**
336
+ * Filter object.
337
+ *
338
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
339
+ */
340
+ filter?: Record<string, any> | null;
341
+ /**
342
+ * Sort object.
343
+ *
344
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
345
+ * @maxSize 5
346
+ */
347
+ sort?: Sorting[];
348
+ }
349
+ /** @oneof */
350
+ export interface CursorQueryPagingMethodOneOf {
351
+ /**
352
+ * Cursor paging options.
353
+ *
354
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
355
+ */
356
+ cursorPaging?: CursorPaging;
357
+ }
358
+ export interface Sorting {
359
+ /**
360
+ * Name of the field to sort by.
361
+ * @maxLength 512
362
+ */
363
+ fieldName?: string;
364
+ /** Sort order. */
365
+ order?: SortOrder;
366
+ }
367
+ export declare enum SortOrder {
368
+ ASC = "ASC",
369
+ DESC = "DESC"
370
+ }
371
+ export interface CursorPaging {
372
+ /**
373
+ * Maximum number of items to return in the results.
374
+ * @max 100
375
+ */
376
+ limit?: number | null;
377
+ /**
378
+ * Pointer to the next or previous page in the list of results.
379
+ *
380
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
381
+ * Not relevant for the first request.
382
+ * @maxLength 16000
383
+ */
384
+ cursor?: string | null;
385
+ }
386
+ export interface QueryRewardsResponse {
387
+ /** Retrieved loyalty rewards. */
388
+ rewards?: Reward[];
389
+ /** Details on the paged set of results returned. */
390
+ pagingMetadata?: CursorPagingMetadata;
391
+ }
392
+ export interface CursorPagingMetadata {
393
+ /** Number of items returned in current page. */
394
+ count?: number | null;
395
+ /** Cursor strings that point to the next page, previous page, or both. */
396
+ cursors?: Cursors;
397
+ /**
398
+ * Whether there are more pages to retrieve following the current page.
399
+ *
400
+ * + `true`: Another page of results can be retrieved.
401
+ * + `false`: This is the last page.
402
+ */
403
+ hasNext?: boolean | null;
404
+ }
405
+ export interface Cursors {
406
+ /**
407
+ * Cursor string pointing to the next page in the list of results.
408
+ * @maxLength 16000
409
+ */
410
+ next?: string | null;
411
+ /**
412
+ * Cursor pointing to the previous page in the list of results.
413
+ * @maxLength 16000
414
+ */
415
+ prev?: string | null;
416
+ }
417
+ export interface UpdateRewardRequest {
418
+ /** Reward information to update. */
419
+ reward: Reward;
420
+ }
421
+ export interface UpdateRewardResponse {
422
+ /** Updated reward. */
423
+ reward?: Reward;
424
+ }
425
+ export interface DeleteRewardRequest {
426
+ /**
427
+ * ID of the reward to delete.
428
+ * @format GUID
429
+ */
430
+ _id: string;
431
+ /**
432
+ * Revision number, which increments by 1 each time the reward is updated.
433
+ *
434
+ * To prevent conflicting changes, the current `revision` must be passed when deleting the reward.
435
+ */
436
+ revision?: string;
437
+ }
438
+ export interface DeleteRewardResponse {
439
+ }
440
+ export interface ListRewardsRequest {
441
+ /** Pagination options. */
442
+ cursorPaging?: CursorPaging;
443
+ }
444
+ export interface ListRewardsResponse {
445
+ /** Retrieved loyalty rewards. */
446
+ rewards?: Reward[];
447
+ /** Details on the paged set of results returned. */
448
+ pagingMetadata?: PagingMetadataV2;
449
+ }
450
+ export interface PagingMetadataV2 {
451
+ /** Number of items returned in the response. */
452
+ count?: number | null;
453
+ /** Offset that was requested. */
454
+ offset?: number | null;
455
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
456
+ total?: number | null;
457
+ /** Flag that indicates the server failed to calculate the `total` field. */
458
+ tooManyToCount?: boolean | null;
459
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
460
+ cursors?: Cursors;
461
+ }
462
+ export interface ListRewardsInTierRequest {
463
+ /**
464
+ * Tier id.
465
+ * @format GUID
466
+ * @readonly
467
+ */
468
+ tierId?: string | null;
469
+ /** Pagination options. */
470
+ cursorPaging?: CursorPaging;
471
+ }
472
+ export interface ListRewardsInTierResponse {
473
+ /** Retrieved loyalty rewards. */
474
+ rewards?: Reward[];
475
+ /** Details on the paged set of results returned. */
476
+ pagingMetadata?: PagingMetadataV2;
477
+ }
478
+ export interface DomainEvent extends DomainEventBodyOneOf {
479
+ createdEvent?: EntityCreatedEvent;
480
+ updatedEvent?: EntityUpdatedEvent;
481
+ deletedEvent?: EntityDeletedEvent;
482
+ actionEvent?: ActionEvent;
483
+ /**
484
+ * Unique event ID.
485
+ * Allows clients to ignore duplicate webhooks.
486
+ */
487
+ _id?: string;
488
+ /**
489
+ * Assumes actions are also always typed to an entity_type
490
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
491
+ */
492
+ entityFqdn?: string;
493
+ /**
494
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
495
+ * This is although the created/updated/deleted notion is duplication of the oneof types
496
+ * Example: created/updated/deleted/started/completed/email_opened
497
+ */
498
+ slug?: string;
499
+ /** ID of the entity associated with the event. */
500
+ entityId?: string;
501
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
502
+ eventTime?: Date | null;
503
+ /**
504
+ * Whether the event was triggered as a result of a privacy regulation application
505
+ * (for example, GDPR).
506
+ */
507
+ triggeredByAnonymizeRequest?: boolean | null;
508
+ /** If present, indicates the action that triggered the event. */
509
+ originatedFrom?: string | null;
510
+ /**
511
+ * A sequence number defining the order of updates to the underlying entity.
512
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
513
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
514
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
515
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
516
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
517
+ */
518
+ entityEventSequence?: string | null;
519
+ }
520
+ /** @oneof */
521
+ export interface DomainEventBodyOneOf {
522
+ createdEvent?: EntityCreatedEvent;
523
+ updatedEvent?: EntityUpdatedEvent;
524
+ deletedEvent?: EntityDeletedEvent;
525
+ actionEvent?: ActionEvent;
526
+ }
527
+ export interface EntityCreatedEvent {
528
+ entity?: string;
529
+ }
530
+ export interface RestoreInfo {
531
+ deletedDate?: Date | null;
532
+ }
533
+ export interface EntityUpdatedEvent {
534
+ /**
535
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
536
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
537
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
538
+ */
539
+ currentEntity?: string;
540
+ }
541
+ export interface EntityDeletedEvent {
542
+ /** Entity that was deleted */
543
+ deletedEntity?: string | null;
544
+ }
545
+ export interface ActionEvent {
546
+ body?: string;
547
+ }
548
+ export interface Empty {
549
+ }
550
+ export interface MessageEnvelope {
551
+ /**
552
+ * App instance ID.
553
+ * @format GUID
554
+ */
555
+ instanceId?: string | null;
556
+ /**
557
+ * Event type.
558
+ * @maxLength 150
559
+ */
560
+ eventType?: string;
561
+ /** The identification type and identity data. */
562
+ identity?: IdentificationData;
563
+ /** Stringify payload. */
564
+ data?: string;
565
+ }
566
+ export interface IdentificationData extends IdentificationDataIdOneOf {
567
+ /**
568
+ * ID of a site visitor that has not logged in to the site.
569
+ * @format GUID
570
+ */
571
+ anonymousVisitorId?: string;
572
+ /**
573
+ * ID of a site visitor that has logged in to the site.
574
+ * @format GUID
575
+ */
576
+ memberId?: string;
577
+ /**
578
+ * ID of a Wix user (site owner, contributor, etc.).
579
+ * @format GUID
580
+ */
581
+ wixUserId?: string;
582
+ /**
583
+ * ID of an app.
584
+ * @format GUID
585
+ */
586
+ appId?: string;
587
+ /** @readonly */
588
+ identityType?: WebhookIdentityType;
589
+ }
590
+ /** @oneof */
591
+ export interface IdentificationDataIdOneOf {
592
+ /**
593
+ * ID of a site visitor that has not logged in to the site.
594
+ * @format GUID
595
+ */
596
+ anonymousVisitorId?: string;
597
+ /**
598
+ * ID of a site visitor that has logged in to the site.
599
+ * @format GUID
600
+ */
601
+ memberId?: string;
602
+ /**
603
+ * ID of a Wix user (site owner, contributor, etc.).
604
+ * @format GUID
605
+ */
606
+ wixUserId?: string;
607
+ /**
608
+ * ID of an app.
609
+ * @format GUID
610
+ */
611
+ appId?: string;
612
+ }
613
+ export declare enum WebhookIdentityType {
614
+ UNKNOWN = "UNKNOWN",
615
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
616
+ MEMBER = "MEMBER",
617
+ WIX_USER = "WIX_USER",
618
+ APP = "APP"
619
+ }
620
+ export interface BaseEventMetadata {
621
+ /**
622
+ * App instance ID.
623
+ * @format GUID
624
+ */
625
+ instanceId?: string | null;
626
+ /**
627
+ * Event type.
628
+ * @maxLength 150
629
+ */
630
+ eventType?: string;
631
+ /** The identification type and identity data. */
632
+ identity?: IdentificationData;
633
+ }
634
+ export interface EventMetadata extends BaseEventMetadata {
635
+ /**
636
+ * Unique event ID.
637
+ * Allows clients to ignore duplicate webhooks.
638
+ */
639
+ _id?: string;
640
+ /**
641
+ * Assumes actions are also always typed to an entity_type
642
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
643
+ */
644
+ entityFqdn?: string;
645
+ /**
646
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
647
+ * This is although the created/updated/deleted notion is duplication of the oneof types
648
+ * Example: created/updated/deleted/started/completed/email_opened
649
+ */
650
+ slug?: string;
651
+ /** ID of the entity associated with the event. */
652
+ entityId?: string;
653
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
654
+ eventTime?: Date | null;
655
+ /**
656
+ * Whether the event was triggered as a result of a privacy regulation application
657
+ * (for example, GDPR).
658
+ */
659
+ triggeredByAnonymizeRequest?: boolean | null;
660
+ /** If present, indicates the action that triggered the event. */
661
+ originatedFrom?: string | null;
662
+ /**
663
+ * A sequence number defining the order of updates to the underlying entity.
664
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
665
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
666
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
667
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
668
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
669
+ */
670
+ entityEventSequence?: string | null;
671
+ }
672
+ export interface RewardCreatedEnvelope {
673
+ entity: Reward;
674
+ metadata: EventMetadata;
675
+ }
676
+ /**
677
+ * Triggered when a reward is created.
678
+ * @permissionScope Read Loyalty
679
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
680
+ * @permissionScope Manage Loyalty
681
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
682
+ * @permissionId LOYALTY.READ_REWARDS
683
+ * @webhook
684
+ * @eventType wix.loyalty.v1.reward_created
685
+ * @serviceIdentifier com.wixpress.loyalty.reward.LoyaltyRewards
686
+ * @slug created
687
+ */
688
+ export declare function onRewardCreated(handler: (event: RewardCreatedEnvelope) => void | Promise<void>): void;
689
+ export interface RewardDeletedEnvelope {
690
+ metadata: EventMetadata;
691
+ }
692
+ /**
693
+ * Triggered when a reward is deleted.
694
+ * @permissionScope Read Loyalty
695
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
696
+ * @permissionScope Manage Loyalty
697
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
698
+ * @permissionId LOYALTY.READ_REWARDS
699
+ * @webhook
700
+ * @eventType wix.loyalty.v1.reward_deleted
701
+ * @serviceIdentifier com.wixpress.loyalty.reward.LoyaltyRewards
702
+ * @slug deleted
703
+ */
704
+ export declare function onRewardDeleted(handler: (event: RewardDeletedEnvelope) => void | Promise<void>): void;
705
+ export interface RewardUpdatedEnvelope {
706
+ entity: Reward;
707
+ metadata: EventMetadata;
708
+ }
709
+ /**
710
+ * Triggered when a reward is updated.
711
+ * @permissionScope Read Loyalty
712
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
713
+ * @permissionScope Manage Loyalty
714
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
715
+ * @permissionId LOYALTY.READ_REWARDS
716
+ * @webhook
717
+ * @eventType wix.loyalty.v1.reward_updated
718
+ * @serviceIdentifier com.wixpress.loyalty.reward.LoyaltyRewards
719
+ * @slug updated
720
+ */
721
+ export declare function onRewardUpdated(handler: (event: RewardUpdatedEnvelope) => void | Promise<void>): void;
722
+ type RewardNonNullablePaths = `discountAmount.configsByTier` | `discountAmount.configsByTier.${number}.amount` | `discountAmount.configsByTier.${number}.costInPoints` | `couponReward.fixedAmount.configsByTier` | `couponReward.fixedAmount.configsByTier.${number}.costInPoints` | `couponReward.fixedAmount.configsByTier.${number}.amount` | `couponReward.percentage.configsByTier` | `couponReward.percentage.configsByTier.${number}.costInPoints` | `couponReward.percentage.configsByTier.${number}.percentage` | `couponReward.freeShipping.configsByTier` | `couponReward.freeShipping.configsByTier.${number}.costInPoints` | `couponReward.minimumSubtotal` | `couponReward.scope.namespace` | `couponReward.scope.group.name` | `name` | `active` | `type`;
723
+ /**
724
+ * Creates a reward that can be redeemed with loyalty points.
725
+ *
726
+ * When a customer redeems a reward, a loyalty coupon is created
727
+ * based on the specifications detailed in either the `discountAmount` or `couponReward` fields. This coupon can
728
+ * then be used by the customer to receive the discount. Note that while the Rewards API uses coupon scopes and specifications,
729
+ * no coupon is actually created until a reward is redeemed with points.
730
+ * See the Coupons API for more information about coupons.
731
+ *
732
+ * A reward's `active` status defaults to `false`. To make the reward available to customers,
733
+ * either set the `active` field to `true` during creation or call [`updateReward()`](#updatereward)
734
+ * to change the status.
735
+ *
736
+ * To customize a reward for each loyalty tier, use the `configsByTier` parameter.
737
+ * This allows you to specify the amount of the earned discount, the cost in loyalty points
738
+ * to redeem the reward, and the tier to which this configuration applies. Each tier requires its own
739
+ * `configsByTier` configuration. To create a reward that is available to loyalty accounts in the base tier,
740
+ * leave the `tierId` field empty. See the Loyalty Tiers API for more information on tiers.
741
+ * @param reward - Reward to create.
742
+ * @public
743
+ * @requiredField reward
744
+ * @requiredField reward.name
745
+ * @requiredField reward.typeDetails
746
+ * @permissionId LOYALTY.MANAGE_REWARDS
747
+ * @permissionScope Manage Loyalty
748
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
749
+ * @applicableIdentity APP
750
+ * @returns Created reward.
751
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.CreateReward
752
+ */
753
+ export declare function createReward(reward: NonNullablePaths<Reward, `name`>): Promise<NonNullablePaths<Reward, RewardNonNullablePaths>>;
754
+ /**
755
+ * Creates multiple rewards.
756
+ * @param rewards - Rewards to create.
757
+ * @public
758
+ * @requiredField rewards
759
+ * @requiredField rewards.name
760
+ * @requiredField rewards.typeDetails
761
+ * @permissionId LOYALTY.MANAGE_REWARDS
762
+ * @permissionScope Manage Loyalty
763
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
764
+ * @applicableIdentity APP
765
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.BulkCreateRewards
766
+ */
767
+ export declare function bulkCreateRewards(rewards: NonNullablePaths<Reward, `name`>[]): Promise<NonNullablePaths<BulkCreateRewardsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
768
+ [P in RewardNonNullablePaths]: `results.${number}.item.${P}`;
769
+ }[RewardNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
770
+ /**
771
+ * Retrieves a reward.
772
+ * @param _id - ID of the reward to retrieve.
773
+ * @public
774
+ * @requiredField _id
775
+ * @permissionId LOYALTY.READ_REWARDS
776
+ * @permissionScope Read Loyalty
777
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
778
+ * @permissionScope Manage Loyalty
779
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
780
+ * @applicableIdentity APP
781
+ * @applicableIdentity VISITOR
782
+ * @returns Retrieved reward.
783
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.GetReward
784
+ */
785
+ export declare function getReward(_id: string): Promise<NonNullablePaths<Reward, RewardNonNullablePaths>>;
786
+ /**
787
+ * Retrieves rewards from all metasites that the caller is the member of.
788
+ *
789
+ * Must be called with user identity.
790
+ * @public
791
+ * @documentationMaturity preview
792
+ * @permissionId LOYALTY.REWARD_BULK_READ
793
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.BulkGetRewards
794
+ */
795
+ export declare function bulkGetRewards(): Promise<NonNullablePaths<BulkGetRewardsResponse, `rewardsInSite` | `rewardsInSite.${number}.metaSiteId` | {
796
+ [P in RewardNonNullablePaths]: `rewardsInSite.${number}.rewards.${number}.${P}`;
797
+ }[RewardNonNullablePaths]>>;
798
+ /**
799
+ * Retrieves a list of rewards, given the provided paging, filtering, and sorting.
800
+ *
801
+ * Query Rewards runs with these defaults, which you can override: `cursorPaging.limit` is `50`.
802
+ *
803
+ * To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),[Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
804
+ * @param query - Query parameters.
805
+ * @public
806
+ * @requiredField query
807
+ * @permissionId LOYALTY.READ_REWARDS
808
+ * @permissionScope Read Loyalty
809
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
810
+ * @permissionScope Manage Loyalty
811
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
812
+ * @applicableIdentity APP
813
+ * @applicableIdentity VISITOR
814
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.QueryRewards
815
+ */
816
+ export declare function queryRewards(query: CursorQuery): Promise<NonNullablePaths<QueryRewardsResponse, {
817
+ [P in RewardNonNullablePaths]: `rewards.${number}.${P}`;
818
+ }[RewardNonNullablePaths]>>;
819
+ /**
820
+ * Updates a loyalty reward.
821
+ *
822
+ * Use this endpoint to update details of a reward, such as the name, whether or not a reward is active,
823
+ * or the amount of points it costs to redeem. Also use this endpoint to add new tiers that are eligible to redeem a reward.
824
+ *
825
+ * You may not change the `type` of a reward. That is set upon creation and cannot be updated.
826
+ * @param _id - Reward ID.
827
+ * @public
828
+ * @requiredField _id
829
+ * @requiredField reward
830
+ * @requiredField reward.name
831
+ * @requiredField reward.revision
832
+ * @requiredField reward.typeDetails
833
+ * @param reward - Reward info to update.
834
+ * @permissionId LOYALTY.MANAGE_REWARDS
835
+ * @permissionScope Manage Loyalty
836
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
837
+ * @applicableIdentity APP
838
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.UpdateReward
839
+ */
840
+ export declare function updateReward(_id: string, reward: NonNullablePaths<UpdateReward, `name` | `revision`>): Promise<NonNullablePaths<UpdateRewardResponse, {
841
+ [P in RewardNonNullablePaths]: `reward.${P}`;
842
+ }[RewardNonNullablePaths]>>;
843
+ export interface UpdateReward {
844
+ /** Discount details. */
845
+ discountAmount?: DiscountAmount;
846
+ /** Coupon details. */
847
+ couponReward?: CouponReward;
848
+ /**
849
+ * Reward ID.
850
+ * @format GUID
851
+ * @readonly
852
+ */
853
+ _id?: string | null;
854
+ /**
855
+ * Reward name.
856
+ * @minLength 1
857
+ * @maxLength 50
858
+ */
859
+ name?: string;
860
+ /** Whether the reward is active. Default: `FALSE` */
861
+ active?: boolean;
862
+ /** Reward type. */
863
+ type?: RewardType;
864
+ /**
865
+ * Revision number, which increments by 1 each time the loyalty reward is updated.
866
+ *
867
+ * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty reward.
868
+ * @readonly
869
+ */
870
+ revision?: string | null;
871
+ /**
872
+ * Date and time the reward was created.
873
+ * @readonly
874
+ */
875
+ _createdDate?: Date | null;
876
+ /**
877
+ * Date and time the reward was last updated.
878
+ * @readonly
879
+ */
880
+ _updatedDate?: Date | null;
881
+ }
882
+ /**
883
+ * Deletes a reward.
884
+ * @param _id - ID of the reward to delete.
885
+ * @param revision - Revision number, which increments by 1 each time the reward is updated.
886
+ *
887
+ * To prevent conflicting changes, the current `revision` must be passed when deleting the reward.
888
+ * @public
889
+ * @requiredField _id
890
+ * @requiredField revision
891
+ * @permissionId LOYALTY.MANAGE_REWARDS
892
+ * @permissionScope Manage Loyalty
893
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
894
+ * @applicableIdentity APP
895
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.DeleteReward
896
+ */
897
+ export declare function deleteReward(_id: string, revision: string): Promise<void>;
898
+ /**
899
+ * Retrieves a list of rewards.
900
+ *
901
+ * The list includes rewards that are currently nonredeemable due to insufficient points held by any customers.
902
+ * @public
903
+ * @param options - List options.
904
+ * @permissionId LOYALTY.READ_REWARDS
905
+ * @permissionScope Read Loyalty
906
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
907
+ * @permissionScope Manage Loyalty
908
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
909
+ * @applicableIdentity APP
910
+ * @applicableIdentity VISITOR
911
+ * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.ListRewards
912
+ */
913
+ export declare function listRewards(options?: ListRewardsOptions): Promise<NonNullablePaths<ListRewardsResponse, {
914
+ [P in RewardNonNullablePaths]: `rewards.${number}.${P}`;
915
+ }[RewardNonNullablePaths]>>;
916
+ export interface ListRewardsOptions {
917
+ /** Pagination options. */
918
+ cursorPaging?: CursorPaging;
919
+ }
920
+ export {};