@voucherify/sdk 1.3.1 → 2.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/CHANGELOG.md +44 -0
- package/README.md +129 -129
- package/dist/AsyncActions.d.ts +2 -2
- package/dist/Balance.d.ts +1 -1
- package/dist/Campaigns.d.ts +9 -9
- package/dist/ClientSide.d.ts +8 -8
- package/dist/Consents.d.ts +1 -1
- package/dist/Customers.d.ts +6 -6
- package/dist/Distributions.d.ts +2 -2
- package/dist/Events.d.ts +3 -0
- package/dist/Exports.d.ts +3 -3
- package/dist/Loyalties.d.ts +19 -19
- package/dist/Orders.d.ts +4 -4
- package/dist/Products.d.ts +14 -14
- package/dist/PromotionTiers.d.ts +6 -6
- package/dist/Promotions.d.ts +3 -3
- package/dist/Redemptions.d.ts +5 -5
- package/dist/Rewards.d.ts +8 -8
- package/dist/Segments.d.ts +4 -4
- package/dist/ValidationRules.d.ts +8 -8
- package/dist/Validations.d.ts +1 -1
- package/dist/VoucherifyClientSide.d.ts +2 -2
- package/dist/VoucherifyServerSide.d.ts +3 -3
- package/dist/Vouchers.d.ts +14 -13
- package/dist/types/Campaigns.d.ts +3 -0
- package/dist/types/Products.d.ts +7 -9
- package/dist/types/Promotions.d.ts +4 -0
- package/dist/types/Vouchers.d.ts +12 -15
- package/dist/voucherifysdk.esm.js +135 -123
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/dist/voucherifysdk.umd.development.js +135 -123
- package/dist/voucherifysdk.umd.development.js.map +1 -1
- package/dist/voucherifysdk.umd.production.min.js +1 -1
- package/dist/voucherifysdk.umd.production.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<img src="https://vf-asset.s3-eu-west-1.amazonaws.com/voucherify-js-sdk/logo.png" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h3 align="center">Official <a href="
|
|
5
|
+
<h3 align="center">Official <a href="https://www.voucherify.io">Voucherify</a> JS SDK</h3>
|
|
6
6
|
|
|
7
7
|
<p>
|
|
8
8
|
<a href="#"><img src="https://github.com/voucherifyio/voucherify-js-sdk/workflows/Release/badge.svg?branch=main" alt="Build Status"/></a>
|
|
@@ -77,15 +77,15 @@ Client side:
|
|
|
77
77
|
|
|
78
78
|
Voucherify JS SDK is a JavaScript SDK which is fully consistent with restful API Voucherify provides and has fully integrated TypeScript support. It also combines together our previously maintained [Voucherify Node.js SDK](https://github.com/voucherifyio/voucherify-nodejs-sdk) and [Voucherify.js](https://github.com/rspective/voucherify.js/).
|
|
79
79
|
|
|
80
|
-
Learn more about Voucherify by visiting [our site](
|
|
80
|
+
Learn more about Voucherify by visiting [our site](https://www.voucherify.io).
|
|
81
81
|
|
|
82
82
|
# <a name="documentation"></a>📝 Documentation
|
|
83
83
|
|
|
84
|
-
You will find detailed description and example responses at our [official documentation](https://docs.voucherify.io/reference
|
|
84
|
+
You will find detailed description and example responses at our [official documentation](https://docs.voucherify.io/reference). Most method headers point to more detailed descriptions of arguments you can use.
|
|
85
85
|
|
|
86
86
|
You can also use our detailed documentation provided by our package [here](https://voucherifyio.github.io/voucherify-js-sdk/).
|
|
87
87
|
|
|
88
|
-
📚 Want to learn more? Visit our [official site](https://voucherify.io) or our [Success Portal](https://success.voucherify.io).
|
|
88
|
+
📚 Want to learn more? Visit our [official site](https://www.voucherify.io) or our [Success Portal](https://success.voucherify.io).
|
|
89
89
|
|
|
90
90
|
👽 Having troubles? Check our [Help center](https://support.voucherify.io/).
|
|
91
91
|
|
|
@@ -109,7 +109,7 @@ CDN installation:
|
|
|
109
109
|
></script>
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
Then, [login](
|
|
112
|
+
Then, [login](https://app.voucherify.io/#/login) to your Voucherify Dashboard and get your API keys from [Configuration](https://app.voucherify.io/#/app/core/projects/current/general).
|
|
113
113
|
|
|
114
114
|
# <a name="server-side"></a>🤖 Server Side
|
|
115
115
|
|
|
@@ -150,83 +150,83 @@ Methods are provided within `client.vouchers.*` namespace.
|
|
|
150
150
|
- [Update Vouchers in bulk](#update-vouchers-in-bulk)
|
|
151
151
|
- [Release Validation Session](#release-validation-session)
|
|
152
152
|
|
|
153
|
-
#### [Create Voucher](https://docs.voucherify.io/reference
|
|
153
|
+
#### [Create Voucher](https://docs.voucherify.io/reference/create-voucher)
|
|
154
154
|
|
|
155
155
|
```javascript
|
|
156
156
|
client.vouchers.create(voucher)
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
Check [voucher object](https://docs.voucherify.io/reference
|
|
159
|
+
Check [voucher object](https://docs.voucherify.io/reference/the-voucher-object).
|
|
160
160
|
|
|
161
|
-
#### [Get Voucher](https://docs.voucherify.io/reference
|
|
161
|
+
#### [Get Voucher](https://docs.voucherify.io/reference/vouchers-get)
|
|
162
162
|
|
|
163
163
|
```javascript
|
|
164
164
|
client.vouchers.get(code)
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
#### [Update Voucher](https://docs.voucherify.io/reference
|
|
167
|
+
#### [Update Voucher](https://docs.voucherify.io/reference/update-voucher)
|
|
168
168
|
|
|
169
169
|
```javascript
|
|
170
170
|
client.vouchers.update(voucher)
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
#### [Delete Voucher](https://docs.voucherify.io/reference
|
|
173
|
+
#### [Delete Voucher](https://docs.voucherify.io/reference/delete-voucher)
|
|
174
174
|
|
|
175
175
|
```javascript
|
|
176
176
|
client.vouchers.delete(code)
|
|
177
177
|
client.vouchers.delete(code, params)
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
#### [List Vouchers](https://docs.voucherify.io/reference
|
|
180
|
+
#### [List Vouchers](https://docs.voucherify.io/reference/list-vouchers)
|
|
181
181
|
|
|
182
182
|
```javascript
|
|
183
183
|
client.vouchers.list()
|
|
184
184
|
client.vouchers.list(params)
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
#### [Enable Voucher](https://docs.voucherify.io/reference
|
|
187
|
+
#### [Enable Voucher](https://docs.voucherify.io/reference/enable-voucher)
|
|
188
188
|
|
|
189
189
|
```javascript
|
|
190
190
|
client.vouchers.enable(code)
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
#### [Disable Voucher](https://docs.voucherify.io/reference
|
|
193
|
+
#### [Disable Voucher](https://docs.voucherify.io/reference/disable-voucher)
|
|
194
194
|
|
|
195
195
|
```javascript
|
|
196
196
|
client.vouchers.disable(code)
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
#### [Add Gift Voucher Balance](https://docs.voucherify.io/reference
|
|
199
|
+
#### [Add Gift Voucher Balance](https://docs.voucherify.io/reference/add-gift-voucher-balance)
|
|
200
200
|
|
|
201
201
|
```javascript
|
|
202
202
|
client.vouchers.balance.create(code, params)
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
#### [Import Vouchers](https://docs.voucherify.io/reference
|
|
205
|
+
#### [Import Vouchers](https://docs.voucherify.io/reference/import-vouchers-1)
|
|
206
206
|
|
|
207
207
|
```javascript
|
|
208
208
|
client.vouchers.import(vouchers)
|
|
209
209
|
```
|
|
210
210
|
|
|
211
|
-
#### [Examine Vouchers Qualification](https://docs.voucherify.io/reference
|
|
211
|
+
#### [Examine Vouchers Qualification](https://docs.voucherify.io/reference/push-qualification-request)
|
|
212
212
|
|
|
213
213
|
```javascript
|
|
214
214
|
client.vouchers.qualifications.examine(body, params)
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
#### [Update Vouchers Metadata in bulk](https://docs.voucherify.io/reference
|
|
217
|
+
#### [Update Vouchers Metadata in bulk](https://docs.voucherify.io/reference/update-vouchers-metadata-in-bulk)
|
|
218
218
|
|
|
219
219
|
```javascript
|
|
220
220
|
client.vouchers.bulkUpdateMetadata(params)
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
#### [Update Vouchers in bulk](https://docs.voucherify.io/reference
|
|
223
|
+
#### [Update Vouchers in bulk](https://docs.voucherify.io/reference/update-vouchers-in-bulk)
|
|
224
224
|
|
|
225
225
|
```javascript
|
|
226
226
|
client.vouchers.bulkUpdate(vouchers)
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
#### [Release Validation Session](https://docs.voucherify.io/reference
|
|
229
|
+
#### [Release Validation Session](https://docs.voucherify.io/reference/release-validation-session)
|
|
230
230
|
|
|
231
231
|
```javascript
|
|
232
232
|
client.vouchers.releaseValidationSession(code, sessionKey)
|
|
@@ -246,13 +246,13 @@ Methods are provided within `client.campaigns.*` namespace.
|
|
|
246
246
|
- [List Campaigns](#list-campaigns)
|
|
247
247
|
- [Examine Campaigns Qualification](#examine-campaigns-qualification)
|
|
248
248
|
|
|
249
|
-
#### [Create Campaign](https://docs.voucherify.io/reference
|
|
249
|
+
#### [Create Campaign](https://docs.voucherify.io/reference/create-campaign)
|
|
250
250
|
|
|
251
251
|
```javascript
|
|
252
252
|
client.campaigns.create(campaign)
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
#### [Update Campaign](https://docs.voucherify.io/reference
|
|
255
|
+
#### [Update Campaign](https://docs.voucherify.io/reference/update-campaign)
|
|
256
256
|
|
|
257
257
|
```javascript
|
|
258
258
|
client.campaigns.update(campaignId, campaign)
|
|
@@ -261,20 +261,20 @@ client.campaigns.update(campaignName, campaign)
|
|
|
261
261
|
|
|
262
262
|
Method will update only fields passed to `campaign` argument.
|
|
263
263
|
|
|
264
|
-
#### [Get Campaign](https://docs.voucherify.io/reference
|
|
264
|
+
#### [Get Campaign](https://docs.voucherify.io/reference/get-campaign)
|
|
265
265
|
|
|
266
266
|
```javascript
|
|
267
267
|
client.campaigns.get(name)
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
-
#### [Delete Campaign](https://docs.voucherify.io/reference
|
|
270
|
+
#### [Delete Campaign](https://docs.voucherify.io/reference/delete-campaign)
|
|
271
271
|
|
|
272
272
|
```javascript
|
|
273
273
|
client.campaigns.delete(campaignName)
|
|
274
274
|
client.campaigns.delete(campaignName, params)
|
|
275
275
|
```
|
|
276
276
|
|
|
277
|
-
#### [Add Voucher to Campaign](https://docs.voucherify.io/reference
|
|
277
|
+
#### [Add Voucher to Campaign](https://docs.voucherify.io/reference/add-voucher-to-campaign)
|
|
278
278
|
|
|
279
279
|
```javascript
|
|
280
280
|
client.campaigns.addVoucher(campaignName)
|
|
@@ -282,27 +282,27 @@ client.campaigns.addVoucher(campaignName, body)
|
|
|
282
282
|
client.campaigns.addVoucher(campaignName, body, params)
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
-
#### [Add certain Voucher to Campaign](https://docs.voucherify.io/reference
|
|
285
|
+
#### [Add certain Voucher to Campaign](https://docs.voucherify.io/reference/add-voucher-with-certain-code-to-campaign)
|
|
286
286
|
|
|
287
287
|
```javascript
|
|
288
288
|
client.campaigns.addCertainVoucher(campaignName, code, codeParams)
|
|
289
289
|
client.campaigns.addCertainVoucher(campaignName, code)
|
|
290
290
|
```
|
|
291
291
|
|
|
292
|
-
#### [Import Vouchers to Campaign](https://docs.voucherify.io/reference
|
|
292
|
+
#### [Import Vouchers to Campaign](https://docs.voucherify.io/reference/import-vouchers)
|
|
293
293
|
|
|
294
294
|
```javascript
|
|
295
295
|
client.campaigns.importVouchers(campaignName, vouchers)
|
|
296
296
|
```
|
|
297
297
|
|
|
298
|
-
#### [List Campaigns](https://docs.voucherify.io/reference
|
|
298
|
+
#### [List Campaigns](https://docs.voucherify.io/reference/list-campaigns)
|
|
299
299
|
|
|
300
300
|
```javascript
|
|
301
301
|
client.campaigns.list()
|
|
302
302
|
client.campaigns.list(params)
|
|
303
303
|
```
|
|
304
304
|
|
|
305
|
-
#### [Examine Campaigns Qualification](https://docs.voucherify.io/reference
|
|
305
|
+
#### [Examine Campaigns Qualification](https://docs.voucherify.io/reference/create-qualification-request)
|
|
306
306
|
|
|
307
307
|
```javascript
|
|
308
308
|
client.campaigns.qualifications.examine(body)
|
|
@@ -321,34 +321,34 @@ Methods are provided within `client.distributions.*` namespace.
|
|
|
321
321
|
- [List publications](#list-publications)
|
|
322
322
|
- [Create publication](#create-publication)
|
|
323
323
|
|
|
324
|
-
#### [Create Export](https://docs.voucherify.io/reference
|
|
324
|
+
#### [Create Export](https://docs.voucherify.io/reference/create-export)
|
|
325
325
|
|
|
326
326
|
```javascript
|
|
327
327
|
client.distributions.exports.create(exportObject)
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
-
Check [the export object](https://docs.voucherify.io/v1/reference
|
|
330
|
+
Check [the export object](https://docs.voucherify.io/v1/reference/the-export-object).
|
|
331
331
|
|
|
332
|
-
#### [Get Export](https://docs.voucherify.io/reference
|
|
332
|
+
#### [Get Export](https://docs.voucherify.io/reference/get-export)
|
|
333
333
|
|
|
334
334
|
```javascript
|
|
335
335
|
client.distributions.exports.get(exportId)
|
|
336
336
|
```
|
|
337
337
|
|
|
338
|
-
#### [Delete Export](https://docs.voucherify.io/reference
|
|
338
|
+
#### [Delete Export](https://docs.voucherify.io/reference/delete-export)
|
|
339
339
|
|
|
340
340
|
```javascript
|
|
341
341
|
client.distributions.exports.delete(exportId)
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
#### [List publications](https://docs.voucherify.io/reference
|
|
344
|
+
#### [List publications](https://docs.voucherify.io/reference/list-publications)
|
|
345
345
|
|
|
346
346
|
```javascript
|
|
347
347
|
client.distributions.publications.list()
|
|
348
348
|
client.distributions.publications.list(params)
|
|
349
349
|
```
|
|
350
350
|
|
|
351
|
-
#### [Create publication](https://docs.voucherify.io/reference
|
|
351
|
+
#### [Create publication](https://docs.voucherify.io/reference/create-publication)
|
|
352
352
|
|
|
353
353
|
```javascript
|
|
354
354
|
client.distributions.publications.create(params)
|
|
@@ -363,7 +363,7 @@ Methods are provided within `client.validations.*` or `client.promotions.*` name
|
|
|
363
363
|
- [Validate Voucher](#validate-voucher)
|
|
364
364
|
- [Validate Promotion Campaign](#validate-promotion-campaign)
|
|
365
365
|
|
|
366
|
-
#### [Validate Voucher](https://docs.voucherify.io/reference
|
|
366
|
+
#### [Validate Voucher](https://docs.voucherify.io/reference/validate-voucher)
|
|
367
367
|
|
|
368
368
|
```javascript
|
|
369
369
|
client.validations.validateVoucher(code)
|
|
@@ -377,7 +377,7 @@ client.validations.validate(code)
|
|
|
377
377
|
client.validations.validate(code, params)
|
|
378
378
|
```
|
|
379
379
|
|
|
380
|
-
#### [Validate Promotion Campaign](
|
|
380
|
+
#### [Validate Promotion Campaign](https://docs.voucherify.io/reference/validate-promotions-1)
|
|
381
381
|
|
|
382
382
|
```javascript
|
|
383
383
|
client.promotions.validate(params)
|
|
@@ -403,40 +403,40 @@ Methods are provided within `client.redemptions.*` namespace.
|
|
|
403
403
|
- [Get Voucher's Redemptions](#get-vouchers-redemptions)
|
|
404
404
|
- [Rollback Redemption](#rollback-redemption)
|
|
405
405
|
|
|
406
|
-
#### [Redeem Voucher](https://docs.voucherify.io/reference
|
|
406
|
+
#### [Redeem Voucher](https://docs.voucherify.io/reference/redeem-voucher)
|
|
407
407
|
|
|
408
408
|
```javascript
|
|
409
409
|
client.redemptions.redeem(code)
|
|
410
410
|
client.redemptions.redeem(code, params)
|
|
411
411
|
```
|
|
412
412
|
|
|
413
|
-
#### [Get Redemption](https://docs.voucherify.io/reference
|
|
413
|
+
#### [Get Redemption](https://docs.voucherify.io/reference/get-redemption)
|
|
414
414
|
|
|
415
415
|
```javascript
|
|
416
416
|
client.redemptions.get(redemptionId)
|
|
417
417
|
```
|
|
418
418
|
|
|
419
|
-
#### [List Redemptions](https://docs.voucherify.io/reference
|
|
419
|
+
#### [List Redemptions](https://docs.voucherify.io/reference/list-redemptions)
|
|
420
420
|
|
|
421
421
|
```javascript
|
|
422
422
|
client.redemptions.list()
|
|
423
423
|
client.redemptions.list(params)
|
|
424
424
|
```
|
|
425
425
|
|
|
426
|
-
#### [Get Voucher's Redemptions](https://docs.voucherify.io/reference
|
|
426
|
+
#### [Get Voucher's Redemptions](https://docs.voucherify.io/reference/vouchers-redemptions)
|
|
427
427
|
|
|
428
428
|
```javascript
|
|
429
429
|
client.redemptions.getForVoucher(code)
|
|
430
430
|
```
|
|
431
431
|
|
|
432
|
-
#### [Rollback Redemption](https://docs.voucherify.io/reference
|
|
432
|
+
#### [Rollback Redemption](https://docs.voucherify.io/reference/rollback-redemption)
|
|
433
433
|
|
|
434
434
|
```javascript
|
|
435
435
|
client.redemptions.rollback(redemptionId)
|
|
436
436
|
client.redemptions.rollback(redemptionId, params)
|
|
437
437
|
```
|
|
438
438
|
|
|
439
|
-
Check [redemption rollback object](https://docs.voucherify.io/reference
|
|
439
|
+
Check [redemption rollback object](https://docs.voucherify.io/reference/the-redemption-rollback-object).
|
|
440
440
|
|
|
441
441
|
---
|
|
442
442
|
|
|
@@ -455,48 +455,48 @@ Methods are provided within `client.promotions.*` namespace.
|
|
|
455
455
|
|
|
456
456
|
Read how to [Validate Promotion Campaign](#validate-promotion-campaign) in Validations section
|
|
457
457
|
|
|
458
|
-
#### [Create Promotion Campaign](
|
|
458
|
+
#### [Create Promotion Campaign](https://docs.voucherify.io/reference/create-promotion-campaign)
|
|
459
459
|
|
|
460
460
|
```javascript
|
|
461
461
|
client.promotions.create(promotionCampaign)
|
|
462
462
|
```
|
|
463
463
|
|
|
464
|
-
Check [promotion campaign object](
|
|
464
|
+
Check [promotion campaign object](https://docs.voucherify.io/reference/create-promotion-campaign).
|
|
465
465
|
|
|
466
|
-
#### [List Promotion's Tiers](https://docs.voucherify.io/reference
|
|
466
|
+
#### [List Promotion's Tiers](https://docs.voucherify.io/reference/get-promotions)
|
|
467
467
|
|
|
468
468
|
```javascript
|
|
469
469
|
client.promotions.tiers.list(promotionCampaignId)
|
|
470
470
|
```
|
|
471
471
|
|
|
472
|
-
Check [promotion's tier object](
|
|
472
|
+
Check [promotion's tier object](https://docs.voucherify.io/reference/the-promotion-object)
|
|
473
473
|
|
|
474
|
-
#### [List All Promotion Tiers](https://docs.voucherify.io/reference
|
|
474
|
+
#### [List All Promotion Tiers](https://docs.voucherify.io/reference/list-promotion-tiers)
|
|
475
475
|
|
|
476
476
|
```javascript
|
|
477
477
|
client.promotions.tiers.listAll()
|
|
478
478
|
client.promotions.tiers.listAll(params})
|
|
479
479
|
```
|
|
480
480
|
|
|
481
|
-
#### [Add Promotion Tier to Campaign](https://docs.voucherify.io/reference
|
|
481
|
+
#### [Add Promotion Tier to Campaign](https://docs.voucherify.io/reference/add-promotion-tier-to-campaign)
|
|
482
482
|
|
|
483
483
|
```javascript
|
|
484
484
|
client.promotions.tiers.create(promotionId, params)
|
|
485
485
|
```
|
|
486
486
|
|
|
487
|
-
#### [Redeem Promotion](https://docs.voucherify.io/reference
|
|
487
|
+
#### [Redeem Promotion](https://docs.voucherify.io/reference/redeem-promotion)
|
|
488
488
|
|
|
489
489
|
```javascript
|
|
490
490
|
client.promotions.tiers.redeem(promotionsTierId, params)
|
|
491
491
|
```
|
|
492
492
|
|
|
493
|
-
#### [Update Promotion Tier](https://docs.voucherify.io/reference
|
|
493
|
+
#### [Update Promotion Tier](https://docs.voucherify.io/reference/update-promotion)
|
|
494
494
|
|
|
495
495
|
```javascript
|
|
496
496
|
client.promotions.tiers.update(promotionsTier)
|
|
497
497
|
```
|
|
498
498
|
|
|
499
|
-
#### [Delete Promotion Tier](https://docs.voucherify.io/reference
|
|
499
|
+
#### [Delete Promotion Tier](https://docs.voucherify.io/reference/delete-promotion)
|
|
500
500
|
|
|
501
501
|
```javascript
|
|
502
502
|
client.promotions.tiers.delete(promotionsTierId)
|
|
@@ -515,21 +515,21 @@ Methods are provided within `client.customers.*` namespace.
|
|
|
515
515
|
- [List Customers](#list-customers)
|
|
516
516
|
- [Update Customer's Consents](#update-customers-consents)
|
|
517
517
|
|
|
518
|
-
#### [Create Customer](https://docs.voucherify.io/reference
|
|
518
|
+
#### [Create Customer](https://docs.voucherify.io/reference/create-customer)
|
|
519
519
|
|
|
520
520
|
```javascript
|
|
521
521
|
client.customers.create(customer)
|
|
522
522
|
```
|
|
523
523
|
|
|
524
|
-
Check [customer object](https://docs.voucherify.io/reference
|
|
524
|
+
Check [customer object](https://docs.voucherify.io/reference/the-customer-object).
|
|
525
525
|
|
|
526
|
-
#### [Get Customer](https://docs.voucherify.io/reference
|
|
526
|
+
#### [Get Customer](https://docs.voucherify.io/reference/get-customer)
|
|
527
527
|
|
|
528
528
|
```javascript
|
|
529
529
|
client.customers.get(customerId)
|
|
530
530
|
```
|
|
531
531
|
|
|
532
|
-
#### [Update Customer](https://docs.voucherify.io/reference
|
|
532
|
+
#### [Update Customer](https://docs.voucherify.io/reference/update-customer)
|
|
533
533
|
|
|
534
534
|
```javascript
|
|
535
535
|
client.customers.update(customer)
|
|
@@ -537,13 +537,13 @@ client.customers.update(customer)
|
|
|
537
537
|
|
|
538
538
|
`customer` object must contain `id` or `source_id`.
|
|
539
539
|
|
|
540
|
-
#### [Delete Customer](https://docs.voucherify.io/reference
|
|
540
|
+
#### [Delete Customer](https://docs.voucherify.io/reference/delete-customer)
|
|
541
541
|
|
|
542
542
|
```javascript
|
|
543
543
|
client.customers.delete(customerId)
|
|
544
544
|
```
|
|
545
545
|
|
|
546
|
-
#### [List Customers](https://docs.voucherify.io/reference
|
|
546
|
+
#### [List Customers](https://docs.voucherify.io/reference/list-customers)
|
|
547
547
|
|
|
548
548
|
```javascript
|
|
549
549
|
client.customers.list()
|
|
@@ -582,7 +582,7 @@ You can optionally define scrolling cursor based on customer creation date using
|
|
|
582
582
|
|
|
583
583
|
Keep in mind this operation may drain your API call limits fairly quickly - each api call fetches 100 customers. So if you have 100.000 customers, you will use 1000 API calls.
|
|
584
584
|
|
|
585
|
-
#### [Update Customer's Consents](https://docs.voucherify.io/reference
|
|
585
|
+
#### [Update Customer's Consents](https://docs.voucherify.io/reference/update-customers-consents)
|
|
586
586
|
|
|
587
587
|
```javascript
|
|
588
588
|
client.customers.updateConsents(customer, consents)
|
|
@@ -598,7 +598,7 @@ Methods are provided within `client.consents.*` namespace.
|
|
|
598
598
|
|
|
599
599
|
You can [update Customer's consents](#update-customers-consents) in `client.customer.*` namespace.
|
|
600
600
|
|
|
601
|
-
#### [Get Consents](https://docs.voucherify.io/reference
|
|
601
|
+
#### [Get Consents](https://docs.voucherify.io/reference/get-consents)
|
|
602
602
|
|
|
603
603
|
```javascript
|
|
604
604
|
client.consents.list()
|
|
@@ -615,21 +615,21 @@ Methods are provided within `client.orders.*` namespace.
|
|
|
615
615
|
- [Update Order](#update-order)
|
|
616
616
|
- [List Orders](#list-orders)
|
|
617
617
|
|
|
618
|
-
#### [Create Order](https://docs.voucherify.io/reference
|
|
618
|
+
#### [Create Order](https://docs.voucherify.io/reference/create-order)
|
|
619
619
|
|
|
620
620
|
```javascript
|
|
621
621
|
client.orders.create(order)
|
|
622
622
|
```
|
|
623
623
|
|
|
624
|
-
Check [the order object](https://docs.voucherify.io/reference
|
|
624
|
+
Check [the order object](https://docs.voucherify.io/reference/the-order-object).
|
|
625
625
|
|
|
626
|
-
#### [Get Order](https://docs.voucherify.io/reference
|
|
626
|
+
#### [Get Order](https://docs.voucherify.io/reference/get-order)
|
|
627
627
|
|
|
628
628
|
```javascript
|
|
629
629
|
client.orders.get(orderId)
|
|
630
630
|
```
|
|
631
631
|
|
|
632
|
-
#### [Update Order](https://docs.voucherify.io/reference
|
|
632
|
+
#### [Update Order](https://docs.voucherify.io/reference/update-order)
|
|
633
633
|
|
|
634
634
|
```javascript
|
|
635
635
|
client.orders.update(order)
|
|
@@ -637,7 +637,7 @@ client.orders.update(order)
|
|
|
637
637
|
|
|
638
638
|
`order` object must contain `id` or `source_id`.
|
|
639
639
|
|
|
640
|
-
#### [List Orders](https://docs.voucherify.io/reference
|
|
640
|
+
#### [List Orders](https://docs.voucherify.io/reference/list-orders)
|
|
641
641
|
|
|
642
642
|
```javascript
|
|
643
643
|
client.orders.list()
|
|
@@ -662,74 +662,74 @@ Methods are provided within `client.products.*` namespace.
|
|
|
662
662
|
- [Delete SKU](#delete-sku)
|
|
663
663
|
- [List all product SKUs](#list-all-product-skus)
|
|
664
664
|
|
|
665
|
-
#### [Create Product](https://docs.voucherify.io/reference
|
|
665
|
+
#### [Create Product](https://docs.voucherify.io/reference/create-product)
|
|
666
666
|
|
|
667
667
|
```javascript
|
|
668
668
|
client.products.create(product)
|
|
669
669
|
```
|
|
670
670
|
|
|
671
|
-
Check [product object](https://docs.voucherify.io/reference
|
|
671
|
+
Check [product object](https://docs.voucherify.io/reference/the-product-object).
|
|
672
672
|
|
|
673
|
-
#### [Get Product](https://docs.voucherify.io/reference
|
|
673
|
+
#### [Get Product](https://docs.voucherify.io/reference/get-product)
|
|
674
674
|
|
|
675
675
|
```javascript
|
|
676
676
|
client.products.get(productId)
|
|
677
677
|
```
|
|
678
678
|
|
|
679
|
-
#### [Update Product](https://docs.voucherify.io/reference
|
|
679
|
+
#### [Update Product](https://docs.voucherify.io/reference/update-product)
|
|
680
680
|
|
|
681
681
|
```javascript
|
|
682
682
|
client.products.update(product)
|
|
683
683
|
```
|
|
684
684
|
|
|
685
|
-
#### [Delete Product](<(https://docs.voucherify.io/reference
|
|
685
|
+
#### [Delete Product](<(https://docs.voucherify.io/reference/delete-product)>)
|
|
686
686
|
|
|
687
687
|
```javascript
|
|
688
688
|
client.products.delete(productId)
|
|
689
689
|
client.products.delete(productId, { force: true })
|
|
690
690
|
```
|
|
691
691
|
|
|
692
|
-
#### [Update Products in Bulk](https://docs.voucherify.io/reference
|
|
692
|
+
#### [Update Products in Bulk](https://docs.voucherify.io/reference/update-products-in-bulk)
|
|
693
693
|
|
|
694
694
|
```javascript
|
|
695
695
|
client.products.bulkUpdate(products)
|
|
696
696
|
```
|
|
697
697
|
|
|
698
|
-
#### [List Products](https://docs.voucherify.io/reference
|
|
698
|
+
#### [List Products](https://docs.voucherify.io/reference/list-products)
|
|
699
699
|
|
|
700
700
|
```javascript
|
|
701
701
|
client.products.list()
|
|
702
702
|
client.products.list(params)
|
|
703
703
|
```
|
|
704
704
|
|
|
705
|
-
#### [Create SKU](https://docs.voucherify.io/reference
|
|
705
|
+
#### [Create SKU](https://docs.voucherify.io/reference/create-skus)
|
|
706
706
|
|
|
707
707
|
```javascript
|
|
708
708
|
client.products.createSku(productId, sku)
|
|
709
709
|
```
|
|
710
710
|
|
|
711
|
-
Check [SKU object](https://docs.voucherify.io/reference
|
|
711
|
+
Check [SKU object](https://docs.voucherify.io/reference/the-sku-object).
|
|
712
712
|
|
|
713
|
-
#### [Get SKU](https://docs.voucherify.io/reference
|
|
713
|
+
#### [Get SKU](https://docs.voucherify.io/reference/get-skus)
|
|
714
714
|
|
|
715
715
|
```javascript
|
|
716
716
|
client.products.getSku(productId, skuId)
|
|
717
717
|
```
|
|
718
718
|
|
|
719
|
-
#### [Update SKU](https://docs.voucherify.io/reference
|
|
719
|
+
#### [Update SKU](https://docs.voucherify.io/reference/update-skus)
|
|
720
720
|
|
|
721
721
|
```javascript
|
|
722
722
|
client.products.updateSku(productId, sku)
|
|
723
723
|
```
|
|
724
724
|
|
|
725
|
-
#### [Delete SKU](https://docs.voucherify.io/reference
|
|
725
|
+
#### [Delete SKU](https://docs.voucherify.io/reference/delete-skus)
|
|
726
726
|
|
|
727
727
|
```javascript
|
|
728
728
|
client.products.deleteSku(productId, skuId)
|
|
729
729
|
client.products.deleteSku(productId, skuId, { force: true })
|
|
730
730
|
```
|
|
731
731
|
|
|
732
|
-
#### [List all product SKUs](https://docs.voucherify.io/reference
|
|
732
|
+
#### [List all product SKUs](https://docs.voucherify.io/reference/list-skus)
|
|
733
733
|
|
|
734
734
|
```javascript
|
|
735
735
|
client.products.listSkus(productId)
|
|
@@ -751,60 +751,60 @@ Methods are provided within `client.rewards.*` namespace.
|
|
|
751
751
|
- [Delete Reward Assignment](#delete-reward-assignment)
|
|
752
752
|
- [List Reward Assignments](#list-reward-assignments)
|
|
753
753
|
|
|
754
|
-
#### [Create Reward](https://docs.voucherify.io/reference
|
|
754
|
+
#### [Create Reward](https://docs.voucherify.io/reference/create-reward)
|
|
755
755
|
|
|
756
756
|
```javascript
|
|
757
757
|
client.rewards.create(reward)
|
|
758
758
|
```
|
|
759
759
|
|
|
760
|
-
Check [reward object](https://docs.voucherify.io/reference
|
|
760
|
+
Check [reward object](https://docs.voucherify.io/reference/the-reward-object).
|
|
761
761
|
|
|
762
|
-
#### [Get Reward](https://docs.voucherify.io/reference
|
|
762
|
+
#### [Get Reward](https://docs.voucherify.io/reference/get-reward)
|
|
763
763
|
|
|
764
764
|
```javascript
|
|
765
765
|
client.rewards.get(rewardId)
|
|
766
766
|
```
|
|
767
767
|
|
|
768
|
-
#### [Update Reward](https://docs.voucherify.io/reference
|
|
768
|
+
#### [Update Reward](https://docs.voucherify.io/reference/update-reward)
|
|
769
769
|
|
|
770
770
|
```javascript
|
|
771
771
|
client.rewards.update(reward)
|
|
772
772
|
```
|
|
773
773
|
|
|
774
|
-
#### [Delete Reward](https://docs.voucherify.io/reference
|
|
774
|
+
#### [Delete Reward](https://docs.voucherify.io/reference/delete-reward)
|
|
775
775
|
|
|
776
776
|
```javascript
|
|
777
777
|
client.rewards.delete(rewardId)
|
|
778
778
|
```
|
|
779
779
|
|
|
780
|
-
#### [List Rewards](https://docs.voucherify.io/reference
|
|
780
|
+
#### [List Rewards](https://docs.voucherify.io/reference/list-rewards)
|
|
781
781
|
|
|
782
782
|
```javascript
|
|
783
783
|
client.rewards.list()
|
|
784
784
|
client.rewards.list(params)
|
|
785
785
|
```
|
|
786
786
|
|
|
787
|
-
#### [Create Reward Assignment](https://docs.voucherify.io/reference
|
|
787
|
+
#### [Create Reward Assignment](https://docs.voucherify.io/reference/create-reward-assignment)
|
|
788
788
|
|
|
789
789
|
```javascript
|
|
790
790
|
client.rewards.createAssignment(rewardId, assignment)
|
|
791
791
|
```
|
|
792
792
|
|
|
793
|
-
Check [reward assignment object](https://docs.voucherify.io/reference
|
|
793
|
+
Check [reward assignment object](https://docs.voucherify.io/reference/the-reward-assignment-object).
|
|
794
794
|
|
|
795
|
-
#### [Update Reward Assignment](https://docs.voucherify.io/reference
|
|
795
|
+
#### [Update Reward Assignment](https://docs.voucherify.io/reference/update-reward-assignment)
|
|
796
796
|
|
|
797
797
|
```javascript
|
|
798
798
|
client.rewards.updateAssignment(rewardId, assignment)
|
|
799
799
|
```
|
|
800
800
|
|
|
801
|
-
#### [Delete Reward Assignment](https://docs.voucherify.io/reference
|
|
801
|
+
#### [Delete Reward Assignment](https://docs.voucherify.io/reference/delete-reward-assignment)
|
|
802
802
|
|
|
803
803
|
```javascript
|
|
804
804
|
client.rewards.deleteAssignment(rewardId, assignmentId)
|
|
805
805
|
```
|
|
806
806
|
|
|
807
|
-
#### [List Reward Assignments](https://docs.voucherify.io/reference
|
|
807
|
+
#### [List Reward Assignments](https://docs.voucherify.io/reference/list-reward-assignments)
|
|
808
808
|
|
|
809
809
|
```javascript
|
|
810
810
|
client.rewards.listAssignments(rewardId)
|
|
@@ -837,100 +837,100 @@ Methods are provided within `client.loyalties.*` namespace.
|
|
|
837
837
|
- [Add Loyalty Card Balance](#add-loyalty-card-balance)
|
|
838
838
|
- [Redeem Loyalty Card](#redeem-loyalty-card)
|
|
839
839
|
|
|
840
|
-
#### [Create Loyalty Program](https://docs.voucherify.io/reference
|
|
840
|
+
#### [Create Loyalty Program](https://docs.voucherify.io/reference/create-loyalty-program)
|
|
841
841
|
|
|
842
842
|
```javascript
|
|
843
843
|
client.loyalties.create(campaign)
|
|
844
844
|
```
|
|
845
845
|
|
|
846
|
-
#### [Get Loyalty Program](https://docs.voucherify.io/reference
|
|
846
|
+
#### [Get Loyalty Program](https://docs.voucherify.io/reference/get-loyalty-program)
|
|
847
847
|
|
|
848
848
|
```javascript
|
|
849
849
|
client.loyalties.get(campaignId)
|
|
850
850
|
```
|
|
851
851
|
|
|
852
|
-
#### [Update Loyalty Program](https://docs.voucherify.io/reference
|
|
852
|
+
#### [Update Loyalty Program](https://docs.voucherify.io/reference/update-loyalty-program)
|
|
853
853
|
|
|
854
854
|
```javascript
|
|
855
855
|
client.loyalties.update(campaign)
|
|
856
856
|
```
|
|
857
857
|
|
|
858
|
-
#### [Delete Loyalty Program](https://docs.voucherify.io/reference
|
|
858
|
+
#### [Delete Loyalty Program](https://docs.voucherify.io/reference/delete-loyalty-program)
|
|
859
859
|
|
|
860
860
|
```javascript
|
|
861
861
|
client.loyalties.delete(campaignId)
|
|
862
862
|
```
|
|
863
863
|
|
|
864
|
-
#### [List Loyalty Programs](https://docs.voucherify.io/reference
|
|
864
|
+
#### [List Loyalty Programs](https://docs.voucherify.io/reference/list-loyalty-programs)
|
|
865
865
|
|
|
866
866
|
```javascript
|
|
867
867
|
client.loyalties.list()
|
|
868
868
|
client.loyalties.list(params)
|
|
869
869
|
```
|
|
870
870
|
|
|
871
|
-
#### [Create Loyalty Program Reward Assignment](https://docs.voucherify.io/reference
|
|
871
|
+
#### [Create Loyalty Program Reward Assignment](https://docs.voucherify.io/reference/create-reward-assignment-1)
|
|
872
872
|
|
|
873
873
|
```javascript
|
|
874
874
|
client.loyalties.createRewardAssignments(campaignId, assignment)
|
|
875
875
|
```
|
|
876
876
|
|
|
877
|
-
#### [Update Loyalty Program Reward Assignment](https://docs.voucherify.io/reference
|
|
877
|
+
#### [Update Loyalty Program Reward Assignment](https://docs.voucherify.io/reference/update-reward-assignment-1)
|
|
878
878
|
|
|
879
879
|
```javascript
|
|
880
880
|
client.loyalties.updateRewardAssignment(campaignId, assignment)
|
|
881
881
|
```
|
|
882
882
|
|
|
883
|
-
#### [Delete Loyalty Program Reward Assignment](https://docs.voucherify.io/reference
|
|
883
|
+
#### [Delete Loyalty Program Reward Assignment](https://docs.voucherify.io/reference/delete-reward-assignment-1)
|
|
884
884
|
|
|
885
885
|
```javascript
|
|
886
886
|
client.loyalties.deleteRewardAssignment(campaignId, assignmentId)
|
|
887
887
|
```
|
|
888
888
|
|
|
889
|
-
#### [List Loyalty Program Reward Assignments](https://docs.voucherify.io/reference
|
|
889
|
+
#### [List Loyalty Program Reward Assignments](https://docs.voucherify.io/reference/list-reward-assignments-1)
|
|
890
890
|
|
|
891
891
|
```javascript
|
|
892
892
|
client.loyalties.listRewardAssignments(campaignId)
|
|
893
893
|
client.loyalties.listRewardAssignments(campaignId, params)
|
|
894
894
|
```
|
|
895
895
|
|
|
896
|
-
#### [Create Loyalty Program Earning Rules](https://docs.voucherify.io/reference
|
|
896
|
+
#### [Create Loyalty Program Earning Rules](https://docs.voucherify.io/reference/create-earning-rule)
|
|
897
897
|
|
|
898
898
|
```javascript
|
|
899
899
|
client.loyalties.createEarningRule(campaignId, earningRules)
|
|
900
900
|
```
|
|
901
901
|
|
|
902
|
-
#### [Update Loyalty Program Earning Rule](https://docs.voucherify.io/reference
|
|
902
|
+
#### [Update Loyalty Program Earning Rule](https://docs.voucherify.io/reference/update-earning-rule)
|
|
903
903
|
|
|
904
904
|
```javascript
|
|
905
905
|
client.loyalties.updateEarningRule(campaignId, earningRule)
|
|
906
906
|
```
|
|
907
907
|
|
|
908
|
-
#### [Delete Loyalty Program Earning Rule](https://docs.voucherify.io/reference
|
|
908
|
+
#### [Delete Loyalty Program Earning Rule](https://docs.voucherify.io/reference/delete-earning-rule)
|
|
909
909
|
|
|
910
910
|
```javascript
|
|
911
911
|
client.loyalties.deleteEarningRule(campaignId, earningRuleId)
|
|
912
912
|
```
|
|
913
913
|
|
|
914
|
-
#### [List Loyalty Program Earning Rules](https://docs.voucherify.io/reference
|
|
914
|
+
#### [List Loyalty Program Earning Rules](https://docs.voucherify.io/reference/list-earning-rules)
|
|
915
915
|
|
|
916
916
|
```javascript
|
|
917
917
|
client.loyalties.listEarningRules(campaignId)
|
|
918
918
|
client.loyalties.listEarningRules(campaignId, params)
|
|
919
919
|
```
|
|
920
920
|
|
|
921
|
-
#### [Create Loyalty Program Member](https://docs.voucherify.io/reference
|
|
921
|
+
#### [Create Loyalty Program Member](https://docs.voucherify.io/reference/create-member)
|
|
922
922
|
|
|
923
923
|
```javascript
|
|
924
924
|
client.loyalties.createMember(campaignId, member)
|
|
925
925
|
```
|
|
926
926
|
|
|
927
|
-
#### [Get Loyalty Program Member](https://docs.voucherify.io/reference
|
|
927
|
+
#### [Get Loyalty Program Member](https://docs.voucherify.io/reference/get-member)
|
|
928
928
|
|
|
929
929
|
```javascript
|
|
930
930
|
client.loyalties.getMember(campaignId, memberId)
|
|
931
931
|
```
|
|
932
932
|
|
|
933
|
-
#### [List Loyalty Program Members](https://docs.voucherify.io/reference
|
|
933
|
+
#### [List Loyalty Program Members](https://docs.voucherify.io/reference/list-members)
|
|
934
934
|
|
|
935
935
|
```javascript
|
|
936
936
|
client.loyalties.listMembers(campaignId)
|
|
@@ -945,7 +945,7 @@ client.loyalties.getMemberActivities(campaignId, memberId)
|
|
|
945
945
|
|
|
946
946
|
`memberId` referrers to Loyalty Card code.
|
|
947
947
|
|
|
948
|
-
#### [Add Loyalty Card Balance](https://docs.voucherify.io/reference
|
|
948
|
+
#### [Add Loyalty Card Balance](https://docs.voucherify.io/reference/add-loyalty-card-balance)
|
|
949
949
|
|
|
950
950
|
```javascript
|
|
951
951
|
client.loyalties.addPoints(campaignId, memberId, balance)
|
|
@@ -973,21 +973,21 @@ Methods are provided within `client.segments.*` namespace.
|
|
|
973
973
|
- [Get Segment](#get-segment)
|
|
974
974
|
- [Delete Segment](#delete-segment)
|
|
975
975
|
|
|
976
|
-
#### [Create Segment](https://docs.voucherify.io/reference
|
|
976
|
+
#### [Create Segment](https://docs.voucherify.io/reference/create-segment)
|
|
977
977
|
|
|
978
978
|
```javascript
|
|
979
979
|
client.segments.create(segment)
|
|
980
980
|
```
|
|
981
981
|
|
|
982
|
-
Check [the segment object](https://docs.voucherify.io/
|
|
982
|
+
Check [the segment object](https://docs.voucherify.io/reference/the-segment-object).
|
|
983
983
|
|
|
984
|
-
#### [Get Segment](https://docs.voucherify.io/reference
|
|
984
|
+
#### [Get Segment](https://docs.voucherify.io/reference/get-segment)
|
|
985
985
|
|
|
986
986
|
```javascript
|
|
987
987
|
client.segments.get(segmentId)
|
|
988
988
|
```
|
|
989
989
|
|
|
990
|
-
#### [Delete Segment](https://docs.voucherify.io/reference
|
|
990
|
+
#### [Delete Segment](https://docs.voucherify.io/reference/delete-segment)
|
|
991
991
|
|
|
992
992
|
```javascript
|
|
993
993
|
client.segments.delete(segmentId)
|
|
@@ -1008,52 +1008,52 @@ Methods are provided within `client.validationRules.*` namespace.
|
|
|
1008
1008
|
- [List Rules](#list-validation-rules)
|
|
1009
1009
|
- [List Rule Assignments](#list-validation-rule-assignments)
|
|
1010
1010
|
|
|
1011
|
-
#### [Create Validation Rule](https://docs.voucherify.io/reference
|
|
1011
|
+
#### [Create Validation Rule](https://docs.voucherify.io/reference/create-validation-rules)
|
|
1012
1012
|
|
|
1013
1013
|
```javascript
|
|
1014
1014
|
client.validationRules.create(validationRule)
|
|
1015
1015
|
```
|
|
1016
1016
|
|
|
1017
|
-
Check [validation rule object](https://docs.voucherify.io/
|
|
1017
|
+
Check [validation rule object](https://docs.voucherify.io/reference/the-validation-rule-object).
|
|
1018
1018
|
|
|
1019
|
-
#### [Get Validation Rule](https://docs.voucherify.io/reference
|
|
1019
|
+
#### [Get Validation Rule](https://docs.voucherify.io/reference/get-validation-rules)
|
|
1020
1020
|
|
|
1021
1021
|
```javascript
|
|
1022
1022
|
client.validationRules.get(validationRuleId)
|
|
1023
1023
|
```
|
|
1024
1024
|
|
|
1025
|
-
#### [Update Validation Rule](https://docs.voucherify.io/reference
|
|
1025
|
+
#### [Update Validation Rule](https://docs.voucherify.io/reference/update-validation-rules)
|
|
1026
1026
|
|
|
1027
1027
|
```javascript
|
|
1028
1028
|
client.validationRules.update(validationRule)
|
|
1029
1029
|
```
|
|
1030
1030
|
|
|
1031
|
-
#### [Delete Validation Rule](https://docs.voucherify.io/reference
|
|
1031
|
+
#### [Delete Validation Rule](https://docs.voucherify.io/reference/delete-validation-rules)
|
|
1032
1032
|
|
|
1033
1033
|
```javascript
|
|
1034
1034
|
client.validationRules.delete(validationRuleId)
|
|
1035
1035
|
```
|
|
1036
1036
|
|
|
1037
|
-
#### [Create Validation Rule Assignment](https://docs.voucherify.io/reference
|
|
1037
|
+
#### [Create Validation Rule Assignment](https://docs.voucherify.io/reference/create-validation-rules-assignment)
|
|
1038
1038
|
|
|
1039
1039
|
```javascript
|
|
1040
1040
|
client.validationRules.createAssignment(validationRuleId, assignment)
|
|
1041
1041
|
```
|
|
1042
1042
|
|
|
1043
|
-
#### [Delete Validation Rule Assignment](https://docs.voucherify.io/reference
|
|
1043
|
+
#### [Delete Validation Rule Assignment](https://docs.voucherify.io/reference/delete-validation-rules-assignment)
|
|
1044
1044
|
|
|
1045
1045
|
```javascript
|
|
1046
1046
|
client.validationRules.deleteAssignment(validationRuleId, assignmentId)
|
|
1047
1047
|
```
|
|
1048
1048
|
|
|
1049
|
-
#### [List Validation Rules](https://docs.voucherify.io/reference
|
|
1049
|
+
#### [List Validation Rules](https://docs.voucherify.io/reference/list-validation-rules)
|
|
1050
1050
|
|
|
1051
1051
|
```javascript
|
|
1052
1052
|
client.validationRules.list()
|
|
1053
1053
|
client.validationRules.list(params)
|
|
1054
1054
|
```
|
|
1055
1055
|
|
|
1056
|
-
#### [List Validation Rule Assignments](https://docs.voucherify.io/reference
|
|
1056
|
+
#### [List Validation Rule Assignments](https://docs.voucherify.io/reference/list-validation-rule-assignments)
|
|
1057
1057
|
|
|
1058
1058
|
```javascript
|
|
1059
1059
|
client.validationRules.listAssignments(validationRuleId)
|
|
@@ -1068,7 +1068,7 @@ Methods are provided within `client.events.*` namespace.
|
|
|
1068
1068
|
|
|
1069
1069
|
- [Create Custom Event](#create-custom-event)
|
|
1070
1070
|
|
|
1071
|
-
#### [Create Custom Event](
|
|
1071
|
+
#### [Create Custom Event](https://docs.voucherify.io/reference/the-custom-event-object)
|
|
1072
1072
|
|
|
1073
1073
|
```javascript
|
|
1074
1074
|
client.events.create(eventName, { customer })
|
|
@@ -1086,12 +1086,12 @@ Methods are provided within `client.asyncActions.*` namespace.
|
|
|
1086
1086
|
- [Get Async Action](#get-async-action)
|
|
1087
1087
|
- [List Async Actions](#list-async-actions)
|
|
1088
1088
|
|
|
1089
|
-
#### [Get Async Action](
|
|
1089
|
+
#### [Get Async Action](https://docs.voucherify.io/reference/get-async-actions-1)
|
|
1090
1090
|
```javascript
|
|
1091
1091
|
client.asyncActions.get(asyncActionId)
|
|
1092
1092
|
```
|
|
1093
1093
|
|
|
1094
|
-
#### [List Async Actions](
|
|
1094
|
+
#### [List Async Actions](https://docs.voucherify.io/reference/list-async-actions)
|
|
1095
1095
|
```javascript
|
|
1096
1096
|
client.asyncActions.list()
|
|
1097
1097
|
client.asyncActions.list(params)
|
|
@@ -1143,13 +1143,13 @@ Methods are provided within `client.*` namespace.
|
|
|
1143
1143
|
client.setIdentity(trackingId)
|
|
1144
1144
|
```
|
|
1145
1145
|
|
|
1146
|
-
#### [Validate](https://docs.voucherify.io/reference
|
|
1146
|
+
#### [Validate](https://docs.voucherify.io/reference/vouchers-validate)
|
|
1147
1147
|
|
|
1148
1148
|
```javascript
|
|
1149
1149
|
client.validate(params)
|
|
1150
1150
|
```
|
|
1151
1151
|
|
|
1152
|
-
#### [Redeem](https://docs.voucherify.io/reference
|
|
1152
|
+
#### [Redeem](https://docs.voucherify.io/reference/redeem-voucher-client-side)
|
|
1153
1153
|
|
|
1154
1154
|
```javascript
|
|
1155
1155
|
client.redeem(code, payload)
|
|
@@ -1162,14 +1162,14 @@ client.publish(campaignName, payload)
|
|
|
1162
1162
|
client.publish(campaignName, payload, queryParams)
|
|
1163
1163
|
```
|
|
1164
1164
|
|
|
1165
|
-
#### [List vouchers](https://docs.voucherify.io/reference
|
|
1165
|
+
#### [List vouchers](https://docs.voucherify.io/reference/list-vouchers)
|
|
1166
1166
|
|
|
1167
1167
|
```javascript
|
|
1168
1168
|
client.listVouchers()
|
|
1169
1169
|
client.listVouchers(params)
|
|
1170
1170
|
```
|
|
1171
1171
|
|
|
1172
|
-
#### [Create customer](https://docs.voucherify.io/reference
|
|
1172
|
+
#### [Create customer](https://docs.voucherify.io/reference/create-customer)
|
|
1173
1173
|
|
|
1174
1174
|
```javascript
|
|
1175
1175
|
client.createCustomer(customer)
|
|
@@ -1178,19 +1178,19 @@ client.createCustomer(customer, enableDoubleOptIn)
|
|
|
1178
1178
|
|
|
1179
1179
|
`enableDoubleOptIn` sets request header to `{X-Voucherify-Double-Opt-In: true}`, which forces user to confirm registration / subscription.
|
|
1180
1180
|
|
|
1181
|
-
#### [List consents](https://docs.voucherify.io/reference
|
|
1181
|
+
#### [List consents](https://docs.voucherify.io/reference/get-consent-client-side)
|
|
1182
1182
|
|
|
1183
1183
|
```javascript
|
|
1184
1184
|
client.listConsents()
|
|
1185
1185
|
```
|
|
1186
1186
|
|
|
1187
|
-
#### [Update consents](https://docs.voucherify.io/reference
|
|
1187
|
+
#### [Update consents](https://docs.voucherify.io/reference/update-customers-consents-client)
|
|
1188
1188
|
|
|
1189
1189
|
```javascript
|
|
1190
1190
|
client.updateConsents(idOrSourceId, consents)
|
|
1191
1191
|
```
|
|
1192
1192
|
|
|
1193
|
-
#### [Track custom events](https://docs.voucherify.io/reference
|
|
1193
|
+
#### [Track custom events](https://docs.voucherify.io/reference/track-custom-event-client-side)
|
|
1194
1194
|
|
|
1195
1195
|
```javascript
|
|
1196
1196
|
client.track(eventName, metadata, customer)
|
|
@@ -1237,7 +1237,7 @@ You can find TS example in [examples/with-nodejs-typescript](/examples/with-node
|
|
|
1237
1237
|
|
|
1238
1238
|
# <a name="error-handling"></a>😨 Error handling
|
|
1239
1239
|
|
|
1240
|
-
Voucherify `error` object always has consistent structure, described in details in our [API reference](https://docs.voucherify.io/reference
|
|
1240
|
+
Voucherify `error` object always has consistent structure, described in details in our [API reference](https://docs.voucherify.io/reference/errors).
|
|
1241
1241
|
|
|
1242
1242
|
# <a name="legacy"></a>👴 Legacy Voucherify JS SDKs
|
|
1243
1243
|
|