@wix/auto_sdk_loyalty_coupons 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.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.context.d.ts +22 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.context.js +29 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.http.js +389 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.meta.js +161 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.public.js +98 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.types.d.ts +580 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.types.js +41 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.universal.d.ts +824 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.universal.js +354 -0
- package/build/cjs/src/loyalty-v1-coupon-coupons.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/loyalty-v1-coupon-coupons.context.d.ts +22 -0
- package/build/es/src/loyalty-v1-coupon-coupons.context.js +22 -0
- package/build/es/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
- package/build/es/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
- package/build/es/src/loyalty-v1-coupon-coupons.http.js +379 -0
- package/build/es/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
- package/build/es/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
- package/build/es/src/loyalty-v1-coupon-coupons.meta.js +128 -0
- package/build/es/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
- package/build/es/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
- package/build/es/src/loyalty-v1-coupon-coupons.public.js +84 -0
- package/build/es/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
- package/build/es/src/loyalty-v1-coupon-coupons.types.d.ts +580 -0
- package/build/es/src/loyalty-v1-coupon-coupons.types.js +38 -0
- package/build/es/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
- package/build/es/src/loyalty-v1-coupon-coupons.universal.d.ts +824 -0
- package/build/es/src/loyalty-v1-coupon-coupons.universal.js +321 -0
- package/build/es/src/loyalty-v1-coupon-coupons.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.context.d.ts +22 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.context.js +29 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.http.js +389 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.meta.js +161 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.public.js +98 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.types.d.ts +580 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.types.js +41 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.universal.d.ts +824 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.universal.js +354 -0
- package/build/internal/cjs/src/loyalty-v1-coupon-coupons.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.context.d.ts +22 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.context.js +22 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.http.js +379 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.meta.js +128 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.public.js +84 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.types.d.ts +580 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.types.js +38 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.universal.d.ts +824 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.universal.js +321 -0
- package/build/internal/es/src/loyalty-v1-coupon-coupons.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,824 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A loyalty coupon is created when a customer redeems their loyalty points for a reward. Creating a loyalty coupon
|
|
3
|
+
* also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
|
|
4
|
+
*/
|
|
5
|
+
export interface LoyaltyCoupon {
|
|
6
|
+
/**
|
|
7
|
+
* Loyalty coupon ID.
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
_id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* [Loyalty account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer that redeemed points for a coupon.
|
|
13
|
+
* @readonly
|
|
14
|
+
*/
|
|
15
|
+
accountId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* [Member ID](https://dev.wix.com/api/rest/members/members/member-object) of the customer that redeemed points for a coupon.
|
|
18
|
+
* @readonly
|
|
19
|
+
* @deprecated [Member ID](https://dev.wix.com/api/rest/members/members/member-object) of the customer that redeemed points for a coupon.
|
|
20
|
+
* @replacedBy member_id
|
|
21
|
+
* @targetRemovalDate 2024-06-01
|
|
22
|
+
*/
|
|
23
|
+
memberIdDeprecated?: string;
|
|
24
|
+
/**
|
|
25
|
+
* [Member ID](https://dev.wix.com/docs/rest/crm/members-contacts/members/members/member-object) of the customer that redeemed points for a coupon.
|
|
26
|
+
* @readonly
|
|
27
|
+
*/
|
|
28
|
+
memberId?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Transaction ID for the transaction that created a coupon.
|
|
31
|
+
* @readonly
|
|
32
|
+
*/
|
|
33
|
+
transactionId?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Reference coupon information for the corresponding [coupon](https://dev.wix.com/api/rest/coupons/about-wix-coupons)
|
|
36
|
+
* that is created along with the loyalty coupon.
|
|
37
|
+
* @readonly
|
|
38
|
+
*/
|
|
39
|
+
couponReference?: CouponReference;
|
|
40
|
+
/**
|
|
41
|
+
* Loyalty coupon status.
|
|
42
|
+
*
|
|
43
|
+
* This status relates to the corresponding coupon that is created
|
|
44
|
+
* at the same time as the loyalty coupon and is included in `couponReference`.
|
|
45
|
+
* @readonly
|
|
46
|
+
*/
|
|
47
|
+
status?: Status;
|
|
48
|
+
/**
|
|
49
|
+
* Name of reward that was redeemed to create this coupon.
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
rewardName?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Revision number, which increments by 1 each time the loyalty coupon is updated.
|
|
55
|
+
*
|
|
56
|
+
* To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
|
|
57
|
+
*/
|
|
58
|
+
revision?: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Date and time the loyalty coupon was created.
|
|
61
|
+
* @readonly
|
|
62
|
+
*/
|
|
63
|
+
_createdDate?: Date | null;
|
|
64
|
+
/**
|
|
65
|
+
* Date and time the loyalty coupon was last updated.
|
|
66
|
+
* @readonly
|
|
67
|
+
*/
|
|
68
|
+
_updatedDate?: Date | null;
|
|
69
|
+
}
|
|
70
|
+
export interface CouponReference {
|
|
71
|
+
/**
|
|
72
|
+
* Coupon ID.
|
|
73
|
+
* @readonly
|
|
74
|
+
*/
|
|
75
|
+
couponId?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Coupon code.
|
|
78
|
+
*
|
|
79
|
+
* Unique code entered by a customer to apply the coupon.
|
|
80
|
+
* @readonly
|
|
81
|
+
*/
|
|
82
|
+
code?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Name of coupon.
|
|
85
|
+
* @readonly
|
|
86
|
+
*/
|
|
87
|
+
name?: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* The information to use when creating the coupon.
|
|
90
|
+
* @readonly
|
|
91
|
+
*/
|
|
92
|
+
specification?: Specification;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the referenced coupon was deleted.
|
|
95
|
+
* @readonly
|
|
96
|
+
*/
|
|
97
|
+
deleted?: boolean | null;
|
|
98
|
+
}
|
|
99
|
+
export interface Specification extends SpecificationTypeDetailsOneOf, SpecificationScopeOrMinSubtotalOneOf {
|
|
100
|
+
/** Fixed price discount. */
|
|
101
|
+
moneyOffAmount?: number;
|
|
102
|
+
/** Discount as a percentage. */
|
|
103
|
+
percentOffRate?: number;
|
|
104
|
+
/** Free shipping. If true, the coupon applies to all items in all `namespaces` in the site. */
|
|
105
|
+
freeShipping?: boolean;
|
|
106
|
+
/** Specific sale price. Currently only supported for coupons with a `stores` `namespace`. */
|
|
107
|
+
fixedPriceAmount?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the
|
|
110
|
+
* following scenario: if a visitor purchases x number of products, they receive y number of products for free. C
|
|
111
|
+
* urrently only supported for coupons with a `stores` `namespace`.
|
|
112
|
+
*/
|
|
113
|
+
buyXGetY?: BuyXGetY;
|
|
114
|
+
/**
|
|
115
|
+
* Scope of the coupon. When no scope is defined, the coupon applies to all
|
|
116
|
+
* items in all `namespaces` in the site.
|
|
117
|
+
*/
|
|
118
|
+
scope?: Scope;
|
|
119
|
+
/** The coupon is only applicable when the order subtotal is over this amount. */
|
|
120
|
+
minimumSubtotal?: number | null;
|
|
121
|
+
/** Name of coupon. */
|
|
122
|
+
name?: string | null;
|
|
123
|
+
type?: Type;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items
|
|
126
|
+
* that the coupon applies to, only the lowest priced item is discounted.
|
|
127
|
+
* Coupons with a `bookings` `namespace` are always limited to 1 item.
|
|
128
|
+
*/
|
|
129
|
+
limitedToOneItem?: boolean | null;
|
|
130
|
+
/** Whether the coupon also applies to subscriptions. */
|
|
131
|
+
appliesToSubscriptions?: boolean | null;
|
|
132
|
+
/**
|
|
133
|
+
* Specifies the amount of cycles to apply the discount to for a subscription item.
|
|
134
|
+
*
|
|
135
|
+
* Can only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`.
|
|
136
|
+
* If `discountedCycleCount` is empty, the coupon applies to all available cycles.
|
|
137
|
+
*
|
|
138
|
+
* Min: `1`
|
|
139
|
+
*
|
|
140
|
+
* Max: `999`
|
|
141
|
+
*/
|
|
142
|
+
discountedCycleCount?: number | null;
|
|
143
|
+
}
|
|
144
|
+
/** @oneof */
|
|
145
|
+
export interface SpecificationTypeDetailsOneOf {
|
|
146
|
+
/** Fixed price discount. */
|
|
147
|
+
moneyOffAmount?: number;
|
|
148
|
+
/** Discount as a percentage. */
|
|
149
|
+
percentOffRate?: number;
|
|
150
|
+
/** Free shipping. If true, the coupon applies to all items in all `namespaces` in the site. */
|
|
151
|
+
freeShipping?: boolean;
|
|
152
|
+
/** Specific sale price. Currently only supported for coupons with a `stores` `namespace`. */
|
|
153
|
+
fixedPriceAmount?: number;
|
|
154
|
+
/**
|
|
155
|
+
* Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the
|
|
156
|
+
* following scenario: if a visitor purchases x number of products, they receive y number of products for free. C
|
|
157
|
+
* urrently only supported for coupons with a `stores` `namespace`.
|
|
158
|
+
*/
|
|
159
|
+
buyXGetY?: BuyXGetY;
|
|
160
|
+
}
|
|
161
|
+
/** @oneof */
|
|
162
|
+
export interface SpecificationScopeOrMinSubtotalOneOf {
|
|
163
|
+
/**
|
|
164
|
+
* Scope of the coupon. When no scope is defined, the coupon applies to all
|
|
165
|
+
* items in all `namespaces` in the site.
|
|
166
|
+
*/
|
|
167
|
+
scope?: Scope;
|
|
168
|
+
/** The coupon is only applicable when the order subtotal is over this amount. */
|
|
169
|
+
minimumSubtotal?: number | null;
|
|
170
|
+
}
|
|
171
|
+
export declare enum Type {
|
|
172
|
+
UNKNOWN = "UNKNOWN",
|
|
173
|
+
MONEY_OFF_AMOUNT = "MONEY_OFF_AMOUNT",
|
|
174
|
+
PERCENT_OFF_RATE = "PERCENT_OFF_RATE",
|
|
175
|
+
FREE_SHIPPING = "FREE_SHIPPING",
|
|
176
|
+
FIXED_PRICE_AMOUNT = "FIXED_PRICE_AMOUNT",
|
|
177
|
+
BUY_X_GET_Y = "BUY_X_GET_Y"
|
|
178
|
+
}
|
|
179
|
+
export interface BuyXGetY {
|
|
180
|
+
/** Number of purchased items required to receive free items. */
|
|
181
|
+
x?: number;
|
|
182
|
+
/** Number of items received for free if required number of items were purchased. */
|
|
183
|
+
y?: number;
|
|
184
|
+
}
|
|
185
|
+
export interface Scope {
|
|
186
|
+
/**
|
|
187
|
+
* Group within a `namespace` for which the coupon is applicable.
|
|
188
|
+
*
|
|
189
|
+
* If no group is specified, the coupon applies to all items in the namespace.
|
|
190
|
+
* `group` is required in some namespaces. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)
|
|
191
|
+
* for a list of currently supported groups for each namespace.
|
|
192
|
+
*/
|
|
193
|
+
name?: string | null;
|
|
194
|
+
/**
|
|
195
|
+
* ID of the specific entity in the group for which the coupon is applicable.
|
|
196
|
+
*
|
|
197
|
+
* If no `entityId` is specified, the coupon applies to all entities in the group. In some cases when a group is specified,
|
|
198
|
+
* an `entityId` is required. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)
|
|
199
|
+
* for a list of currently supported entities for each namespace and group.
|
|
200
|
+
*/
|
|
201
|
+
entityId?: string | null;
|
|
202
|
+
/**
|
|
203
|
+
* Wix application for which the coupon is applicable.
|
|
204
|
+
*
|
|
205
|
+
* One of the following:
|
|
206
|
+
* + `"stores"`
|
|
207
|
+
* + `"bookings"`
|
|
208
|
+
* + `"events"`
|
|
209
|
+
* + `"pricingPlans"`
|
|
210
|
+
*/
|
|
211
|
+
namespace?: string;
|
|
212
|
+
}
|
|
213
|
+
export declare enum Status {
|
|
214
|
+
/** Unknown status. */
|
|
215
|
+
UNKNOWN = "UNKNOWN",
|
|
216
|
+
/** The reference coupon was created but the loyalty points have not been redeemed yet. */
|
|
217
|
+
PENDING = "PENDING",
|
|
218
|
+
/** The reference coupon is active and available to the customer. */
|
|
219
|
+
ACTIVE = "ACTIVE",
|
|
220
|
+
/** The reference coupon was applied and is no longer available for use. */
|
|
221
|
+
APPLIED = "APPLIED",
|
|
222
|
+
/** The reference coupon was created but something went wrong when redeeming points from the loyalty account. */
|
|
223
|
+
FAILED = "FAILED",
|
|
224
|
+
/** The reference coupon was deleted. */
|
|
225
|
+
ARCHIVED = "ARCHIVED"
|
|
226
|
+
}
|
|
227
|
+
export interface RedeemPointsForCouponRequest {
|
|
228
|
+
/** ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem. */
|
|
229
|
+
rewardId: string;
|
|
230
|
+
/** ID of the [loyalty account](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer redeeming points. */
|
|
231
|
+
loyaltyAccountId: string;
|
|
232
|
+
}
|
|
233
|
+
export interface RedeemPointsForCouponResponse {
|
|
234
|
+
/** Created loyalty coupon. */
|
|
235
|
+
coupon?: LoyaltyCoupon;
|
|
236
|
+
}
|
|
237
|
+
export interface RedeemCurrentMemberPointsForCouponRequest {
|
|
238
|
+
/** ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem. */
|
|
239
|
+
rewardId: string;
|
|
240
|
+
}
|
|
241
|
+
export interface RedeemCurrentMemberPointsForCouponResponse {
|
|
242
|
+
/** Created loyalty coupon. */
|
|
243
|
+
coupon?: LoyaltyCoupon;
|
|
244
|
+
}
|
|
245
|
+
export interface RedeemMemberPointsForDiscountAmountCouponRequest {
|
|
246
|
+
/** ID of the [loyalty reward](https://dev.wix.com/api/rest/wix-loyalty-program/rewards) to redeem. */
|
|
247
|
+
rewardId?: string;
|
|
248
|
+
/** Loyalty account id. */
|
|
249
|
+
loyaltyAccountId?: string;
|
|
250
|
+
/** Number of points to redeem. */
|
|
251
|
+
pointsToRedeem?: number;
|
|
252
|
+
/** Coupon specification. */
|
|
253
|
+
specification?: Specification;
|
|
254
|
+
}
|
|
255
|
+
export interface RedeemMemberPointsForDiscountAmountCouponResponse {
|
|
256
|
+
/** Created loyalty coupon. */
|
|
257
|
+
coupon?: LoyaltyCoupon;
|
|
258
|
+
/** Transaction id of the coupon redemption */
|
|
259
|
+
transactionId?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface GetLoyaltyCouponRequest {
|
|
262
|
+
/** ID of the loyalty coupon to retrieve. */
|
|
263
|
+
loyaltyCouponId: string;
|
|
264
|
+
}
|
|
265
|
+
export interface GetLoyaltyCouponResponse {
|
|
266
|
+
/** Retrieved loyalty coupon. */
|
|
267
|
+
loyaltyCoupon?: LoyaltyCoupon;
|
|
268
|
+
}
|
|
269
|
+
export interface BulkGetLoyaltyCouponRequest {
|
|
270
|
+
/** Query to filter loyalty coupons. */
|
|
271
|
+
query?: CursorQuery;
|
|
272
|
+
}
|
|
273
|
+
export interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
274
|
+
/**
|
|
275
|
+
* Cursor paging options.
|
|
276
|
+
*
|
|
277
|
+
* Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
|
|
278
|
+
*/
|
|
279
|
+
cursorPaging?: CursorPaging;
|
|
280
|
+
/**
|
|
281
|
+
* Filter object.
|
|
282
|
+
*
|
|
283
|
+
* Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
|
|
284
|
+
*/
|
|
285
|
+
filter?: Record<string, any> | null;
|
|
286
|
+
/**
|
|
287
|
+
* Sort object.
|
|
288
|
+
*
|
|
289
|
+
* Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
|
|
290
|
+
*/
|
|
291
|
+
sort?: Sorting[];
|
|
292
|
+
}
|
|
293
|
+
/** @oneof */
|
|
294
|
+
export interface CursorQueryPagingMethodOneOf {
|
|
295
|
+
/**
|
|
296
|
+
* Cursor paging options.
|
|
297
|
+
*
|
|
298
|
+
* Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
|
|
299
|
+
*/
|
|
300
|
+
cursorPaging?: CursorPaging;
|
|
301
|
+
}
|
|
302
|
+
export interface Sorting {
|
|
303
|
+
/** Name of the field to sort by. */
|
|
304
|
+
fieldName?: string;
|
|
305
|
+
/** Sort order. */
|
|
306
|
+
order?: SortOrder;
|
|
307
|
+
}
|
|
308
|
+
export declare enum SortOrder {
|
|
309
|
+
ASC = "ASC",
|
|
310
|
+
DESC = "DESC"
|
|
311
|
+
}
|
|
312
|
+
export interface CursorPaging {
|
|
313
|
+
/** Maximum number of items to return in the results. */
|
|
314
|
+
limit?: number | null;
|
|
315
|
+
/**
|
|
316
|
+
* Pointer to the next or previous page in the list of results.
|
|
317
|
+
*
|
|
318
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
319
|
+
* Not relevant for the first request.
|
|
320
|
+
*/
|
|
321
|
+
cursor?: string | null;
|
|
322
|
+
}
|
|
323
|
+
export interface BulkGetLoyaltyCouponResponse {
|
|
324
|
+
/** Retrieved loyalty coupons. */
|
|
325
|
+
couponsInSite?: CouponsInSite[];
|
|
326
|
+
}
|
|
327
|
+
export interface CouponsInSite {
|
|
328
|
+
/** Metasite id */
|
|
329
|
+
metaSiteId?: string;
|
|
330
|
+
/** Retrieved loyalty coupons. */
|
|
331
|
+
loyaltyCoupons?: LoyaltyCoupon[];
|
|
332
|
+
}
|
|
333
|
+
export interface GetCurrentMemberCouponsRequest {
|
|
334
|
+
}
|
|
335
|
+
export interface GetCurrentMemberCouponsResponse {
|
|
336
|
+
/** Retrieved loyalty coupons. */
|
|
337
|
+
loyaltyCoupons?: LoyaltyCoupon[];
|
|
338
|
+
}
|
|
339
|
+
export interface QueryLoyaltyCouponRequest {
|
|
340
|
+
/** Query options. */
|
|
341
|
+
query: QueryV2;
|
|
342
|
+
}
|
|
343
|
+
export interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
344
|
+
/** Paging options to limit and skip the number of items. */
|
|
345
|
+
paging?: Paging;
|
|
346
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
347
|
+
cursorPaging?: CursorPaging;
|
|
348
|
+
/**
|
|
349
|
+
* Filter object.
|
|
350
|
+
*
|
|
351
|
+
* Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
|
|
352
|
+
*/
|
|
353
|
+
filter?: Record<string, any> | null;
|
|
354
|
+
/**
|
|
355
|
+
* Sort object.
|
|
356
|
+
*
|
|
357
|
+
* Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
|
|
358
|
+
*/
|
|
359
|
+
sort?: Sorting[];
|
|
360
|
+
/** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
|
|
361
|
+
fields?: string[];
|
|
362
|
+
/** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
|
|
363
|
+
fieldsets?: string[];
|
|
364
|
+
}
|
|
365
|
+
/** @oneof */
|
|
366
|
+
export interface QueryV2PagingMethodOneOf {
|
|
367
|
+
/** Paging options to limit and skip the number of items. */
|
|
368
|
+
paging?: Paging;
|
|
369
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
370
|
+
cursorPaging?: CursorPaging;
|
|
371
|
+
}
|
|
372
|
+
export interface Paging {
|
|
373
|
+
/** Number of items to load. */
|
|
374
|
+
limit?: number | null;
|
|
375
|
+
/** Number of items to skip in the current sort order. */
|
|
376
|
+
offset?: number | null;
|
|
377
|
+
}
|
|
378
|
+
export interface QueryLoyaltyCouponResponse {
|
|
379
|
+
/** Retrieved loyalty coupons. */
|
|
380
|
+
loyaltyCoupons?: LoyaltyCoupon[];
|
|
381
|
+
/** Metadata. */
|
|
382
|
+
metadata?: PagingMetadataV2;
|
|
383
|
+
}
|
|
384
|
+
export interface PagingMetadataV2 {
|
|
385
|
+
/** Number of items returned in the response. */
|
|
386
|
+
count?: number | null;
|
|
387
|
+
/** Offset that was requested. */
|
|
388
|
+
offset?: number | null;
|
|
389
|
+
/** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
|
|
390
|
+
total?: number | null;
|
|
391
|
+
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
392
|
+
tooManyToCount?: boolean | null;
|
|
393
|
+
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
394
|
+
cursors?: Cursors;
|
|
395
|
+
}
|
|
396
|
+
export interface Cursors {
|
|
397
|
+
/** Cursor string pointing to the next page in the list of results. */
|
|
398
|
+
next?: string | null;
|
|
399
|
+
/** Cursor pointing to the previous page in the list of results. */
|
|
400
|
+
prev?: string | null;
|
|
401
|
+
}
|
|
402
|
+
export interface DeleteLoyaltyCouponRequest {
|
|
403
|
+
/** ID of the loyalty coupon to delete. */
|
|
404
|
+
_id: string;
|
|
405
|
+
/**
|
|
406
|
+
* Revision number, which increments by 1 each time the loyalty coupon is updated.
|
|
407
|
+
*
|
|
408
|
+
* To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
|
|
409
|
+
*/
|
|
410
|
+
revision?: string;
|
|
411
|
+
}
|
|
412
|
+
export interface DeleteLoyaltyCouponResponse {
|
|
413
|
+
}
|
|
414
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
415
|
+
createdEvent?: EntityCreatedEvent;
|
|
416
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
417
|
+
deletedEvent?: EntityDeletedEvent;
|
|
418
|
+
actionEvent?: ActionEvent;
|
|
419
|
+
/**
|
|
420
|
+
* Unique event ID.
|
|
421
|
+
* Allows clients to ignore duplicate webhooks.
|
|
422
|
+
*/
|
|
423
|
+
_id?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Assumes actions are also always typed to an entity_type
|
|
426
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
427
|
+
*/
|
|
428
|
+
entityFqdn?: string;
|
|
429
|
+
/**
|
|
430
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
431
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
432
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
433
|
+
*/
|
|
434
|
+
slug?: string;
|
|
435
|
+
/** ID of the entity associated with the event. */
|
|
436
|
+
entityId?: string;
|
|
437
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
438
|
+
eventTime?: Date | null;
|
|
439
|
+
/**
|
|
440
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
441
|
+
* (for example, GDPR).
|
|
442
|
+
*/
|
|
443
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
444
|
+
/** If present, indicates the action that triggered the event. */
|
|
445
|
+
originatedFrom?: string | null;
|
|
446
|
+
/**
|
|
447
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
448
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
449
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
450
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
451
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
452
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
453
|
+
*/
|
|
454
|
+
entityEventSequence?: string | null;
|
|
455
|
+
}
|
|
456
|
+
/** @oneof */
|
|
457
|
+
export interface DomainEventBodyOneOf {
|
|
458
|
+
createdEvent?: EntityCreatedEvent;
|
|
459
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
460
|
+
deletedEvent?: EntityDeletedEvent;
|
|
461
|
+
actionEvent?: ActionEvent;
|
|
462
|
+
}
|
|
463
|
+
export interface EntityCreatedEvent {
|
|
464
|
+
entity?: string;
|
|
465
|
+
}
|
|
466
|
+
export interface RestoreInfo {
|
|
467
|
+
deletedDate?: Date | null;
|
|
468
|
+
}
|
|
469
|
+
export interface EntityUpdatedEvent {
|
|
470
|
+
/**
|
|
471
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
472
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
473
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
474
|
+
*/
|
|
475
|
+
currentEntity?: string;
|
|
476
|
+
}
|
|
477
|
+
export interface EntityDeletedEvent {
|
|
478
|
+
/** Entity that was deleted */
|
|
479
|
+
deletedEntity?: string | null;
|
|
480
|
+
}
|
|
481
|
+
export interface ActionEvent {
|
|
482
|
+
body?: string;
|
|
483
|
+
}
|
|
484
|
+
export interface Empty {
|
|
485
|
+
}
|
|
486
|
+
export interface MessageEnvelope {
|
|
487
|
+
/** App instance ID. */
|
|
488
|
+
instanceId?: string | null;
|
|
489
|
+
/** Event type. */
|
|
490
|
+
eventType?: string;
|
|
491
|
+
/** The identification type and identity data. */
|
|
492
|
+
identity?: IdentificationData;
|
|
493
|
+
/** Stringify payload. */
|
|
494
|
+
data?: string;
|
|
495
|
+
}
|
|
496
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
497
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
498
|
+
anonymousVisitorId?: string;
|
|
499
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
500
|
+
memberId?: string;
|
|
501
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
502
|
+
wixUserId?: string;
|
|
503
|
+
/** ID of an app. */
|
|
504
|
+
appId?: string;
|
|
505
|
+
/** @readonly */
|
|
506
|
+
identityType?: WebhookIdentityType;
|
|
507
|
+
}
|
|
508
|
+
/** @oneof */
|
|
509
|
+
export interface IdentificationDataIdOneOf {
|
|
510
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
511
|
+
anonymousVisitorId?: string;
|
|
512
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
513
|
+
memberId?: string;
|
|
514
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
515
|
+
wixUserId?: string;
|
|
516
|
+
/** ID of an app. */
|
|
517
|
+
appId?: string;
|
|
518
|
+
}
|
|
519
|
+
export declare enum WebhookIdentityType {
|
|
520
|
+
UNKNOWN = "UNKNOWN",
|
|
521
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
522
|
+
MEMBER = "MEMBER",
|
|
523
|
+
WIX_USER = "WIX_USER",
|
|
524
|
+
APP = "APP"
|
|
525
|
+
}
|
|
526
|
+
interface BuyXGetYNonNullableFields {
|
|
527
|
+
x: number;
|
|
528
|
+
y: number;
|
|
529
|
+
}
|
|
530
|
+
interface ScopeNonNullableFields {
|
|
531
|
+
namespace: string;
|
|
532
|
+
}
|
|
533
|
+
interface SpecificationNonNullableFields {
|
|
534
|
+
moneyOffAmount: number;
|
|
535
|
+
percentOffRate: number;
|
|
536
|
+
freeShipping: boolean;
|
|
537
|
+
fixedPriceAmount: number;
|
|
538
|
+
buyXGetY?: BuyXGetYNonNullableFields;
|
|
539
|
+
scope?: ScopeNonNullableFields;
|
|
540
|
+
type: Type;
|
|
541
|
+
}
|
|
542
|
+
interface CouponReferenceNonNullableFields {
|
|
543
|
+
couponId: string;
|
|
544
|
+
code: string;
|
|
545
|
+
specification?: SpecificationNonNullableFields;
|
|
546
|
+
}
|
|
547
|
+
export interface LoyaltyCouponNonNullableFields {
|
|
548
|
+
_id: string;
|
|
549
|
+
accountId: string;
|
|
550
|
+
memberIdDeprecated: string;
|
|
551
|
+
couponReference?: CouponReferenceNonNullableFields;
|
|
552
|
+
status: Status;
|
|
553
|
+
rewardName: string;
|
|
554
|
+
}
|
|
555
|
+
export interface RedeemPointsForCouponResponseNonNullableFields {
|
|
556
|
+
coupon?: LoyaltyCouponNonNullableFields;
|
|
557
|
+
}
|
|
558
|
+
export interface RedeemCurrentMemberPointsForCouponResponseNonNullableFields {
|
|
559
|
+
coupon?: LoyaltyCouponNonNullableFields;
|
|
560
|
+
transactionId: string;
|
|
561
|
+
}
|
|
562
|
+
export interface GetLoyaltyCouponResponseNonNullableFields {
|
|
563
|
+
loyaltyCoupon?: LoyaltyCouponNonNullableFields;
|
|
564
|
+
}
|
|
565
|
+
interface CouponsInSiteNonNullableFields {
|
|
566
|
+
metaSiteId: string;
|
|
567
|
+
loyaltyCoupons: LoyaltyCouponNonNullableFields[];
|
|
568
|
+
}
|
|
569
|
+
export interface BulkGetLoyaltyCouponResponseNonNullableFields {
|
|
570
|
+
couponsInSite: CouponsInSiteNonNullableFields[];
|
|
571
|
+
}
|
|
572
|
+
export interface GetCurrentMemberCouponsResponseNonNullableFields {
|
|
573
|
+
loyaltyCoupons: LoyaltyCouponNonNullableFields[];
|
|
574
|
+
}
|
|
575
|
+
export interface QueryLoyaltyCouponResponseNonNullableFields {
|
|
576
|
+
loyaltyCoupons: LoyaltyCouponNonNullableFields[];
|
|
577
|
+
}
|
|
578
|
+
export interface BaseEventMetadata {
|
|
579
|
+
/** App instance ID. */
|
|
580
|
+
instanceId?: string | null;
|
|
581
|
+
/** Event type. */
|
|
582
|
+
eventType?: string;
|
|
583
|
+
/** The identification type and identity data. */
|
|
584
|
+
identity?: IdentificationData;
|
|
585
|
+
}
|
|
586
|
+
export interface EventMetadata extends BaseEventMetadata {
|
|
587
|
+
/**
|
|
588
|
+
* Unique event ID.
|
|
589
|
+
* Allows clients to ignore duplicate webhooks.
|
|
590
|
+
*/
|
|
591
|
+
_id?: string;
|
|
592
|
+
/**
|
|
593
|
+
* Assumes actions are also always typed to an entity_type
|
|
594
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
595
|
+
*/
|
|
596
|
+
entityFqdn?: string;
|
|
597
|
+
/**
|
|
598
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
599
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
600
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
601
|
+
*/
|
|
602
|
+
slug?: string;
|
|
603
|
+
/** ID of the entity associated with the event. */
|
|
604
|
+
entityId?: string;
|
|
605
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
606
|
+
eventTime?: Date | null;
|
|
607
|
+
/**
|
|
608
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
609
|
+
* (for example, GDPR).
|
|
610
|
+
*/
|
|
611
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
612
|
+
/** If present, indicates the action that triggered the event. */
|
|
613
|
+
originatedFrom?: string | null;
|
|
614
|
+
/**
|
|
615
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
616
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
617
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
618
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
619
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
620
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
621
|
+
*/
|
|
622
|
+
entityEventSequence?: string | null;
|
|
623
|
+
}
|
|
624
|
+
export interface CouponCreatedEnvelope {
|
|
625
|
+
entity: LoyaltyCoupon;
|
|
626
|
+
metadata: EventMetadata;
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Triggered when a loyalty coupon is created.
|
|
630
|
+
* @permissionScope Read Loyalty
|
|
631
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
|
|
632
|
+
* @permissionScope Manage Loyalty
|
|
633
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
|
|
634
|
+
* @permissionId LOYALTY.READ_COUPONS
|
|
635
|
+
* @webhook
|
|
636
|
+
* @eventType wix.loyalty.v1.coupon_created
|
|
637
|
+
*/
|
|
638
|
+
export declare function onCouponCreated(handler: (event: CouponCreatedEnvelope) => void | Promise<void>): void;
|
|
639
|
+
export interface CouponDeletedEnvelope {
|
|
640
|
+
metadata: EventMetadata;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Triggered when a loyalty coupon is deleted.
|
|
644
|
+
* @permissionScope Read Loyalty
|
|
645
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
|
|
646
|
+
* @permissionScope Manage Loyalty
|
|
647
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
|
|
648
|
+
* @permissionId LOYALTY.READ_COUPONS
|
|
649
|
+
* @webhook
|
|
650
|
+
* @eventType wix.loyalty.v1.coupon_deleted
|
|
651
|
+
*/
|
|
652
|
+
export declare function onCouponDeleted(handler: (event: CouponDeletedEnvelope) => void | Promise<void>): void;
|
|
653
|
+
/**
|
|
654
|
+
* Redeems a customer's loyalty points for a loyalty reward and creates a loyalty coupon.
|
|
655
|
+
*
|
|
656
|
+
* Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
|
|
657
|
+
* The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
|
|
658
|
+
* are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
|
|
659
|
+
*
|
|
660
|
+
* Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
|
|
661
|
+
* @param rewardId - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
|
|
662
|
+
* @public
|
|
663
|
+
* @requiredField options
|
|
664
|
+
* @requiredField options.loyaltyAccountId
|
|
665
|
+
* @requiredField rewardId
|
|
666
|
+
* @permissionId LOYALTY.REDEEM_COUPON
|
|
667
|
+
* @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemPointsForCoupon
|
|
668
|
+
*/
|
|
669
|
+
export declare function redeemPointsForCoupon(rewardId: string, options: RedeemPointsForCouponOptions): Promise<RedeemPointsForCouponResponse & RedeemPointsForCouponResponseNonNullableFields>;
|
|
670
|
+
export interface RedeemPointsForCouponOptions {
|
|
671
|
+
/** ID of the [loyalty account](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer redeeming points. */
|
|
672
|
+
loyaltyAccountId: string;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Redeems a current customer's loyalty points for a loyalty reward and creates a loyalty coupon.
|
|
676
|
+
*
|
|
677
|
+
* Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
|
|
678
|
+
* The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
|
|
679
|
+
* are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
|
|
680
|
+
*
|
|
681
|
+
* Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
|
|
682
|
+
*
|
|
683
|
+
* >**Note:**
|
|
684
|
+
* >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
|
|
685
|
+
* @param rewardId - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
|
|
686
|
+
* @public
|
|
687
|
+
* @requiredField rewardId
|
|
688
|
+
* @permissionId LOYALTY.REDEEM_OWN_COUPON
|
|
689
|
+
* @applicableIdentity MEMBER
|
|
690
|
+
* @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemCurrentMemberPointsForCoupon
|
|
691
|
+
*/
|
|
692
|
+
export declare function redeemCurrentMemberPointsForCoupon(rewardId: string): Promise<RedeemCurrentMemberPointsForCouponResponse & RedeemCurrentMemberPointsForCouponResponseNonNullableFields>;
|
|
693
|
+
/**
|
|
694
|
+
* Retrieves a loyalty coupon.
|
|
695
|
+
* @param loyaltyCouponId - ID of the loyalty coupon to retrieve.
|
|
696
|
+
* @public
|
|
697
|
+
* @requiredField loyaltyCouponId
|
|
698
|
+
* @permissionId LOYALTY.READ_COUPONS
|
|
699
|
+
* @permissionScope Read Loyalty
|
|
700
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
|
|
701
|
+
* @permissionScope Manage Loyalty
|
|
702
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
|
|
703
|
+
* @applicableIdentity APP
|
|
704
|
+
* @returns Retrieved loyalty coupon.
|
|
705
|
+
* @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.GetLoyaltyCoupon
|
|
706
|
+
*/
|
|
707
|
+
export declare function getLoyaltyCoupon(loyaltyCouponId: string): Promise<LoyaltyCoupon & LoyaltyCouponNonNullableFields>;
|
|
708
|
+
/**
|
|
709
|
+
* Retrieves a sequence of loyalty coupons
|
|
710
|
+
* @public
|
|
711
|
+
* @documentationMaturity preview
|
|
712
|
+
* @permissionId LOYALTY.REWARD_BULK_READ
|
|
713
|
+
* @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.BulkGetLoyaltyCoupon
|
|
714
|
+
*/
|
|
715
|
+
export declare function bulkGetLoyaltyCoupon(options?: BulkGetLoyaltyCouponOptions): Promise<BulkGetLoyaltyCouponResponse & BulkGetLoyaltyCouponResponseNonNullableFields>;
|
|
716
|
+
export interface BulkGetLoyaltyCouponOptions {
|
|
717
|
+
/** Query to filter loyalty coupons. */
|
|
718
|
+
query?: CursorQuery;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Retrieves the loyalty coupons for the currently logged-in member.
|
|
722
|
+
*
|
|
723
|
+
* >**Note:**
|
|
724
|
+
* >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
|
|
725
|
+
* @public
|
|
726
|
+
* @permissionId LOYALTY.READ_OWN_COUPONS
|
|
727
|
+
* @permissionScope Read Loyalty
|
|
728
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
|
|
729
|
+
* @permissionScope Manage Loyalty
|
|
730
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
|
|
731
|
+
* @applicableIdentity APP
|
|
732
|
+
* @applicableIdentity MEMBER
|
|
733
|
+
* @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.GetCurrentMemberCoupons
|
|
734
|
+
*/
|
|
735
|
+
export declare function getCurrentMemberCoupons(): Promise<GetCurrentMemberCouponsResponse & GetCurrentMemberCouponsResponseNonNullableFields>;
|
|
736
|
+
/**
|
|
737
|
+
* Retrieves a list of loyalty coupons, given the provided paging, filtering, and sorting.
|
|
738
|
+
* @public
|
|
739
|
+
* @permissionScope Read Loyalty
|
|
740
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
|
|
741
|
+
* @permissionScope Manage Loyalty
|
|
742
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
|
|
743
|
+
* @permissionId LOYALTY.READ_COUPONS
|
|
744
|
+
* @applicableIdentity APP
|
|
745
|
+
* @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.QueryLoyaltyCoupon
|
|
746
|
+
*/
|
|
747
|
+
export declare function queryLoyaltyCoupons(): LoyaltyCouponsQueryBuilder;
|
|
748
|
+
interface QueryCursorResult {
|
|
749
|
+
cursors: Cursors;
|
|
750
|
+
hasNext: () => boolean;
|
|
751
|
+
hasPrev: () => boolean;
|
|
752
|
+
length: number;
|
|
753
|
+
pageSize: number;
|
|
754
|
+
}
|
|
755
|
+
export interface LoyaltyCouponsQueryResult extends QueryCursorResult {
|
|
756
|
+
items: LoyaltyCoupon[];
|
|
757
|
+
query: LoyaltyCouponsQueryBuilder;
|
|
758
|
+
next: () => Promise<LoyaltyCouponsQueryResult>;
|
|
759
|
+
prev: () => Promise<LoyaltyCouponsQueryResult>;
|
|
760
|
+
}
|
|
761
|
+
export interface LoyaltyCouponsQueryBuilder {
|
|
762
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
763
|
+
* @param value - Value to compare against.
|
|
764
|
+
*/
|
|
765
|
+
eq: (propertyName: 'accountId' | 'memberId' | 'transactionId' | 'couponReference' | 'status' | 'rewardName' | '_createdDate' | '_updatedDate', value: any) => LoyaltyCouponsQueryBuilder;
|
|
766
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
767
|
+
* @param value - Value to compare against.
|
|
768
|
+
*/
|
|
769
|
+
ne: (propertyName: 'accountId' | 'memberId' | 'transactionId' | 'couponReference' | 'status' | 'rewardName' | '_createdDate' | '_updatedDate', value: any) => LoyaltyCouponsQueryBuilder;
|
|
770
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
771
|
+
* @param value - Value to compare against.
|
|
772
|
+
*/
|
|
773
|
+
ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyCouponsQueryBuilder;
|
|
774
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
775
|
+
* @param value - Value to compare against.
|
|
776
|
+
*/
|
|
777
|
+
gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyCouponsQueryBuilder;
|
|
778
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
779
|
+
* @param value - Value to compare against.
|
|
780
|
+
*/
|
|
781
|
+
le: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyCouponsQueryBuilder;
|
|
782
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
783
|
+
* @param value - Value to compare against.
|
|
784
|
+
*/
|
|
785
|
+
lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyCouponsQueryBuilder;
|
|
786
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
787
|
+
* @param string - String to compare against. Case-insensitive.
|
|
788
|
+
*/
|
|
789
|
+
startsWith: (propertyName: 'accountId' | 'memberId' | 'transactionId' | 'rewardName', value: string) => LoyaltyCouponsQueryBuilder;
|
|
790
|
+
/** @param propertyName - Property whose value is compared with `values`.
|
|
791
|
+
* @param values - List of values to compare against.
|
|
792
|
+
*/
|
|
793
|
+
hasSome: (propertyName: 'accountId' | 'memberId' | 'transactionId' | 'couponReference' | 'status' | 'rewardName' | '_createdDate' | '_updatedDate', value: any[]) => LoyaltyCouponsQueryBuilder;
|
|
794
|
+
in: (propertyName: 'accountId' | 'memberId' | 'transactionId' | 'couponReference' | 'status' | 'rewardName' | '_createdDate' | '_updatedDate', value: any) => LoyaltyCouponsQueryBuilder;
|
|
795
|
+
exists: (propertyName: 'accountId' | 'memberId' | 'transactionId' | 'couponReference' | 'status' | 'rewardName' | '_createdDate' | '_updatedDate', value: boolean) => LoyaltyCouponsQueryBuilder;
|
|
796
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
|
|
797
|
+
ascending: (...propertyNames: Array<'accountId' | 'memberId' | 'transactionId' | 'couponReference' | 'status' | 'rewardName' | '_createdDate' | '_updatedDate'>) => LoyaltyCouponsQueryBuilder;
|
|
798
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
|
|
799
|
+
descending: (...propertyNames: Array<'accountId' | 'memberId' | 'transactionId' | 'couponReference' | 'status' | 'rewardName' | '_createdDate' | '_updatedDate'>) => LoyaltyCouponsQueryBuilder;
|
|
800
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
|
|
801
|
+
limit: (limit: number) => LoyaltyCouponsQueryBuilder;
|
|
802
|
+
/** @param cursor - A pointer to specific record */
|
|
803
|
+
skipTo: (cursor: string) => LoyaltyCouponsQueryBuilder;
|
|
804
|
+
find: () => Promise<LoyaltyCouponsQueryResult>;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Deletes a loyalty coupon.
|
|
808
|
+
*
|
|
809
|
+
* The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
|
|
810
|
+
* @param _id - ID of the loyalty coupon to delete.
|
|
811
|
+
* @param revision - Revision number, which increments by 1 each time the loyalty coupon is updated.
|
|
812
|
+
*
|
|
813
|
+
* To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
|
|
814
|
+
* @public
|
|
815
|
+
* @requiredField _id
|
|
816
|
+
* @requiredField revision
|
|
817
|
+
* @permissionId LOYALTY.MANAGE_COUPONS
|
|
818
|
+
* @permissionScope Manage Loyalty
|
|
819
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
|
|
820
|
+
* @applicableIdentity APP
|
|
821
|
+
* @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.DeleteLoyaltyCoupon
|
|
822
|
+
*/
|
|
823
|
+
export declare function deleteLoyaltyCoupon(_id: string, revision: string): Promise<void>;
|
|
824
|
+
export {};
|