@wix/auto_sdk_benefit-programs_balances 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/cjs/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/cjs/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/cjs/src/benefit-programs-v1-balance-balances.http.js +15 -51
- package/build/cjs/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.meta.js +1 -20
- package/build/cjs/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/cjs/src/benefit-programs-v1-balance-balances.public.js +1 -7
- package/build/cjs/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.types.d.ts +232 -155
- package/build/cjs/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/cjs/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.universal.d.ts +276 -233
- package/build/cjs/src/benefit-programs-v1-balance-balances.universal.js +29 -65
- package/build/cjs/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/es/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/es/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/es/src/benefit-programs-v1-balance-balances.http.js +14 -49
- package/build/es/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/es/src/benefit-programs-v1-balance-balances.meta.js +0 -18
- package/build/es/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/es/src/benefit-programs-v1-balance-balances.public.js +1 -6
- package/build/es/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.types.d.ts +232 -155
- package/build/es/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/es/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.universal.d.ts +276 -233
- package/build/es/src/benefit-programs-v1-balance-balances.universal.js +28 -63
- package/build/es/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.js +15 -51
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.js +1 -20
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.js +1 -7
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.d.ts +232 -155
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.d.ts +276 -233
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.js +29 -65
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/internal/es/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/internal/es/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/internal/es/src/benefit-programs-v1-balance-balances.http.js +14 -49
- package/build/internal/es/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.js +0 -18
- package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/internal/es/src/benefit-programs-v1-balance-balances.public.js +1 -6
- package/build/internal/es/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.types.d.ts +232 -155
- package/build/internal/es/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/internal/es/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.d.ts +276 -233
- package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.js +28 -63
- package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export interface Balance {
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Balance ID. This is the same as the associated pool's ID.
|
|
4
|
+
* @format GUID
|
|
5
|
+
* @immutable
|
|
6
|
+
*/
|
|
3
7
|
_id?: string;
|
|
4
8
|
/**
|
|
5
9
|
* Revision number, which increments by 1 each time the balance is updated.
|
|
@@ -18,17 +22,17 @@ export interface Balance {
|
|
|
18
22
|
*/
|
|
19
23
|
_updatedDate?: Date | null;
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
25
|
+
* Beneficiary of the associated pool.
|
|
22
26
|
* @readonly
|
|
23
27
|
*/
|
|
24
28
|
beneficiary?: CommonIdentificationData;
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
30
|
+
* Available credits.
|
|
27
31
|
* @readonly
|
|
28
32
|
*/
|
|
29
33
|
amount?: BalanceAmount;
|
|
30
34
|
/**
|
|
31
|
-
*
|
|
35
|
+
* Associated pool information.
|
|
32
36
|
* @readonly
|
|
33
37
|
*/
|
|
34
38
|
poolInfo?: PoolInfo;
|
|
@@ -38,26 +42,45 @@ export interface Balance {
|
|
|
38
42
|
*/
|
|
39
43
|
extendedFields?: ExtendedFields;
|
|
40
44
|
/**
|
|
41
|
-
*
|
|
45
|
+
* ID of the transaction associated with the most recent change to the balance.
|
|
46
|
+
* @format GUID
|
|
42
47
|
* @readonly
|
|
43
48
|
*/
|
|
44
49
|
lastTransactionId?: string | null;
|
|
45
50
|
}
|
|
46
51
|
export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
|
|
47
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* ID of a site visitor that hasn't logged in to the site.
|
|
54
|
+
* @format GUID
|
|
55
|
+
*/
|
|
48
56
|
anonymousVisitorId?: string;
|
|
49
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* ID of a site member.
|
|
59
|
+
* @format GUID
|
|
60
|
+
*/
|
|
50
61
|
memberId?: string;
|
|
51
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* ID of a Wix user.
|
|
64
|
+
* @format GUID
|
|
65
|
+
*/
|
|
52
66
|
wixUserId?: string;
|
|
53
67
|
}
|
|
54
68
|
/** @oneof */
|
|
55
69
|
export interface CommonIdentificationDataIdOneOf {
|
|
56
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* ID of a site visitor that hasn't logged in to the site.
|
|
72
|
+
* @format GUID
|
|
73
|
+
*/
|
|
57
74
|
anonymousVisitorId?: string;
|
|
58
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* ID of a site member.
|
|
77
|
+
* @format GUID
|
|
78
|
+
*/
|
|
59
79
|
memberId?: string;
|
|
60
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* ID of a Wix user.
|
|
82
|
+
* @format GUID
|
|
83
|
+
*/
|
|
61
84
|
wixUserId?: string;
|
|
62
85
|
}
|
|
63
86
|
export declare enum IdentityType {
|
|
@@ -72,7 +95,8 @@ export declare enum IdentityType {
|
|
|
72
95
|
}
|
|
73
96
|
export interface BalanceAmount {
|
|
74
97
|
/**
|
|
75
|
-
*
|
|
98
|
+
* Amount of available credits.
|
|
99
|
+
* @decimalValue options { maxScale:4 }
|
|
76
100
|
* @readonly
|
|
77
101
|
*/
|
|
78
102
|
available?: string;
|
|
@@ -80,29 +104,38 @@ export interface BalanceAmount {
|
|
|
80
104
|
export interface PoolInfo {
|
|
81
105
|
/**
|
|
82
106
|
* Pool ID.
|
|
83
|
-
*
|
|
84
|
-
* Represents the ID of the benefit pool linked to this balance.
|
|
107
|
+
* @format GUID
|
|
85
108
|
* @readonly
|
|
86
109
|
*/
|
|
87
110
|
_id?: string;
|
|
88
111
|
/**
|
|
89
|
-
*
|
|
112
|
+
* ID of the pool definition the pool was created from.
|
|
113
|
+
* @format GUID
|
|
90
114
|
* @readonly
|
|
91
115
|
*/
|
|
92
116
|
poolDefinitionId?: string | null;
|
|
93
117
|
/**
|
|
94
|
-
*
|
|
118
|
+
* ID of the program definition the pool was created from.
|
|
119
|
+
* @format GUID
|
|
95
120
|
* @readonly
|
|
96
121
|
*/
|
|
97
122
|
programDefinitionId?: string | null;
|
|
98
123
|
/**
|
|
99
|
-
*
|
|
124
|
+
* ID of the program that contains the pool.
|
|
125
|
+
* @format GUID
|
|
100
126
|
* @readonly
|
|
101
127
|
*/
|
|
102
128
|
programId?: string | null;
|
|
103
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Available credits.
|
|
131
|
+
* @decimalValue options { gte:0, maxScale:4 }
|
|
132
|
+
*/
|
|
104
133
|
creditAmount?: string | null;
|
|
105
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Namespace for your app or site's benefit programs.
|
|
136
|
+
* @minLength 1
|
|
137
|
+
* @maxLength 50
|
|
138
|
+
*/
|
|
106
139
|
namespace?: string | null;
|
|
107
140
|
}
|
|
108
141
|
export interface ExtendedFields {
|
|
@@ -117,7 +150,10 @@ export interface ExtendedFields {
|
|
|
117
150
|
namespaces?: Record<string, Record<string, any>>;
|
|
118
151
|
}
|
|
119
152
|
export interface GetBalanceRequest {
|
|
120
|
-
/**
|
|
153
|
+
/**
|
|
154
|
+
* ID of the pool associated with the balance to retrieve. This is also the ID of the balance.
|
|
155
|
+
* @format GUID
|
|
156
|
+
*/
|
|
121
157
|
poolId: string;
|
|
122
158
|
}
|
|
123
159
|
export interface GetBalanceResponse {
|
|
@@ -125,24 +161,35 @@ export interface GetBalanceResponse {
|
|
|
125
161
|
balance?: Balance;
|
|
126
162
|
}
|
|
127
163
|
export interface ListBalancesRequest {
|
|
128
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.
|
|
166
|
+
* @format GUID
|
|
167
|
+
* @maxSize 100
|
|
168
|
+
*/
|
|
129
169
|
poolIds?: string[];
|
|
130
|
-
/** Cursor paging */
|
|
170
|
+
/** Cursor paging. */
|
|
131
171
|
cursorPaging?: CursorPaging;
|
|
132
172
|
}
|
|
133
173
|
export interface CursorPaging {
|
|
134
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Maximum number of items to return in the results.
|
|
176
|
+
* @max 100
|
|
177
|
+
*/
|
|
135
178
|
limit?: number | null;
|
|
136
179
|
/**
|
|
137
180
|
* Pointer to the next or previous page in the list of results.
|
|
138
181
|
*
|
|
139
182
|
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
140
183
|
* Not relevant for the first request.
|
|
184
|
+
* @maxLength 16000
|
|
141
185
|
*/
|
|
142
186
|
cursor?: string | null;
|
|
143
187
|
}
|
|
144
188
|
export interface ListBalancesResponse {
|
|
145
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* Retrieved balances.
|
|
191
|
+
* @maxSize 100
|
|
192
|
+
*/
|
|
146
193
|
balances?: Balance[];
|
|
147
194
|
/** Metadata for paginated results. */
|
|
148
195
|
metadata?: CursorPagingMetadata;
|
|
@@ -161,13 +208,19 @@ export interface CursorPagingMetadata {
|
|
|
161
208
|
hasNext?: boolean | null;
|
|
162
209
|
}
|
|
163
210
|
export interface Cursors {
|
|
164
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* Cursor string pointing to the next page in the list of results.
|
|
213
|
+
* @maxLength 16000
|
|
214
|
+
*/
|
|
165
215
|
next?: string | null;
|
|
166
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* Cursor pointing to the previous page in the list of results.
|
|
218
|
+
* @maxLength 16000
|
|
219
|
+
*/
|
|
167
220
|
prev?: string | null;
|
|
168
221
|
}
|
|
169
222
|
export interface QueryBalancesRequest {
|
|
170
|
-
/**
|
|
223
|
+
/** Filter, sort, and paging to apply to the query. */
|
|
171
224
|
query?: CursorQuery;
|
|
172
225
|
}
|
|
173
226
|
export interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
@@ -185,6 +238,7 @@ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
|
185
238
|
/**
|
|
186
239
|
* Sort object in the following format:
|
|
187
240
|
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
241
|
+
* @maxSize 5
|
|
188
242
|
*/
|
|
189
243
|
sort?: Sorting[];
|
|
190
244
|
}
|
|
@@ -194,7 +248,10 @@ export interface CursorQueryPagingMethodOneOf {
|
|
|
194
248
|
cursorPaging?: CursorPaging;
|
|
195
249
|
}
|
|
196
250
|
export interface Sorting {
|
|
197
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* Name of the field to sort by.
|
|
253
|
+
* @maxLength 512
|
|
254
|
+
*/
|
|
198
255
|
fieldName?: string;
|
|
199
256
|
/** Sort order. */
|
|
200
257
|
order?: SortOrder;
|
|
@@ -206,68 +263,58 @@ export declare enum SortOrder {
|
|
|
206
263
|
DESC = "DESC"
|
|
207
264
|
}
|
|
208
265
|
export interface QueryBalancesResponse {
|
|
209
|
-
/** List of balances. */
|
|
266
|
+
/** List of retrieved balances. */
|
|
210
267
|
balances?: Balance[];
|
|
211
268
|
/** Metadata for the paginated results. */
|
|
212
269
|
metadata?: CursorPagingMetadata;
|
|
213
270
|
}
|
|
214
271
|
export interface BalanceChangeBalanceRequest extends BalanceChangeBalanceRequestOperationOneOf {
|
|
215
|
-
/**
|
|
272
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
216
273
|
adjustOptions?: AdjustOptions;
|
|
217
|
-
/**
|
|
274
|
+
/** Set the balance to a specific amount of credits. */
|
|
218
275
|
setOptions?: SetOptions;
|
|
219
|
-
/**
|
|
276
|
+
/**
|
|
277
|
+
* ID of the pool associated with the balance to change. This is also the ID of the balance.
|
|
278
|
+
* @format GUID
|
|
279
|
+
*/
|
|
220
280
|
poolId: string;
|
|
221
281
|
/**
|
|
222
282
|
* Unique identifier, generated by the client.
|
|
223
283
|
* Used to recognize repeated attempts to make the same request.
|
|
284
|
+
* @maxLength 200
|
|
224
285
|
*/
|
|
225
286
|
idempotencyKey: string;
|
|
226
|
-
/**
|
|
227
|
-
* Party requesting the balance change.
|
|
228
|
-
*
|
|
229
|
-
* Possible values could include:
|
|
230
|
-
*
|
|
231
|
-
* + App owner.
|
|
232
|
-
*
|
|
233
|
-
* + Pool beneficiary.
|
|
234
|
-
*
|
|
235
|
-
* + Site admin.
|
|
236
|
-
*/
|
|
287
|
+
/** Identity changing the balance. */
|
|
237
288
|
instructingParty?: CommonIdentificationData;
|
|
238
|
-
/**
|
|
239
|
-
* Specify the type of operation to change the balance. Depending on the selected balance change type, you must use the corresponding `adjustOptions` or `setOptions` parameter.
|
|
240
|
-
*
|
|
241
|
-
* Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
|
|
242
|
-
* For example, if there is a currently 10 credits, and you use `ADJUST` with an amount of 5, the resulting balance will be 15 credits (10+5) after the adjustment.
|
|
243
|
-
*
|
|
244
|
-
* Use `SET` to change the entire balance to a specified amount.
|
|
245
|
-
* For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
|
|
246
|
-
*/
|
|
289
|
+
/** Balance change type. */
|
|
247
290
|
type?: ChangeBalanceRequestType;
|
|
248
|
-
/**
|
|
291
|
+
/** Details to send to the transaction created from this balance change. */
|
|
249
292
|
transactionDetails?: TransactionDetails;
|
|
250
293
|
}
|
|
251
294
|
/** @oneof */
|
|
252
295
|
export interface BalanceChangeBalanceRequestOperationOneOf {
|
|
253
|
-
/**
|
|
296
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
254
297
|
adjustOptions?: AdjustOptions;
|
|
255
|
-
/**
|
|
298
|
+
/** Set the balance to a specific amount of credits. */
|
|
256
299
|
setOptions?: SetOptions;
|
|
257
300
|
}
|
|
258
301
|
export declare enum ChangeBalanceRequestType {
|
|
259
|
-
/** Unknown
|
|
302
|
+
/** Unknown balance change type. */
|
|
260
303
|
UNKNOWN_OPERATION = "UNKNOWN_OPERATION",
|
|
261
|
-
/**
|
|
304
|
+
/** Use with `adjustOptions`. */
|
|
262
305
|
ADJUST = "ADJUST",
|
|
263
|
-
/**
|
|
264
|
-
SET = "SET"
|
|
265
|
-
SET_INITIAL = "SET_INITIAL"
|
|
306
|
+
/** Use with `setOptions`. */
|
|
307
|
+
SET = "SET"
|
|
266
308
|
}
|
|
267
309
|
export interface AdjustOptions {
|
|
268
|
-
/**
|
|
310
|
+
/**
|
|
311
|
+
* Amount to change the balance's available credits by.
|
|
312
|
+
* - To increase the balance, specify a positive number.
|
|
313
|
+
* - To decrease the balance, specify a negative number.
|
|
314
|
+
* @decimalValue options { maxScale:4 }
|
|
315
|
+
*/
|
|
269
316
|
value?: string;
|
|
270
|
-
/**
|
|
317
|
+
/** Beneficiary of the associated pool. */
|
|
271
318
|
beneficiary?: CommonIdentificationData;
|
|
272
319
|
}
|
|
273
320
|
export declare enum LimitRule {
|
|
@@ -282,68 +329,83 @@ export declare enum LimitRule {
|
|
|
282
329
|
}
|
|
283
330
|
export interface SetOptions {
|
|
284
331
|
/**
|
|
285
|
-
*
|
|
332
|
+
* Amount to set the balance's available credits to.
|
|
286
333
|
*
|
|
287
|
-
* If
|
|
334
|
+
* If this is the same as the current value, no transaction is created.
|
|
335
|
+
* @decimalValue options { maxScale:4 }
|
|
288
336
|
*/
|
|
289
337
|
value?: string;
|
|
290
|
-
/**
|
|
338
|
+
/** Beneficiary of the associated pool. */
|
|
291
339
|
beneficiary?: CommonIdentificationData;
|
|
292
340
|
}
|
|
293
341
|
export interface SetInitialOptions {
|
|
294
|
-
/**
|
|
342
|
+
/**
|
|
343
|
+
* Set the available balance to the provided amount.
|
|
344
|
+
* @decimalValue options { maxScale:4 }
|
|
345
|
+
*/
|
|
295
346
|
value?: string;
|
|
296
347
|
/** Benefit pool owner associated with this balance. */
|
|
297
348
|
beneficiary?: CommonIdentificationData;
|
|
298
349
|
}
|
|
299
350
|
export interface TransactionDetails {
|
|
300
351
|
/**
|
|
301
|
-
* Item associated with the
|
|
302
|
-
* The redemption of this item triggered the balance adjustment.
|
|
352
|
+
* Item associated with the transaction.
|
|
303
353
|
* @readonly
|
|
304
354
|
*/
|
|
305
355
|
item?: Item;
|
|
306
|
-
/**
|
|
356
|
+
/** Amount of items associated with the transaction. */
|
|
307
357
|
itemCount?: number | null;
|
|
308
358
|
/**
|
|
309
|
-
* Date and time the transaction was
|
|
359
|
+
* Date and time the transaction was created.
|
|
310
360
|
* @readonly
|
|
311
361
|
*/
|
|
312
362
|
effectiveDate?: Date | null;
|
|
313
363
|
/**
|
|
314
|
-
* Reason for the transaction. For example, `Redemption
|
|
364
|
+
* Reason for the transaction. For example, `Redemption`.
|
|
315
365
|
* @readonly
|
|
366
|
+
* @maxLength 256
|
|
316
367
|
*/
|
|
317
368
|
reason?: string | null;
|
|
318
369
|
}
|
|
319
370
|
export interface Item {
|
|
320
371
|
/**
|
|
321
372
|
* Item ID.
|
|
373
|
+
* @format GUID
|
|
322
374
|
* @readonly
|
|
323
375
|
*/
|
|
324
376
|
_id?: string | null;
|
|
325
377
|
/**
|
|
326
|
-
*
|
|
378
|
+
* Item external ID.
|
|
379
|
+
* @format GUID
|
|
327
380
|
* @readonly
|
|
328
381
|
*/
|
|
329
382
|
externalId?: string | null;
|
|
330
383
|
/**
|
|
331
|
-
* Item category.
|
|
384
|
+
* Item category.
|
|
385
|
+
* @maxLength 20
|
|
332
386
|
* @readonly
|
|
333
387
|
*/
|
|
334
388
|
category?: string | null;
|
|
335
|
-
/**
|
|
389
|
+
/**
|
|
390
|
+
* Item set ID.
|
|
391
|
+
* @format GUID
|
|
392
|
+
* @readonly
|
|
393
|
+
*/
|
|
336
394
|
itemSetId?: string | null;
|
|
337
395
|
/**
|
|
338
|
-
* Item
|
|
396
|
+
* Item name.
|
|
397
|
+
* @maxLength 64
|
|
339
398
|
* @readonly
|
|
340
399
|
*/
|
|
341
400
|
displayName?: string | null;
|
|
342
401
|
}
|
|
343
402
|
export interface ChangeBalanceResponse {
|
|
344
|
-
/**
|
|
403
|
+
/** Updated balance. */
|
|
345
404
|
balance?: Balance;
|
|
346
|
-
/**
|
|
405
|
+
/**
|
|
406
|
+
* ID of the transaction associated with this change in balance.
|
|
407
|
+
* @format GUID
|
|
408
|
+
*/
|
|
347
409
|
transactionId?: string | null;
|
|
348
410
|
}
|
|
349
411
|
export interface BalanceExceededLimits {
|
|
@@ -351,74 +413,74 @@ export interface BalanceExceededLimits {
|
|
|
351
413
|
balance?: BalanceAmount;
|
|
352
414
|
/**
|
|
353
415
|
* The requested amount
|
|
416
|
+
* @decimalValue options { maxScale:4 }
|
|
354
417
|
* @readonly
|
|
355
418
|
*/
|
|
356
419
|
requested?: string;
|
|
357
420
|
/**
|
|
358
421
|
* Lower limit
|
|
422
|
+
* @decimalValue options { maxScale:4 }
|
|
359
423
|
* @readonly
|
|
360
424
|
*/
|
|
361
425
|
lowerLimit?: string | null;
|
|
362
426
|
/**
|
|
363
427
|
* Upper limit
|
|
428
|
+
* @decimalValue options { maxScale:4 }
|
|
364
429
|
* @readonly
|
|
365
430
|
*/
|
|
366
431
|
upperLimit?: string | null;
|
|
367
432
|
}
|
|
368
433
|
export interface BulkChangeBalancesRequest {
|
|
369
|
-
/**
|
|
434
|
+
/**
|
|
435
|
+
* List of balances to change.
|
|
436
|
+
* @minSize 1
|
|
437
|
+
* @maxSize 100
|
|
438
|
+
*/
|
|
370
439
|
requests?: ChangeBalanceRequest[];
|
|
371
440
|
/**
|
|
372
441
|
* Unique identifier, generated by the client.
|
|
373
442
|
* Used to recognize repeated attempts to make the same request.
|
|
443
|
+
* @maxLength 200
|
|
374
444
|
*/
|
|
375
|
-
idempotencyKey
|
|
376
|
-
/** Whether to return the
|
|
445
|
+
idempotencyKey?: string;
|
|
446
|
+
/** Whether to return the full balance entities in the response. */
|
|
377
447
|
returnEntity?: boolean;
|
|
378
448
|
}
|
|
379
449
|
export declare enum Type {
|
|
380
|
-
/** Unknown
|
|
450
|
+
/** Unknown balance change type. */
|
|
381
451
|
UNKNOWN_OPERATION = "UNKNOWN_OPERATION"
|
|
382
452
|
}
|
|
383
453
|
export interface ChangeBalanceRequest extends ChangeBalanceRequestOperationOneOf {
|
|
384
|
-
/** ID of the benefit pool to adjust. */
|
|
385
|
-
poolId?: string;
|
|
386
454
|
/**
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* Possible values could include:
|
|
390
|
-
*
|
|
391
|
-
* + App owner.
|
|
392
|
-
*
|
|
393
|
-
* + Pool beneficiary.
|
|
394
|
-
*
|
|
395
|
-
* + Site admin.
|
|
455
|
+
* ID of the pool associated with the balance to change. This is also the ID of the balance.
|
|
456
|
+
* @format GUID
|
|
396
457
|
*/
|
|
458
|
+
poolId?: string;
|
|
459
|
+
/** Identity changing the balance. */
|
|
397
460
|
instructingParty?: CommonIdentificationData;
|
|
398
|
-
/**
|
|
399
|
-
* Specify the type of operation to change the balance. Depending on the selected balance change type, you must use the corresponding `adjustOptions` or `setOptions` parameter.
|
|
400
|
-
*
|
|
401
|
-
* Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
|
|
402
|
-
* For example, if there is a currently 10 credits, and you use `ADJUST` with an amount of 5, the resulting balance will be 15 credits (10+5) after the adjustment.
|
|
403
|
-
*
|
|
404
|
-
* Use `SET` to change the entire balance to a specified amount.
|
|
405
|
-
* For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
|
|
406
|
-
*/
|
|
461
|
+
/** Balance change type. */
|
|
407
462
|
type?: Type;
|
|
408
|
-
/**
|
|
463
|
+
/** Details to send to the transaction created from this balance change. */
|
|
409
464
|
transactionDetails?: TransactionDetails;
|
|
410
465
|
}
|
|
411
466
|
/** @oneof */
|
|
412
467
|
export interface ChangeBalanceRequestOperationOneOf {
|
|
413
468
|
}
|
|
414
469
|
export interface BulkChangeBalancesResponse {
|
|
415
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* Updated item and associated metadata.
|
|
472
|
+
* @minSize 1
|
|
473
|
+
* @maxSize 100
|
|
474
|
+
*/
|
|
416
475
|
results?: BulkChangeBalanceResult[];
|
|
417
|
-
/** Metadata
|
|
476
|
+
/** Metadata. */
|
|
418
477
|
bulkActionMetadata?: BulkActionMetadata;
|
|
419
478
|
}
|
|
420
479
|
export interface ItemMetadata {
|
|
421
|
-
/**
|
|
480
|
+
/**
|
|
481
|
+
* Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).
|
|
482
|
+
* @format GUID
|
|
483
|
+
*/
|
|
422
484
|
_id?: string | null;
|
|
423
485
|
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
424
486
|
originalIndex?: number;
|
|
@@ -436,9 +498,9 @@ export interface ApplicationError {
|
|
|
436
498
|
data?: Record<string, any> | null;
|
|
437
499
|
}
|
|
438
500
|
export interface BulkChangeBalanceResult {
|
|
439
|
-
/**
|
|
501
|
+
/** Item metadata. */
|
|
440
502
|
itemMetadata?: ItemMetadata;
|
|
441
|
-
/**
|
|
503
|
+
/** Updated item. */
|
|
442
504
|
balance?: Balance;
|
|
443
505
|
}
|
|
444
506
|
export interface BulkActionMetadata {
|
|
@@ -450,34 +512,37 @@ export interface BulkActionMetadata {
|
|
|
450
512
|
undetailedFailures?: number;
|
|
451
513
|
}
|
|
452
514
|
export interface RevertBalanceChangeRequest {
|
|
453
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* ID of the transaction associated with the balance change to revert.
|
|
517
|
+
* @format GUID
|
|
518
|
+
*/
|
|
454
519
|
transactionId: string;
|
|
455
520
|
/**
|
|
456
521
|
* Unique identifier, generated by the client.
|
|
457
522
|
* Used to recognize repeated attempts to make the same request.
|
|
523
|
+
* @maxLength 200
|
|
458
524
|
*/
|
|
459
525
|
idempotencyKey: string;
|
|
460
|
-
/**
|
|
461
|
-
* Party requesting the balance change.
|
|
462
|
-
*
|
|
463
|
-
* Possible values could include:
|
|
464
|
-
*
|
|
465
|
-
* + App owner.
|
|
466
|
-
*
|
|
467
|
-
* + Pool beneficiary.
|
|
468
|
-
*
|
|
469
|
-
* + Site admin.
|
|
470
|
-
*/
|
|
526
|
+
/** Identity reverting the balance change. */
|
|
471
527
|
instructingParty?: CommonIdentificationData;
|
|
472
528
|
}
|
|
473
529
|
export interface RevertBalanceChangeResponse {
|
|
474
|
-
/**
|
|
530
|
+
/**
|
|
531
|
+
* ID of the transaction associated with the balance reversion.
|
|
532
|
+
* @format GUID
|
|
533
|
+
*/
|
|
475
534
|
transactionId?: string | null;
|
|
476
535
|
}
|
|
477
536
|
export interface ChangeAlreadyReverted {
|
|
478
|
-
/**
|
|
537
|
+
/**
|
|
538
|
+
* The id of the transaction which was already reverted
|
|
539
|
+
* @format GUID
|
|
540
|
+
*/
|
|
479
541
|
originalTransactionId?: string;
|
|
480
|
-
/**
|
|
542
|
+
/**
|
|
543
|
+
* The id of the transaction which reverted the original transaction
|
|
544
|
+
* @format GUID
|
|
545
|
+
*/
|
|
481
546
|
revertedTransactionId?: string;
|
|
482
547
|
}
|
|
483
548
|
export interface NotEnoughBalance {
|
|
@@ -485,12 +550,16 @@ export interface NotEnoughBalance {
|
|
|
485
550
|
balance?: BalanceAmount;
|
|
486
551
|
/**
|
|
487
552
|
* The requested amount
|
|
553
|
+
* @decimalValue options { maxScale:4 }
|
|
488
554
|
* @readonly
|
|
489
555
|
*/
|
|
490
556
|
requested?: string;
|
|
491
557
|
}
|
|
492
558
|
export interface GetTransactionReversibilityRequest {
|
|
493
|
-
/**
|
|
559
|
+
/**
|
|
560
|
+
* Id of the transaction to get the reversibility
|
|
561
|
+
* @format GUID
|
|
562
|
+
*/
|
|
494
563
|
transactionId?: string;
|
|
495
564
|
}
|
|
496
565
|
export interface GetTransactionReversibilityResponse {
|
|
@@ -575,9 +644,15 @@ export interface ActionEvent {
|
|
|
575
644
|
body?: string;
|
|
576
645
|
}
|
|
577
646
|
export interface MessageEnvelope {
|
|
578
|
-
/**
|
|
647
|
+
/**
|
|
648
|
+
* App instance ID.
|
|
649
|
+
* @format GUID
|
|
650
|
+
*/
|
|
579
651
|
instanceId?: string | null;
|
|
580
|
-
/**
|
|
652
|
+
/**
|
|
653
|
+
* Event type.
|
|
654
|
+
* @maxLength 150
|
|
655
|
+
*/
|
|
581
656
|
eventType?: string;
|
|
582
657
|
/** The identification type and identity data. */
|
|
583
658
|
identity?: IdentificationData;
|
|
@@ -585,26 +660,50 @@ export interface MessageEnvelope {
|
|
|
585
660
|
data?: string;
|
|
586
661
|
}
|
|
587
662
|
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
588
|
-
/**
|
|
663
|
+
/**
|
|
664
|
+
* ID of a site visitor that has not logged in to the site.
|
|
665
|
+
* @format GUID
|
|
666
|
+
*/
|
|
589
667
|
anonymousVisitorId?: string;
|
|
590
|
-
/**
|
|
668
|
+
/**
|
|
669
|
+
* ID of a site visitor that has logged in to the site.
|
|
670
|
+
* @format GUID
|
|
671
|
+
*/
|
|
591
672
|
memberId?: string;
|
|
592
|
-
/**
|
|
673
|
+
/**
|
|
674
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
675
|
+
* @format GUID
|
|
676
|
+
*/
|
|
593
677
|
wixUserId?: string;
|
|
594
|
-
/**
|
|
678
|
+
/**
|
|
679
|
+
* ID of an app.
|
|
680
|
+
* @format GUID
|
|
681
|
+
*/
|
|
595
682
|
appId?: string;
|
|
596
683
|
/** @readonly */
|
|
597
684
|
identityType?: WebhookIdentityType;
|
|
598
685
|
}
|
|
599
686
|
/** @oneof */
|
|
600
687
|
export interface IdentificationDataIdOneOf {
|
|
601
|
-
/**
|
|
688
|
+
/**
|
|
689
|
+
* ID of a site visitor that has not logged in to the site.
|
|
690
|
+
* @format GUID
|
|
691
|
+
*/
|
|
602
692
|
anonymousVisitorId?: string;
|
|
603
|
-
/**
|
|
693
|
+
/**
|
|
694
|
+
* ID of a site visitor that has logged in to the site.
|
|
695
|
+
* @format GUID
|
|
696
|
+
*/
|
|
604
697
|
memberId?: string;
|
|
605
|
-
/**
|
|
698
|
+
/**
|
|
699
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
700
|
+
* @format GUID
|
|
701
|
+
*/
|
|
606
702
|
wixUserId?: string;
|
|
607
|
-
/**
|
|
703
|
+
/**
|
|
704
|
+
* ID of an app.
|
|
705
|
+
* @format GUID
|
|
706
|
+
*/
|
|
608
707
|
appId?: string;
|
|
609
708
|
}
|
|
610
709
|
export declare enum WebhookIdentityType {
|
|
@@ -644,31 +743,9 @@ export interface QueryBalancesResponseNonNullableFields {
|
|
|
644
743
|
export interface ChangeBalanceResponseNonNullableFields {
|
|
645
744
|
balance?: BalanceNonNullableFields;
|
|
646
745
|
}
|
|
647
|
-
interface ApplicationErrorNonNullableFields {
|
|
648
|
-
code: string;
|
|
649
|
-
description: string;
|
|
650
|
-
}
|
|
651
|
-
interface ItemMetadataNonNullableFields {
|
|
652
|
-
originalIndex: number;
|
|
653
|
-
success: boolean;
|
|
654
|
-
error?: ApplicationErrorNonNullableFields;
|
|
655
|
-
}
|
|
656
|
-
interface BulkChangeBalanceResultNonNullableFields {
|
|
657
|
-
itemMetadata?: ItemMetadataNonNullableFields;
|
|
658
|
-
balance?: BalanceNonNullableFields;
|
|
659
|
-
}
|
|
660
|
-
interface BulkActionMetadataNonNullableFields {
|
|
661
|
-
totalSuccesses: number;
|
|
662
|
-
totalFailures: number;
|
|
663
|
-
undetailedFailures: number;
|
|
664
|
-
}
|
|
665
|
-
export interface BulkChangeBalancesResponseNonNullableFields {
|
|
666
|
-
results: BulkChangeBalanceResultNonNullableFields[];
|
|
667
|
-
bulkActionMetadata?: BulkActionMetadataNonNullableFields;
|
|
668
|
-
}
|
|
669
746
|
/**
|
|
670
|
-
* Retrieves a
|
|
671
|
-
* @param poolId - ID of the pool
|
|
747
|
+
* Retrieves a balance.
|
|
748
|
+
* @param poolId - ID of the pool associated with the balance to retrieve. This is also the ID of the balance.
|
|
672
749
|
* @public
|
|
673
750
|
* @documentationMaturity preview
|
|
674
751
|
* @requiredField poolId
|
|
@@ -677,13 +754,15 @@ export interface BulkChangeBalancesResponseNonNullableFields {
|
|
|
677
754
|
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
678
755
|
* @permissionScope SCOPE.BENEFIT_PROGRAMS.READ
|
|
679
756
|
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.READ
|
|
757
|
+
* @permissionScope Manage Events
|
|
758
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
680
759
|
* @applicableIdentity APP
|
|
681
760
|
* @returns Retrieved balance.
|
|
682
761
|
* @fqn wix.benefit_programs.v1.balance.BalanceService.GetBalance
|
|
683
762
|
*/
|
|
684
763
|
export declare function getBalance(poolId: string): Promise<Balance & BalanceNonNullableFields>;
|
|
685
764
|
/**
|
|
686
|
-
* Retrieves a list of
|
|
765
|
+
* Retrieves a list of balances.
|
|
687
766
|
* @public
|
|
688
767
|
* @documentationMaturity preview
|
|
689
768
|
* @permissionId BENEFIT_PROGRAMS.BALANCE_READ
|
|
@@ -691,32 +770,42 @@ export declare function getBalance(poolId: string): Promise<Balance & BalanceNon
|
|
|
691
770
|
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
692
771
|
* @permissionScope SCOPE.BENEFIT_PROGRAMS.READ
|
|
693
772
|
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.READ
|
|
773
|
+
* @permissionScope Manage Events
|
|
774
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
694
775
|
* @applicableIdentity APP
|
|
695
776
|
* @fqn wix.benefit_programs.v1.balance.BalanceService.ListBalances
|
|
696
777
|
*/
|
|
697
778
|
export declare function listBalances(options?: ListBalancesOptions): Promise<ListBalancesResponse & ListBalancesResponseNonNullableFields>;
|
|
698
779
|
export interface ListBalancesOptions {
|
|
699
|
-
/**
|
|
780
|
+
/**
|
|
781
|
+
* List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.
|
|
782
|
+
* @format GUID
|
|
783
|
+
* @maxSize 100
|
|
784
|
+
*/
|
|
700
785
|
poolIds?: string[];
|
|
701
|
-
/** Cursor paging */
|
|
786
|
+
/** Cursor paging. */
|
|
702
787
|
cursorPaging?: CursorPaging;
|
|
703
788
|
}
|
|
704
789
|
/**
|
|
705
790
|
* Creates a query to retrieve a list of balances.
|
|
706
791
|
*
|
|
707
|
-
* The
|
|
792
|
+
* The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.
|
|
793
|
+
*
|
|
794
|
+
* The returned object contains the query definition, which is used to run the query using the `find()` method.
|
|
708
795
|
*
|
|
709
|
-
*
|
|
796
|
+
* You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.
|
|
710
797
|
*
|
|
711
|
-
*
|
|
798
|
+
* Query Balances has a default paging limit of 50, which you can override.
|
|
712
799
|
*
|
|
713
|
-
*
|
|
800
|
+
* For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.
|
|
714
801
|
* @public
|
|
715
802
|
* @documentationMaturity preview
|
|
716
803
|
* @permissionScope SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
717
804
|
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
718
805
|
* @permissionScope SCOPE.BENEFIT_PROGRAMS.READ
|
|
719
806
|
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.READ
|
|
807
|
+
* @permissionScope Manage Events
|
|
808
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
720
809
|
* @permissionId BENEFIT_PROGRAMS.BALANCE_READ
|
|
721
810
|
* @applicableIdentity APP
|
|
722
811
|
* @fqn wix.benefit_programs.v1.balance.BalanceService.QueryBalances
|
|
@@ -800,16 +889,16 @@ export interface BalancesQueryBuilder {
|
|
|
800
889
|
find: () => Promise<BalancesQueryResult>;
|
|
801
890
|
}
|
|
802
891
|
/**
|
|
803
|
-
*
|
|
892
|
+
* Changes the amount of available credits in a balance.
|
|
804
893
|
*
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
* @param poolId - ID of the benefit pool to adjust.
|
|
894
|
+
* You can adjust or set the amount of available credits.
|
|
895
|
+
* @param poolId - ID of the pool associated with the balance to change. This is also the ID of the balance.
|
|
808
896
|
* @param idempotencyKey - Unique identifier, generated by the client.
|
|
809
897
|
* Used to recognize repeated attempts to make the same request.
|
|
810
898
|
* @public
|
|
811
899
|
* @documentationMaturity preview
|
|
812
900
|
* @requiredField idempotencyKey
|
|
901
|
+
* @requiredField operation
|
|
813
902
|
* @requiredField poolId
|
|
814
903
|
* @permissionId BENEFIT_PROGRAMS.BALANCE_CHANGE
|
|
815
904
|
* @permissionScope SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
@@ -818,69 +907,33 @@ export interface BalancesQueryBuilder {
|
|
|
818
907
|
* @fqn wix.benefit_programs.v1.balance.BalanceService.ChangeBalance
|
|
819
908
|
*/
|
|
820
909
|
export declare function changeBalance(poolId: string, idempotencyKey: string, options?: ChangeBalanceOptions): Promise<ChangeBalanceResponse & ChangeBalanceResponseNonNullableFields>;
|
|
821
|
-
export interface ChangeBalanceOptions extends
|
|
822
|
-
/**
|
|
823
|
-
* Party requesting the balance change.
|
|
824
|
-
*
|
|
825
|
-
* Possible values could include:
|
|
826
|
-
*
|
|
827
|
-
* + App owner.
|
|
828
|
-
*
|
|
829
|
-
* + Pool beneficiary.
|
|
830
|
-
*
|
|
831
|
-
* + Site admin.
|
|
832
|
-
*/
|
|
910
|
+
export interface ChangeBalanceOptions extends ChangeBalanceOptionsOperationOneOf {
|
|
911
|
+
/** Identity changing the balance. */
|
|
833
912
|
instructingParty?: CommonIdentificationData;
|
|
834
|
-
/**
|
|
835
|
-
* Specify the type of operation to change the balance. Depending on the selected balance change type, you must use the corresponding `adjustOptions` or `setOptions` parameter.
|
|
836
|
-
*
|
|
837
|
-
* Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
|
|
838
|
-
* For example, if there is a currently 10 credits, and you use `ADJUST` with an amount of 5, the resulting balance will be 15 credits (10+5) after the adjustment.
|
|
839
|
-
*
|
|
840
|
-
* Use `SET` to change the entire balance to a specified amount.
|
|
841
|
-
* For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
|
|
842
|
-
*/
|
|
913
|
+
/** Balance change type. */
|
|
843
914
|
type?: ChangeBalanceRequestType;
|
|
844
|
-
/**
|
|
915
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
845
916
|
adjustOptions?: AdjustOptions;
|
|
846
|
-
/**
|
|
917
|
+
/** Set the balance to a specific amount of credits. */
|
|
847
918
|
setOptions?: SetOptions;
|
|
848
|
-
/**
|
|
919
|
+
/** Details to send to the transaction created from this balance change. */
|
|
849
920
|
transactionDetails?: TransactionDetails;
|
|
850
921
|
}
|
|
851
|
-
/**
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
* @documentationMaturity preview
|
|
858
|
-
* @requiredField options.idempotencyKey
|
|
859
|
-
* @requiredField options.requests
|
|
860
|
-
* @requiredField options.requests.poolId
|
|
861
|
-
* @permissionId BENEFIT_PROGRAMS.BALANCE_CHANGE
|
|
862
|
-
* @permissionScope SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
863
|
-
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
864
|
-
* @applicableIdentity APP
|
|
865
|
-
* @fqn wix.benefit_programs.v1.balance.BalanceService.BulkChangeBalances
|
|
866
|
-
*/
|
|
867
|
-
export declare function bulkChangeBalances(options?: BulkChangeBalancesOptions): Promise<BulkChangeBalancesResponse & BulkChangeBalancesResponseNonNullableFields>;
|
|
868
|
-
export interface BulkChangeBalancesOptions {
|
|
869
|
-
/** Requests */
|
|
870
|
-
requests?: ChangeBalanceRequest[];
|
|
871
|
-
/**
|
|
872
|
-
* Unique identifier, generated by the client.
|
|
873
|
-
* Used to recognize repeated attempts to make the same request.
|
|
874
|
-
*/
|
|
875
|
-
idempotencyKey: string;
|
|
876
|
-
/** Whether to return the entity in the response */
|
|
877
|
-
returnEntity?: boolean;
|
|
922
|
+
/** @oneof */
|
|
923
|
+
export interface ChangeBalanceOptionsOperationOneOf {
|
|
924
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
925
|
+
adjustOptions?: AdjustOptions;
|
|
926
|
+
/** Set the balance to a specific amount of credits. */
|
|
927
|
+
setOptions?: SetOptions;
|
|
878
928
|
}
|
|
879
929
|
/**
|
|
880
|
-
*
|
|
930
|
+
* Undoes a transaction created by calling Change Balance.
|
|
931
|
+
*
|
|
932
|
+
* For example, if a transaction increased a balance's available credits by 5,
|
|
933
|
+
* calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.
|
|
881
934
|
*
|
|
882
|
-
*
|
|
883
|
-
* @param transactionId - ID of the
|
|
935
|
+
* > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.
|
|
936
|
+
* @param transactionId - ID of the transaction associated with the balance change to revert.
|
|
884
937
|
* @param idempotencyKey - Unique identifier, generated by the client.
|
|
885
938
|
* Used to recognize repeated attempts to make the same request.
|
|
886
939
|
* @public
|
|
@@ -895,17 +948,7 @@ export interface BulkChangeBalancesOptions {
|
|
|
895
948
|
*/
|
|
896
949
|
export declare function revertBalanceChange(transactionId: string, idempotencyKey: string, options?: RevertBalanceChangeOptions): Promise<RevertBalanceChangeResponse>;
|
|
897
950
|
export interface RevertBalanceChangeOptions {
|
|
898
|
-
/**
|
|
899
|
-
* Party requesting the balance change.
|
|
900
|
-
*
|
|
901
|
-
* Possible values could include:
|
|
902
|
-
*
|
|
903
|
-
* + App owner.
|
|
904
|
-
*
|
|
905
|
-
* + Pool beneficiary.
|
|
906
|
-
*
|
|
907
|
-
* + Site admin.
|
|
908
|
-
*/
|
|
951
|
+
/** Identity reverting the balance change. */
|
|
909
952
|
instructingParty?: CommonIdentificationData;
|
|
910
953
|
}
|
|
911
954
|
export {};
|