@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
|
@@ -75,6 +75,9 @@ class RequestController {
|
|
|
75
75
|
async post(path, body, params, headers) {
|
|
76
76
|
const response = await this.request.post(path, body, {
|
|
77
77
|
params,
|
|
78
|
+
paramsSerializer: function (params) {
|
|
79
|
+
return Qs.stringify(params);
|
|
80
|
+
},
|
|
78
81
|
headers
|
|
79
82
|
});
|
|
80
83
|
return response.data;
|
|
@@ -148,7 +151,7 @@ class AsyncActions {
|
|
|
148
151
|
this.client = client;
|
|
149
152
|
}
|
|
150
153
|
/**
|
|
151
|
-
* @see https://docs.voucherify.io/reference
|
|
154
|
+
* @see https://docs.voucherify.io/reference/get-async-actions-1
|
|
152
155
|
*/
|
|
153
156
|
|
|
154
157
|
|
|
@@ -156,7 +159,7 @@ class AsyncActions {
|
|
|
156
159
|
return this.client.get(`/async-actions/${encode(asyncActionId)}`);
|
|
157
160
|
}
|
|
158
161
|
/**
|
|
159
|
-
* @see https://docs.voucherify.io/reference
|
|
162
|
+
* @see https://docs.voucherify.io/reference/list-async-actions
|
|
160
163
|
*/
|
|
161
164
|
|
|
162
165
|
|
|
@@ -186,7 +189,7 @@ class Campaigns {
|
|
|
186
189
|
this.qualifications = new CampaignsQualifications(this.client);
|
|
187
190
|
}
|
|
188
191
|
/**
|
|
189
|
-
* @see https://docs.voucherify.io/reference
|
|
192
|
+
* @see https://docs.voucherify.io/reference/create-campaign
|
|
190
193
|
*/
|
|
191
194
|
|
|
192
195
|
|
|
@@ -194,7 +197,7 @@ class Campaigns {
|
|
|
194
197
|
return this.client.post('/campaigns', campaign);
|
|
195
198
|
}
|
|
196
199
|
/**
|
|
197
|
-
* @see https://docs.voucherify.io/reference
|
|
200
|
+
* @see https://docs.voucherify.io/reference/update-campaign
|
|
198
201
|
*/
|
|
199
202
|
|
|
200
203
|
|
|
@@ -202,7 +205,7 @@ class Campaigns {
|
|
|
202
205
|
return this.client.put(`/campaigns/${encode(nameOrId)}`, campaign);
|
|
203
206
|
}
|
|
204
207
|
/**
|
|
205
|
-
* @see https://docs.voucherify.io/reference
|
|
208
|
+
* @see https://docs.voucherify.io/reference/get-campaign
|
|
206
209
|
*/
|
|
207
210
|
|
|
208
211
|
|
|
@@ -210,7 +213,7 @@ class Campaigns {
|
|
|
210
213
|
return this.client.get(`/campaigns/${encode(name)}`);
|
|
211
214
|
}
|
|
212
215
|
/**
|
|
213
|
-
* @see https://docs.voucherify.io/reference
|
|
216
|
+
* @see https://docs.voucherify.io/reference/delete-campaign
|
|
214
217
|
*/
|
|
215
218
|
|
|
216
219
|
|
|
@@ -218,7 +221,7 @@ class Campaigns {
|
|
|
218
221
|
return this.client.delete(`/campaigns/${encode(name)}`, params);
|
|
219
222
|
}
|
|
220
223
|
/**
|
|
221
|
-
* @see https://docs.voucherify.io/reference
|
|
224
|
+
* @see https://docs.voucherify.io/reference/add-voucher-to-campaign
|
|
222
225
|
*/
|
|
223
226
|
|
|
224
227
|
|
|
@@ -226,7 +229,7 @@ class Campaigns {
|
|
|
226
229
|
return this.client.post(`/campaigns/${encode(name)}/vouchers`, body, params);
|
|
227
230
|
}
|
|
228
231
|
/**
|
|
229
|
-
* @see https://docs.voucherify.io/reference
|
|
232
|
+
* @see https://docs.voucherify.io/reference/add-voucher-with-certain-code-to-campaign
|
|
230
233
|
*/
|
|
231
234
|
|
|
232
235
|
|
|
@@ -234,7 +237,7 @@ class Campaigns {
|
|
|
234
237
|
return this.client.post(`/campaigns/${encode(name)}/vouchers/${encode(code)}`, body);
|
|
235
238
|
}
|
|
236
239
|
/**
|
|
237
|
-
* @see https://docs.voucherify.io/reference
|
|
240
|
+
* @see https://docs.voucherify.io/reference/import-vouchers
|
|
238
241
|
*/
|
|
239
242
|
|
|
240
243
|
|
|
@@ -242,7 +245,7 @@ class Campaigns {
|
|
|
242
245
|
return this.client.post(`/campaigns/${encode(campaignName)}/import`, vouchers);
|
|
243
246
|
}
|
|
244
247
|
/**
|
|
245
|
-
* @see https://docs.voucherify.io/
|
|
248
|
+
* @see https://docs.voucherify.io/reference/list-campaigns
|
|
246
249
|
*/
|
|
247
250
|
|
|
248
251
|
|
|
@@ -258,7 +261,7 @@ class DistributionsPublications {
|
|
|
258
261
|
this.client = client;
|
|
259
262
|
}
|
|
260
263
|
/**
|
|
261
|
-
* @see https://docs.voucherify.io/reference
|
|
264
|
+
* @see https://docs.voucherify.io/reference/list-publications
|
|
262
265
|
*/
|
|
263
266
|
|
|
264
267
|
|
|
@@ -266,7 +269,7 @@ class DistributionsPublications {
|
|
|
266
269
|
return this.client.get('/publications', params);
|
|
267
270
|
}
|
|
268
271
|
/**
|
|
269
|
-
* @see https://docs.voucherify.io/reference
|
|
272
|
+
* @see https://docs.voucherify.io/reference/create-publication
|
|
270
273
|
*/
|
|
271
274
|
|
|
272
275
|
|
|
@@ -294,7 +297,7 @@ class Exports {
|
|
|
294
297
|
this.client = client;
|
|
295
298
|
}
|
|
296
299
|
/**
|
|
297
|
-
* @see https://docs.voucherify.io/reference
|
|
300
|
+
* @see https://docs.voucherify.io/reference/create-export
|
|
298
301
|
*/
|
|
299
302
|
|
|
300
303
|
|
|
@@ -302,7 +305,7 @@ class Exports {
|
|
|
302
305
|
return this.client.post('/exports', exportResource);
|
|
303
306
|
}
|
|
304
307
|
/**
|
|
305
|
-
* @see https://docs.voucherify.io/reference
|
|
308
|
+
* @see https://docs.voucherify.io/reference/get-export
|
|
306
309
|
*/
|
|
307
310
|
|
|
308
311
|
|
|
@@ -310,7 +313,7 @@ class Exports {
|
|
|
310
313
|
return this.client.get(`/exports/${encode(exportResourceId)}`);
|
|
311
314
|
}
|
|
312
315
|
/**
|
|
313
|
-
* @see https://docs.voucherify.io/reference
|
|
316
|
+
* @see https://docs.voucherify.io/reference/delete-export
|
|
314
317
|
*/
|
|
315
318
|
|
|
316
319
|
|
|
@@ -325,6 +328,10 @@ class Events {
|
|
|
325
328
|
this.client = void 0;
|
|
326
329
|
this.client = client;
|
|
327
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* @see https://docs.voucherify.io/reference/track-custom-event-client-side
|
|
333
|
+
*/
|
|
334
|
+
|
|
328
335
|
|
|
329
336
|
create(eventName, params) {
|
|
330
337
|
params = { ...params,
|
|
@@ -343,7 +350,7 @@ class Balance {
|
|
|
343
350
|
/**
|
|
344
351
|
* Add Gift Voucher Balance
|
|
345
352
|
* This method gives a possibility to add balance to an existing gift voucher.
|
|
346
|
-
* @see https://docs.voucherify.io/reference
|
|
353
|
+
* @see https://docs.voucherify.io/reference/add-gift-voucher-balance
|
|
347
354
|
*/
|
|
348
355
|
|
|
349
356
|
|
|
@@ -361,7 +368,8 @@ class VouchersQualification {
|
|
|
361
368
|
/**
|
|
362
369
|
* The method can be used for sending a request to display all vouchers qualified to the given customer and context (e.g., order, loyalty reward). A checking logic won't run among coupons from bulk unique codes campaigns. For campaigns with multiple unique codes, you should run a dedicated function for searching for qualified campaigns.
|
|
363
370
|
* As a sample use case, you can imagine a requirement of displaying below cart the coupons eligible to a customer. The customer can take and apply the proposed voucher.
|
|
364
|
-
*
|
|
371
|
+
*
|
|
372
|
+
* @see https://docs.voucherify.io/reference/push-qualification-request
|
|
365
373
|
*/
|
|
366
374
|
|
|
367
375
|
|
|
@@ -381,7 +389,7 @@ class Vouchers {
|
|
|
381
389
|
this.qualifications = new VouchersQualification(this.client);
|
|
382
390
|
}
|
|
383
391
|
/**
|
|
384
|
-
* @see https://docs.voucherify.io/reference
|
|
392
|
+
* @see https://docs.voucherify.io/reference/create-voucher
|
|
385
393
|
*/
|
|
386
394
|
|
|
387
395
|
|
|
@@ -389,7 +397,7 @@ class Vouchers {
|
|
|
389
397
|
return this.client.post(`/vouchers/${encode(voucher.code)}`, voucher);
|
|
390
398
|
}
|
|
391
399
|
/**
|
|
392
|
-
* @see https://docs.voucherify.io/reference
|
|
400
|
+
* @see https://docs.voucherify.io/reference/vouchers-get
|
|
393
401
|
*/
|
|
394
402
|
|
|
395
403
|
|
|
@@ -397,7 +405,7 @@ class Vouchers {
|
|
|
397
405
|
return this.client.get(`/vouchers/${encode(code)}`);
|
|
398
406
|
}
|
|
399
407
|
/**
|
|
400
|
-
* @see https://docs.voucherify.io/reference
|
|
408
|
+
* @see https://docs.voucherify.io/reference/update-voucher
|
|
401
409
|
*/
|
|
402
410
|
|
|
403
411
|
|
|
@@ -405,7 +413,7 @@ class Vouchers {
|
|
|
405
413
|
return this.client.put(`/vouchers/${encode(voucher.code)}`, voucher);
|
|
406
414
|
}
|
|
407
415
|
/**
|
|
408
|
-
* @see https://docs.voucherify.io/reference
|
|
416
|
+
* @see https://docs.voucherify.io/reference/delete-voucher
|
|
409
417
|
*/
|
|
410
418
|
|
|
411
419
|
|
|
@@ -413,7 +421,7 @@ class Vouchers {
|
|
|
413
421
|
return this.client.delete(`/vouchers/${encode(code)}`, params);
|
|
414
422
|
}
|
|
415
423
|
/**
|
|
416
|
-
* @see https://docs.voucherify.io/reference
|
|
424
|
+
* @see https://docs.voucherify.io/reference/list-vouchers
|
|
417
425
|
*/
|
|
418
426
|
|
|
419
427
|
|
|
@@ -421,7 +429,7 @@ class Vouchers {
|
|
|
421
429
|
return this.client.get('/vouchers', params);
|
|
422
430
|
}
|
|
423
431
|
/**
|
|
424
|
-
* @see https://docs.voucherify.io/reference
|
|
432
|
+
* @see https://docs.voucherify.io/reference/enable-voucher
|
|
425
433
|
*/
|
|
426
434
|
|
|
427
435
|
|
|
@@ -429,7 +437,7 @@ class Vouchers {
|
|
|
429
437
|
return this.client.post(`/vouchers/${encode(code)}/enable`, {});
|
|
430
438
|
}
|
|
431
439
|
/**
|
|
432
|
-
* @see https://docs.voucherify.io/reference
|
|
440
|
+
* @see https://docs.voucherify.io/reference/disable-voucher
|
|
433
441
|
*/
|
|
434
442
|
|
|
435
443
|
|
|
@@ -437,7 +445,7 @@ class Vouchers {
|
|
|
437
445
|
return this.client.post(`/vouchers/${encode(code)}/disable`, {});
|
|
438
446
|
}
|
|
439
447
|
/**
|
|
440
|
-
* @see https://docs.voucherify.io/reference
|
|
448
|
+
* @see https://docs.voucherify.io/reference/import-vouchers-1
|
|
441
449
|
*/
|
|
442
450
|
|
|
443
451
|
|
|
@@ -445,23 +453,23 @@ class Vouchers {
|
|
|
445
453
|
return this.client.post('/vouchers/import', vouchers);
|
|
446
454
|
}
|
|
447
455
|
/**
|
|
448
|
-
* @see https://docs.voucherify.io/reference
|
|
456
|
+
* @see https://docs.voucherify.io/reference/aaupdate-vouchers-metadata-in-bulk
|
|
449
457
|
*/
|
|
450
458
|
|
|
451
459
|
|
|
452
460
|
bulkUpdateMetadata(params) {
|
|
453
|
-
return this.client.post('/vouchers/metadata', params);
|
|
461
|
+
return this.client.post('/vouchers/metadata/async', params);
|
|
454
462
|
}
|
|
455
463
|
/**
|
|
456
|
-
* @see https://docs.voucherify.io/reference
|
|
464
|
+
* @see https://docs.voucherify.io/reference/aa-update-vouchers-in-bulk
|
|
457
465
|
*/
|
|
458
466
|
|
|
459
467
|
|
|
460
468
|
bulkUpdate(vouchers) {
|
|
461
|
-
return this.client.post('/vouchers/bulk', vouchers);
|
|
469
|
+
return this.client.post('/vouchers/bulk/async', vouchers);
|
|
462
470
|
}
|
|
463
471
|
/**
|
|
464
|
-
* @see https://docs.voucherify.io/reference
|
|
472
|
+
* @see https://docs.voucherify.io/reference/release-validation-session
|
|
465
473
|
*/
|
|
466
474
|
|
|
467
475
|
|
|
@@ -479,7 +487,7 @@ class Validations {
|
|
|
479
487
|
this.promotions = promotions;
|
|
480
488
|
}
|
|
481
489
|
/**
|
|
482
|
-
* @see https://docs.voucherify.io/reference
|
|
490
|
+
* @see https://docs.voucherify.io/reference/validate-voucher
|
|
483
491
|
*/
|
|
484
492
|
|
|
485
493
|
|
|
@@ -503,7 +511,7 @@ class Redemptions {
|
|
|
503
511
|
this.client = client;
|
|
504
512
|
}
|
|
505
513
|
/**
|
|
506
|
-
* @see https://docs.voucherify.io/reference
|
|
514
|
+
* @see https://docs.voucherify.io/reference/redeem-voucher
|
|
507
515
|
*/
|
|
508
516
|
|
|
509
517
|
|
|
@@ -511,7 +519,7 @@ class Redemptions {
|
|
|
511
519
|
return this.client.post(`/vouchers/${encode(code)}/redemption`, body);
|
|
512
520
|
}
|
|
513
521
|
/**
|
|
514
|
-
* @see https://docs.voucherify.io/reference
|
|
522
|
+
* @see https://docs.voucherify.io/reference/get-redemption
|
|
515
523
|
*/
|
|
516
524
|
|
|
517
525
|
|
|
@@ -519,7 +527,7 @@ class Redemptions {
|
|
|
519
527
|
return this.client.get(`/redemptions/${encode(redemptionId)}`);
|
|
520
528
|
}
|
|
521
529
|
/**
|
|
522
|
-
* @see https://docs.voucherify.io/reference
|
|
530
|
+
* @see https://docs.voucherify.io/reference/list-redemptions
|
|
523
531
|
*/
|
|
524
532
|
|
|
525
533
|
|
|
@@ -527,7 +535,7 @@ class Redemptions {
|
|
|
527
535
|
return this.client.get('/redemptions', params);
|
|
528
536
|
}
|
|
529
537
|
/**
|
|
530
|
-
* @see https://docs.voucherify.io/reference
|
|
538
|
+
* @see https://docs.voucherify.io/reference/vouchers-redemptions
|
|
531
539
|
*/
|
|
532
540
|
|
|
533
541
|
|
|
@@ -535,7 +543,7 @@ class Redemptions {
|
|
|
535
543
|
return this.client.get(`/vouchers/${encode(code)}/redemption`);
|
|
536
544
|
}
|
|
537
545
|
/**
|
|
538
|
-
* @see https://docs.voucherify.io/reference
|
|
546
|
+
* @see https://docs.voucherify.io/reference/rollback-redemption
|
|
539
547
|
*/
|
|
540
548
|
|
|
541
549
|
|
|
@@ -571,7 +579,7 @@ class PromotionTiers {
|
|
|
571
579
|
this.client = client;
|
|
572
580
|
}
|
|
573
581
|
/**
|
|
574
|
-
* @see
|
|
582
|
+
* @see https://docs.voucherify.io/reference/list-promotion-tiers
|
|
575
583
|
*/
|
|
576
584
|
|
|
577
585
|
|
|
@@ -579,7 +587,7 @@ class PromotionTiers {
|
|
|
579
587
|
return this.client.get('/promotions/tiers', params);
|
|
580
588
|
}
|
|
581
589
|
/**
|
|
582
|
-
* @see
|
|
590
|
+
* @see https://docs.voucherify.io/reference/get-promotions
|
|
583
591
|
*/
|
|
584
592
|
|
|
585
593
|
|
|
@@ -587,7 +595,7 @@ class PromotionTiers {
|
|
|
587
595
|
return this.client.get(`/promotions/${encode(promotionId)}/tiers`);
|
|
588
596
|
}
|
|
589
597
|
/**
|
|
590
|
-
* @see
|
|
598
|
+
* @see https://docs.voucherify.io/reference/add-promotion-tier-to-campaign
|
|
591
599
|
*/
|
|
592
600
|
|
|
593
601
|
|
|
@@ -595,7 +603,7 @@ class PromotionTiers {
|
|
|
595
603
|
return this.client.post(`/promotions/${encode(promotionId)}/tiers`, params);
|
|
596
604
|
}
|
|
597
605
|
/**
|
|
598
|
-
* @see
|
|
606
|
+
* @see https://docs.voucherify.io/reference/redeem-promotion
|
|
599
607
|
*/
|
|
600
608
|
|
|
601
609
|
|
|
@@ -603,7 +611,7 @@ class PromotionTiers {
|
|
|
603
611
|
return this.client.post(`/promotions/tiers/${encode(promotionsTierId)}/redemption`, params);
|
|
604
612
|
}
|
|
605
613
|
/**
|
|
606
|
-
* @see
|
|
614
|
+
* @see https://docs.voucherify.io/reference/update-promotion
|
|
607
615
|
*/
|
|
608
616
|
|
|
609
617
|
|
|
@@ -611,7 +619,7 @@ class PromotionTiers {
|
|
|
611
619
|
return this.client.put(`/promotions/tiers/${encode(params.id)}`, params);
|
|
612
620
|
}
|
|
613
621
|
/**
|
|
614
|
-
* @see
|
|
622
|
+
* @see https://docs.voucherify.io/reference/delete-promotion
|
|
615
623
|
*/
|
|
616
624
|
|
|
617
625
|
|
|
@@ -629,7 +637,7 @@ class Promotions {
|
|
|
629
637
|
this.tiers = tiers;
|
|
630
638
|
}
|
|
631
639
|
/**
|
|
632
|
-
* @see
|
|
640
|
+
* @see https://docs.voucherify.io/reference/create-promotion-campaign
|
|
633
641
|
*/
|
|
634
642
|
|
|
635
643
|
|
|
@@ -637,12 +645,12 @@ class Promotions {
|
|
|
637
645
|
return this.client.post('/campaigns', promotionCampaign);
|
|
638
646
|
}
|
|
639
647
|
/**
|
|
640
|
-
* @see
|
|
648
|
+
* @see https://docs.voucherify.io/reference/validate-promotions-1
|
|
641
649
|
*/
|
|
642
650
|
|
|
643
651
|
|
|
644
|
-
validate(params) {
|
|
645
|
-
return this.client.post('/promotions/validation', params);
|
|
652
|
+
validate(body, params) {
|
|
653
|
+
return this.client.post('/promotions/validation', body, params);
|
|
646
654
|
}
|
|
647
655
|
|
|
648
656
|
}
|
|
@@ -653,7 +661,7 @@ class Customers {
|
|
|
653
661
|
this.client = client;
|
|
654
662
|
}
|
|
655
663
|
/**
|
|
656
|
-
* @see https://docs.voucherify.io/reference
|
|
664
|
+
* @see https://docs.voucherify.io/reference/create-customer
|
|
657
665
|
*/
|
|
658
666
|
|
|
659
667
|
|
|
@@ -661,7 +669,7 @@ class Customers {
|
|
|
661
669
|
return this.client.post('/customers', customer);
|
|
662
670
|
}
|
|
663
671
|
/**
|
|
664
|
-
* @see https://docs.voucherify.io/reference
|
|
672
|
+
* @see https://docs.voucherify.io/reference/read-customer
|
|
665
673
|
*/
|
|
666
674
|
|
|
667
675
|
|
|
@@ -669,7 +677,7 @@ class Customers {
|
|
|
669
677
|
return this.client.get(`/customers/${encode(customerId)}`);
|
|
670
678
|
}
|
|
671
679
|
/**
|
|
672
|
-
* @see https://docs.voucherify.io/reference
|
|
680
|
+
* @see https://docs.voucherify.io/reference/list-customers
|
|
673
681
|
*/
|
|
674
682
|
|
|
675
683
|
|
|
@@ -717,7 +725,7 @@ class Customers {
|
|
|
717
725
|
}
|
|
718
726
|
}
|
|
719
727
|
/**
|
|
720
|
-
* @see https://docs.voucherify.io/reference
|
|
728
|
+
* @see https://docs.voucherify.io/reference/update-customer
|
|
721
729
|
*/
|
|
722
730
|
|
|
723
731
|
|
|
@@ -727,7 +735,7 @@ class Customers {
|
|
|
727
735
|
return this.client.put(`/customers/${encode(id)}`, customerWithoutId);
|
|
728
736
|
}
|
|
729
737
|
/**
|
|
730
|
-
* @see https://docs.voucherify.io/reference
|
|
738
|
+
* @see https://docs.voucherify.io/reference/delete-customer
|
|
731
739
|
*/
|
|
732
740
|
|
|
733
741
|
|
|
@@ -735,7 +743,7 @@ class Customers {
|
|
|
735
743
|
return this.client.delete(`/customers/${encode(customerId)}`);
|
|
736
744
|
}
|
|
737
745
|
/**
|
|
738
|
-
* @see https://docs.voucherify.io/reference
|
|
746
|
+
* @see https://docs.voucherify.io/reference/update-customers-consents
|
|
739
747
|
*/
|
|
740
748
|
|
|
741
749
|
|
|
@@ -751,7 +759,7 @@ class Consents {
|
|
|
751
759
|
this.client = client;
|
|
752
760
|
}
|
|
753
761
|
/**
|
|
754
|
-
* @see https://docs.voucherify.io/reference
|
|
762
|
+
* @see https://docs.voucherify.io/reference/get-consents
|
|
755
763
|
*/
|
|
756
764
|
|
|
757
765
|
|
|
@@ -767,7 +775,7 @@ class Orders {
|
|
|
767
775
|
this.client = client;
|
|
768
776
|
}
|
|
769
777
|
/**
|
|
770
|
-
* @see https://docs.voucherify.io/reference
|
|
778
|
+
* @see https://docs.voucherify.io/reference/create-order
|
|
771
779
|
*/
|
|
772
780
|
|
|
773
781
|
|
|
@@ -775,7 +783,7 @@ class Orders {
|
|
|
775
783
|
return this.client.post('/orders', order);
|
|
776
784
|
}
|
|
777
785
|
/**
|
|
778
|
-
* @see https://docs.voucherify.io/reference
|
|
786
|
+
* @see https://docs.voucherify.io/reference/get-order
|
|
779
787
|
*/
|
|
780
788
|
|
|
781
789
|
|
|
@@ -783,7 +791,7 @@ class Orders {
|
|
|
783
791
|
return this.client.get(`/orders/${encode(orderId)}`);
|
|
784
792
|
}
|
|
785
793
|
/**
|
|
786
|
-
* @see https://docs.voucherify.io/reference
|
|
794
|
+
* @see https://docs.voucherify.io/reference/update-order
|
|
787
795
|
*/
|
|
788
796
|
|
|
789
797
|
|
|
@@ -791,7 +799,7 @@ class Orders {
|
|
|
791
799
|
return this.client.put(`/orders/${encode(order.id || order.source_id)}`, omit(order, ['id']));
|
|
792
800
|
}
|
|
793
801
|
/**
|
|
794
|
-
* @see https://docs.voucherify.io/reference
|
|
802
|
+
* @see https://docs.voucherify.io/reference/list-orders
|
|
795
803
|
*/
|
|
796
804
|
|
|
797
805
|
|
|
@@ -807,7 +815,7 @@ class Products {
|
|
|
807
815
|
this.client = client;
|
|
808
816
|
}
|
|
809
817
|
/**
|
|
810
|
-
* @see https://docs.voucherify.io/reference
|
|
818
|
+
* @see https://docs.voucherify.io/reference/create-product
|
|
811
819
|
*/
|
|
812
820
|
|
|
813
821
|
|
|
@@ -815,7 +823,7 @@ class Products {
|
|
|
815
823
|
return this.client.post('/products', product);
|
|
816
824
|
}
|
|
817
825
|
/**
|
|
818
|
-
* @see https://docs.voucherify.io/reference
|
|
826
|
+
* @see https://docs.voucherify.io/reference/get-product
|
|
819
827
|
*/
|
|
820
828
|
|
|
821
829
|
|
|
@@ -823,7 +831,7 @@ class Products {
|
|
|
823
831
|
return this.client.get(`/products/${encode(productId)}`);
|
|
824
832
|
}
|
|
825
833
|
/**
|
|
826
|
-
* @see https://docs.voucherify.io/reference
|
|
834
|
+
* @see https://docs.voucherify.io/reference/update-product
|
|
827
835
|
*/
|
|
828
836
|
|
|
829
837
|
|
|
@@ -831,23 +839,23 @@ class Products {
|
|
|
831
839
|
return this.client.put(`/products/${encode(product.id || product.source_id)}`, omit(product, ['id']));
|
|
832
840
|
}
|
|
833
841
|
/**
|
|
834
|
-
* @see https://docs.voucherify.io/reference
|
|
842
|
+
* @see https://docs.voucherify.io/reference/async-update-products-metadata-in-bulk
|
|
835
843
|
*/
|
|
836
844
|
|
|
837
845
|
|
|
838
|
-
|
|
839
|
-
return this.client.post('/products/metadata', products);
|
|
846
|
+
bulkUpdateMetadata(products) {
|
|
847
|
+
return this.client.post('/products/metadata/async', products);
|
|
840
848
|
}
|
|
841
849
|
/**
|
|
842
|
-
* @see https://docs.voucherify.io/reference
|
|
850
|
+
* @see https://docs.voucherify.io/reference/post-products-in-bulk
|
|
843
851
|
*/
|
|
844
852
|
|
|
845
853
|
|
|
846
854
|
bulkUpdate(products) {
|
|
847
|
-
return this.client.post('/products/bulk', products);
|
|
855
|
+
return this.client.post('/products/bulk/async', products);
|
|
848
856
|
}
|
|
849
857
|
/**
|
|
850
|
-
* @see https://docs.voucherify.io/reference
|
|
858
|
+
* @see https://docs.voucherify.io/reference/delete-product
|
|
851
859
|
*/
|
|
852
860
|
|
|
853
861
|
|
|
@@ -855,7 +863,7 @@ class Products {
|
|
|
855
863
|
return this.client.delete(`/products/${encode(productId)}`, params);
|
|
856
864
|
}
|
|
857
865
|
/**
|
|
858
|
-
* @see https://docs.voucherify.io/reference
|
|
866
|
+
* @see https://docs.voucherify.io/reference/list-products
|
|
859
867
|
*/
|
|
860
868
|
|
|
861
869
|
|
|
@@ -863,7 +871,7 @@ class Products {
|
|
|
863
871
|
return this.client.get('/products', params);
|
|
864
872
|
}
|
|
865
873
|
/**
|
|
866
|
-
* @see https://docs.voucherify.io/reference
|
|
874
|
+
* @see https://docs.voucherify.io/reference/create-sku
|
|
867
875
|
*/
|
|
868
876
|
|
|
869
877
|
|
|
@@ -871,15 +879,15 @@ class Products {
|
|
|
871
879
|
return this.client.post(`/products/${encode(productId)}/skus`, sku);
|
|
872
880
|
}
|
|
873
881
|
/**
|
|
874
|
-
* @see https://docs.voucherify.io/reference
|
|
882
|
+
* @see https://docs.voucherify.io/reference/get-sku-v20210726
|
|
875
883
|
*/
|
|
876
884
|
|
|
877
885
|
|
|
878
|
-
getSku(
|
|
879
|
-
return this.client.get(`/
|
|
886
|
+
getSku(skuId) {
|
|
887
|
+
return this.client.get(`/skus/${encode(skuId)}`);
|
|
880
888
|
}
|
|
881
889
|
/**
|
|
882
|
-
* @see https://docs.voucherify.io/reference
|
|
890
|
+
* @see https://docs.voucherify.io/reference/update-sku
|
|
883
891
|
*/
|
|
884
892
|
|
|
885
893
|
|
|
@@ -887,7 +895,7 @@ class Products {
|
|
|
887
895
|
return this.client.put(`/products/${encode(productId)}/skus/${encode(sku.id || sku.source_id)}`, omit(sku, ['id']));
|
|
888
896
|
}
|
|
889
897
|
/**
|
|
890
|
-
* @see https://docs.voucherify.io/reference
|
|
898
|
+
* @see https://docs.voucherify.io/reference/delete-sku
|
|
891
899
|
*/
|
|
892
900
|
|
|
893
901
|
|
|
@@ -895,7 +903,7 @@ class Products {
|
|
|
895
903
|
return this.client.delete(`/products/${encode(productId)}/skus/${encode(skuId)}`, params);
|
|
896
904
|
}
|
|
897
905
|
/**
|
|
898
|
-
* @see https://docs.voucherify.io/reference
|
|
906
|
+
* @see https://docs.voucherify.io/reference/list-skus
|
|
899
907
|
*/
|
|
900
908
|
|
|
901
909
|
|
|
@@ -911,7 +919,7 @@ class Rewards {
|
|
|
911
919
|
this.client = client;
|
|
912
920
|
}
|
|
913
921
|
/**
|
|
914
|
-
* @see https://docs.voucherify.io/reference
|
|
922
|
+
* @see https://docs.voucherify.io/reference/list-rewards
|
|
915
923
|
*/
|
|
916
924
|
|
|
917
925
|
|
|
@@ -919,7 +927,7 @@ class Rewards {
|
|
|
919
927
|
return this.client.get('/rewards', params);
|
|
920
928
|
}
|
|
921
929
|
/**
|
|
922
|
-
* @see https://docs.voucherify.io/reference
|
|
930
|
+
* @see https://docs.voucherify.io/reference/create-reward
|
|
923
931
|
*/
|
|
924
932
|
|
|
925
933
|
|
|
@@ -927,7 +935,7 @@ class Rewards {
|
|
|
927
935
|
return this.client.post('/rewards', reward);
|
|
928
936
|
}
|
|
929
937
|
/**
|
|
930
|
-
* @see https://docs.voucherify.io/reference
|
|
938
|
+
* @see https://docs.voucherify.io/reference/get-reward
|
|
931
939
|
*/
|
|
932
940
|
|
|
933
941
|
|
|
@@ -935,7 +943,7 @@ class Rewards {
|
|
|
935
943
|
return this.client.get(`/rewards/${encode(rewardId)}`);
|
|
936
944
|
}
|
|
937
945
|
/**
|
|
938
|
-
* @see https://docs.voucherify.io/reference
|
|
946
|
+
* @see https://docs.voucherify.io/reference/update-reward
|
|
939
947
|
*/
|
|
940
948
|
|
|
941
949
|
|
|
@@ -943,7 +951,7 @@ class Rewards {
|
|
|
943
951
|
return this.client.put(`/rewards/${encode(reward.id)}`, omit(reward, ['id']));
|
|
944
952
|
}
|
|
945
953
|
/**
|
|
946
|
-
* @see https://docs.voucherify.io/reference
|
|
954
|
+
* @see https://docs.voucherify.io/reference/delete-reward
|
|
947
955
|
*/
|
|
948
956
|
|
|
949
957
|
|
|
@@ -951,7 +959,7 @@ class Rewards {
|
|
|
951
959
|
return this.client.delete(`/rewards/${encode(rewardId)}`);
|
|
952
960
|
}
|
|
953
961
|
/**
|
|
954
|
-
* @see https://docs.voucherify.io/reference
|
|
962
|
+
* @see https://docs.voucherify.io/reference/list-reward-assignments
|
|
955
963
|
*/
|
|
956
964
|
|
|
957
965
|
|
|
@@ -959,7 +967,7 @@ class Rewards {
|
|
|
959
967
|
return this.client.get(`/rewards/${encode(rewardId)}/assignments`, params);
|
|
960
968
|
}
|
|
961
969
|
/**
|
|
962
|
-
* @see https://docs.voucherify.io/reference
|
|
970
|
+
* @see https://docs.voucherify.io/reference/create-reward-assignment
|
|
963
971
|
*/
|
|
964
972
|
|
|
965
973
|
|
|
@@ -967,7 +975,7 @@ class Rewards {
|
|
|
967
975
|
return this.client.post(`/rewards/${encode(rewardId)}/assignments`, assignment);
|
|
968
976
|
}
|
|
969
977
|
/**
|
|
970
|
-
* @see https://docs.voucherify.io/reference
|
|
978
|
+
* @see https://docs.voucherify.io/reference/update-reward-assignment
|
|
971
979
|
*/
|
|
972
980
|
|
|
973
981
|
|
|
@@ -987,7 +995,7 @@ class Loyalties {
|
|
|
987
995
|
this.client = client;
|
|
988
996
|
}
|
|
989
997
|
/**
|
|
990
|
-
* @see https://docs.voucherify.io/reference
|
|
998
|
+
* @see https://docs.voucherify.io/reference/list-loyalty-programs
|
|
991
999
|
*/
|
|
992
1000
|
|
|
993
1001
|
|
|
@@ -995,7 +1003,7 @@ class Loyalties {
|
|
|
995
1003
|
return this.client.get('/loyalties', params);
|
|
996
1004
|
}
|
|
997
1005
|
/**
|
|
998
|
-
* @see https://docs.voucherify.io/reference
|
|
1006
|
+
* @see https://docs.voucherify.io/reference/create-loyalty-program
|
|
999
1007
|
*/
|
|
1000
1008
|
|
|
1001
1009
|
|
|
@@ -1003,7 +1011,7 @@ class Loyalties {
|
|
|
1003
1011
|
return this.client.post('/loyalties', campaign);
|
|
1004
1012
|
}
|
|
1005
1013
|
/**
|
|
1006
|
-
* @see https://docs.voucherify.io/reference
|
|
1014
|
+
* @see https://docs.voucherify.io/reference/get-loyalty-program
|
|
1007
1015
|
*/
|
|
1008
1016
|
|
|
1009
1017
|
|
|
@@ -1011,7 +1019,7 @@ class Loyalties {
|
|
|
1011
1019
|
return this.client.get(`/loyalties/${encode(campaignId)}`);
|
|
1012
1020
|
}
|
|
1013
1021
|
/**
|
|
1014
|
-
* @see https://docs.voucherify.io/reference
|
|
1022
|
+
* @see https://docs.voucherify.io/reference/update-loyalty-program
|
|
1015
1023
|
*/
|
|
1016
1024
|
|
|
1017
1025
|
|
|
@@ -1019,7 +1027,7 @@ class Loyalties {
|
|
|
1019
1027
|
return this.client.put(`/loyalties/${encode(campaign.id)}`, omit(campaign, ['id']));
|
|
1020
1028
|
}
|
|
1021
1029
|
/**
|
|
1022
|
-
* @see https://docs.voucherify.io/reference
|
|
1030
|
+
* @see https://docs.voucherify.io/reference/delete-loyalty-program
|
|
1023
1031
|
*/
|
|
1024
1032
|
|
|
1025
1033
|
|
|
@@ -1027,7 +1035,7 @@ class Loyalties {
|
|
|
1027
1035
|
return this.client.delete(`/loyalties/${encode(campaignId)}`, params);
|
|
1028
1036
|
}
|
|
1029
1037
|
/**
|
|
1030
|
-
* @see https://docs.voucherify.io/reference
|
|
1038
|
+
* @see https://docs.voucherify.io/reference/list-reward-assignments-1
|
|
1031
1039
|
*/
|
|
1032
1040
|
|
|
1033
1041
|
|
|
@@ -1035,7 +1043,7 @@ class Loyalties {
|
|
|
1035
1043
|
return this.client.get(`/loyalties/${encode(campaignId)}/rewards`, params);
|
|
1036
1044
|
}
|
|
1037
1045
|
/**
|
|
1038
|
-
* @see https://docs.voucherify.io/reference
|
|
1046
|
+
* @see https://docs.voucherify.io/reference/create-reward-assignment-1
|
|
1039
1047
|
*/
|
|
1040
1048
|
|
|
1041
1049
|
|
|
@@ -1043,7 +1051,7 @@ class Loyalties {
|
|
|
1043
1051
|
return this.client.post(`/loyalties/${encode(campaignId)}/rewards`, assignment);
|
|
1044
1052
|
}
|
|
1045
1053
|
/**
|
|
1046
|
-
* @see https://docs.voucherify.io/reference
|
|
1054
|
+
* @see https://docs.voucherify.io/reference/update-reward-assignment-1
|
|
1047
1055
|
*/
|
|
1048
1056
|
|
|
1049
1057
|
|
|
@@ -1051,7 +1059,7 @@ class Loyalties {
|
|
|
1051
1059
|
return this.client.put(`/loyalties/${encode(campaignId)}/rewards/${assignment.id}`, omit(assignment, ['id']));
|
|
1052
1060
|
}
|
|
1053
1061
|
/**
|
|
1054
|
-
* @see https://docs.voucherify.io/reference
|
|
1062
|
+
* @see https://docs.voucherify.io/reference/delete-reward-assignment-1
|
|
1055
1063
|
*/
|
|
1056
1064
|
|
|
1057
1065
|
|
|
@@ -1059,7 +1067,7 @@ class Loyalties {
|
|
|
1059
1067
|
return this.client.delete(`/loyalties/${encode(campaignId)}/rewards/${assignmentId}`);
|
|
1060
1068
|
}
|
|
1061
1069
|
/**
|
|
1062
|
-
* @see https://docs.voucherify.io/reference
|
|
1070
|
+
* @see https://docs.voucherify.io/reference/list-earning-rules
|
|
1063
1071
|
*/
|
|
1064
1072
|
|
|
1065
1073
|
|
|
@@ -1067,7 +1075,7 @@ class Loyalties {
|
|
|
1067
1075
|
return this.client.get(`/loyalties/${encode(campaignId)}/earning-rules`, params);
|
|
1068
1076
|
}
|
|
1069
1077
|
/**
|
|
1070
|
-
* @see https://docs.voucherify.io/reference
|
|
1078
|
+
* @see https://docs.voucherify.io/reference/create-earning-rule
|
|
1071
1079
|
*/
|
|
1072
1080
|
|
|
1073
1081
|
|
|
@@ -1075,7 +1083,7 @@ class Loyalties {
|
|
|
1075
1083
|
return this.client.post(`/loyalties/${encode(campaignId)}/earning-rules`, earningRules);
|
|
1076
1084
|
}
|
|
1077
1085
|
/**
|
|
1078
|
-
* @see https://docs.voucherify.io/reference
|
|
1086
|
+
* @see https://docs.voucherify.io/reference/update-earning-rule
|
|
1079
1087
|
*/
|
|
1080
1088
|
|
|
1081
1089
|
|
|
@@ -1083,7 +1091,7 @@ class Loyalties {
|
|
|
1083
1091
|
return this.client.put(`/loyalties/${encode(campaignId)}/earning-rules/${earningRule.id}`, omit(earningRule, ['id']));
|
|
1084
1092
|
}
|
|
1085
1093
|
/**
|
|
1086
|
-
* @see https://docs.voucherify.io/reference
|
|
1094
|
+
* @see https://docs.voucherify.io/reference/delete-earning-rule
|
|
1087
1095
|
*/
|
|
1088
1096
|
|
|
1089
1097
|
|
|
@@ -1091,7 +1099,7 @@ class Loyalties {
|
|
|
1091
1099
|
return this.client.delete(`/loyalties/${encode(campaignId)}/earning-rules/${earningRuleId}`);
|
|
1092
1100
|
}
|
|
1093
1101
|
/**
|
|
1094
|
-
* @see https://docs.voucherify.io/reference
|
|
1102
|
+
* @see https://docs.voucherify.io/reference/list-members
|
|
1095
1103
|
*/
|
|
1096
1104
|
|
|
1097
1105
|
|
|
@@ -1099,7 +1107,7 @@ class Loyalties {
|
|
|
1099
1107
|
return this.client.get(`/loyalties/${encode(campaignId)}/members`, params);
|
|
1100
1108
|
}
|
|
1101
1109
|
/**
|
|
1102
|
-
* @see https://docs.voucherify.io/reference
|
|
1110
|
+
* @see https://docs.voucherify.io/reference/create-member
|
|
1103
1111
|
*/
|
|
1104
1112
|
|
|
1105
1113
|
|
|
@@ -1107,7 +1115,7 @@ class Loyalties {
|
|
|
1107
1115
|
return this.client.post(`/loyalties/${encode(campaignId)}/members`, member);
|
|
1108
1116
|
}
|
|
1109
1117
|
/**
|
|
1110
|
-
* @see https://docs.voucherify.io/reference
|
|
1118
|
+
* @see https://docs.voucherify.io/reference/get-member
|
|
1111
1119
|
*/
|
|
1112
1120
|
|
|
1113
1121
|
|
|
@@ -1115,7 +1123,7 @@ class Loyalties {
|
|
|
1115
1123
|
return this.client.get(`/loyalties/${encode(campaignId)}/members/${memberId}`);
|
|
1116
1124
|
}
|
|
1117
1125
|
/**
|
|
1118
|
-
* @see https://docs.voucherify.io/reference
|
|
1126
|
+
* @see https://docs.voucherify.io/reference/get-member-activities
|
|
1119
1127
|
*/
|
|
1120
1128
|
|
|
1121
1129
|
|
|
@@ -1123,7 +1131,7 @@ class Loyalties {
|
|
|
1123
1131
|
return this.client.get(`/loyalties/${encode(campaignId)}/members/${memberId}/activities`);
|
|
1124
1132
|
}
|
|
1125
1133
|
/**
|
|
1126
|
-
* @see https://docs.voucherify.io/reference
|
|
1134
|
+
* @see https://docs.voucherify.io/reference/add-loyalty-card-balance
|
|
1127
1135
|
*/
|
|
1128
1136
|
|
|
1129
1137
|
|
|
@@ -1131,7 +1139,7 @@ class Loyalties {
|
|
|
1131
1139
|
return this.client.post(`/loyalties/${encode(campaignId)}/members/${memberId}/balance`, balance);
|
|
1132
1140
|
}
|
|
1133
1141
|
/**
|
|
1134
|
-
* @see https://docs.voucherify.io/reference
|
|
1142
|
+
* @see https://docs.voucherify.io/reference/redeem-loyalty-card
|
|
1135
1143
|
*/
|
|
1136
1144
|
|
|
1137
1145
|
|
|
@@ -1147,7 +1155,7 @@ class ValidationRules {
|
|
|
1147
1155
|
this.client = client;
|
|
1148
1156
|
}
|
|
1149
1157
|
/**
|
|
1150
|
-
* @see https://docs.voucherify.io/reference
|
|
1158
|
+
* @see https://docs.voucherify.io/reference/create-validation-rules
|
|
1151
1159
|
*/
|
|
1152
1160
|
|
|
1153
1161
|
|
|
@@ -1155,7 +1163,7 @@ class ValidationRules {
|
|
|
1155
1163
|
return this.client.post('/validation-rules', validationRule);
|
|
1156
1164
|
}
|
|
1157
1165
|
/**
|
|
1158
|
-
* @see https://docs.voucherify.io/reference
|
|
1166
|
+
* @see https://docs.voucherify.io/reference/get-validation-rules
|
|
1159
1167
|
*/
|
|
1160
1168
|
|
|
1161
1169
|
|
|
@@ -1163,7 +1171,7 @@ class ValidationRules {
|
|
|
1163
1171
|
return this.client.get(`/validation-rules/${encode(validationRuleId)}`);
|
|
1164
1172
|
}
|
|
1165
1173
|
/**
|
|
1166
|
-
* @see https://docs.voucherify.io/reference
|
|
1174
|
+
* @see https://docs.voucherify.io/reference/update-validation-rules
|
|
1167
1175
|
*/
|
|
1168
1176
|
|
|
1169
1177
|
|
|
@@ -1171,7 +1179,7 @@ class ValidationRules {
|
|
|
1171
1179
|
return this.client.put(`/validation-rules/${encode(validationRule.id)}`, omit(validationRule, ['id']));
|
|
1172
1180
|
}
|
|
1173
1181
|
/**
|
|
1174
|
-
* @see https://docs.voucherify.io/reference
|
|
1182
|
+
* @see https://docs.voucherify.io/reference/delete-validation-rules
|
|
1175
1183
|
*/
|
|
1176
1184
|
|
|
1177
1185
|
|
|
@@ -1179,7 +1187,7 @@ class ValidationRules {
|
|
|
1179
1187
|
return this.client.delete(`/validation-rules/${encode(validationRuleId)}`);
|
|
1180
1188
|
}
|
|
1181
1189
|
/**
|
|
1182
|
-
* @see https://docs.voucherify.io/reference
|
|
1190
|
+
* @see https://docs.voucherify.io/reference/create-validation-rules-assignment
|
|
1183
1191
|
*/
|
|
1184
1192
|
|
|
1185
1193
|
|
|
@@ -1187,7 +1195,7 @@ class ValidationRules {
|
|
|
1187
1195
|
return this.client.post(`/validation-rules/${encode(validationRuleId)}/assignments`, assignment);
|
|
1188
1196
|
}
|
|
1189
1197
|
/**
|
|
1190
|
-
* @see https://docs.voucherify.io/reference
|
|
1198
|
+
* @see https://docs.voucherify.io/reference/delete-validation-rules-assignment
|
|
1191
1199
|
*/
|
|
1192
1200
|
|
|
1193
1201
|
|
|
@@ -1199,7 +1207,7 @@ class ValidationRules {
|
|
|
1199
1207
|
return this.client.post(`/validation-rules/${encode(validationRuleId)}/validation`, params);
|
|
1200
1208
|
}
|
|
1201
1209
|
/**
|
|
1202
|
-
* @see https://docs.voucherify.io/reference
|
|
1210
|
+
* @see https://docs.voucherify.io/reference/list-validation-rules
|
|
1203
1211
|
*/
|
|
1204
1212
|
|
|
1205
1213
|
|
|
@@ -1207,7 +1215,7 @@ class ValidationRules {
|
|
|
1207
1215
|
return this.client.get('/validation-rules', params);
|
|
1208
1216
|
}
|
|
1209
1217
|
/**
|
|
1210
|
-
* @see https://docs.voucherify.io/reference
|
|
1218
|
+
* @see https://docs.voucherify.io/reference/list-validation-rule-assignments
|
|
1211
1219
|
*/
|
|
1212
1220
|
|
|
1213
1221
|
|
|
@@ -1223,7 +1231,7 @@ class Segments {
|
|
|
1223
1231
|
this.client = client;
|
|
1224
1232
|
}
|
|
1225
1233
|
/**
|
|
1226
|
-
* @see https://docs.voucherify.io/reference
|
|
1234
|
+
* @see https://docs.voucherify.io/reference/create-segment
|
|
1227
1235
|
*/
|
|
1228
1236
|
|
|
1229
1237
|
|
|
@@ -1231,7 +1239,7 @@ class Segments {
|
|
|
1231
1239
|
return this.client.post('/segments', segment);
|
|
1232
1240
|
}
|
|
1233
1241
|
/**
|
|
1234
|
-
* @see https://docs.voucherify.io/reference
|
|
1242
|
+
* @see https://docs.voucherify.io/reference/get-segment
|
|
1235
1243
|
*/
|
|
1236
1244
|
|
|
1237
1245
|
|
|
@@ -1239,7 +1247,7 @@ class Segments {
|
|
|
1239
1247
|
return this.client.get(`/segments/${encode(segmentId)}`);
|
|
1240
1248
|
}
|
|
1241
1249
|
/**
|
|
1242
|
-
* @see https://docs.voucherify.io/reference
|
|
1250
|
+
* @see https://docs.voucherify.io/reference/delete-segment
|
|
1243
1251
|
*/
|
|
1244
1252
|
|
|
1245
1253
|
|
|
@@ -1247,7 +1255,7 @@ class Segments {
|
|
|
1247
1255
|
return this.client.delete(`/segments/${encode(segmentId)}`);
|
|
1248
1256
|
}
|
|
1249
1257
|
/**
|
|
1250
|
-
* @see https://docs.voucherify.io/reference
|
|
1258
|
+
* @see https://docs.voucherify.io/reference/list-segments
|
|
1251
1259
|
*/
|
|
1252
1260
|
|
|
1253
1261
|
|
|
@@ -1285,7 +1293,7 @@ function VoucherifyServerSide(options) {
|
|
|
1285
1293
|
let headers = {
|
|
1286
1294
|
'X-App-Id': options.applicationId,
|
|
1287
1295
|
'X-App-Token': options.secretKey,
|
|
1288
|
-
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"
|
|
1296
|
+
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.0.2"}`,
|
|
1289
1297
|
'Content-Type': 'application/json'
|
|
1290
1298
|
};
|
|
1291
1299
|
|
|
@@ -1363,7 +1371,7 @@ class ClientSide {
|
|
|
1363
1371
|
this.trackingId = identity;
|
|
1364
1372
|
}
|
|
1365
1373
|
/**
|
|
1366
|
-
* @see https://docs.voucherify.io/reference
|
|
1374
|
+
* @see https://docs.voucherify.io/reference/vouchers-validate
|
|
1367
1375
|
*/
|
|
1368
1376
|
|
|
1369
1377
|
|
|
@@ -1385,6 +1393,10 @@ class ClientSide {
|
|
|
1385
1393
|
};
|
|
1386
1394
|
query.customer = params.customer;
|
|
1387
1395
|
query.tracking_id = params.tracking_id || this.trackingId;
|
|
1396
|
+
query.session_type = params.session_type;
|
|
1397
|
+
query.session_key = params.session_key;
|
|
1398
|
+
query.session_ttl = params.session_ttl;
|
|
1399
|
+
query.session_ttl_unit = params.session_ttl_unit;
|
|
1388
1400
|
}
|
|
1389
1401
|
|
|
1390
1402
|
if (!!query.code) {
|
|
@@ -1400,7 +1412,7 @@ class ClientSide {
|
|
|
1400
1412
|
return this.client.get(path, query);
|
|
1401
1413
|
}
|
|
1402
1414
|
/**
|
|
1403
|
-
* @see https://docs.voucherify.io/reference
|
|
1415
|
+
* @see https://docs.voucherify.io/reference/redeem-voucher-client-side
|
|
1404
1416
|
*/
|
|
1405
1417
|
|
|
1406
1418
|
|
|
@@ -1416,7 +1428,7 @@ class ClientSide {
|
|
|
1416
1428
|
});
|
|
1417
1429
|
}
|
|
1418
1430
|
/**
|
|
1419
|
-
* @see https://docs.voucherify.io/reference
|
|
1431
|
+
* @see https://docs.voucherify.io/reference/create-publication
|
|
1420
1432
|
*/
|
|
1421
1433
|
|
|
1422
1434
|
|
|
@@ -1434,7 +1446,7 @@ class ClientSide {
|
|
|
1434
1446
|
return this.client.post('/publish', preparedPayload, queryParams);
|
|
1435
1447
|
}
|
|
1436
1448
|
/**
|
|
1437
|
-
* @see https://docs.voucherify.io/reference
|
|
1449
|
+
* @see https://docs.voucherify.io/reference/track-custom-event-client-side
|
|
1438
1450
|
*/
|
|
1439
1451
|
|
|
1440
1452
|
|
|
@@ -1455,7 +1467,7 @@ class ClientSide {
|
|
|
1455
1467
|
return this.client.post('/events', payload);
|
|
1456
1468
|
}
|
|
1457
1469
|
/**
|
|
1458
|
-
* @see https://docs.voucherify.io/reference
|
|
1470
|
+
* @see https://docs.voucherify.io/reference/list-vouchers
|
|
1459
1471
|
*/
|
|
1460
1472
|
|
|
1461
1473
|
|
|
@@ -1471,7 +1483,7 @@ class ClientSide {
|
|
|
1471
1483
|
return this.client.get('/vouchers', query);
|
|
1472
1484
|
}
|
|
1473
1485
|
/**
|
|
1474
|
-
* @see https://docs.voucherify.io/reference
|
|
1486
|
+
* @see https://docs.voucherify.io/reference/create-customer
|
|
1475
1487
|
*/
|
|
1476
1488
|
|
|
1477
1489
|
|
|
@@ -1481,7 +1493,7 @@ class ClientSide {
|
|
|
1481
1493
|
} : {});
|
|
1482
1494
|
}
|
|
1483
1495
|
/**
|
|
1484
|
-
* @see https://docs.voucherify.io/reference
|
|
1496
|
+
* @see https://docs.voucherify.io/reference/get-consent-client-side
|
|
1485
1497
|
*/
|
|
1486
1498
|
|
|
1487
1499
|
|
|
@@ -1489,7 +1501,7 @@ class ClientSide {
|
|
|
1489
1501
|
return this.client.get('/consents');
|
|
1490
1502
|
}
|
|
1491
1503
|
/**
|
|
1492
|
-
* @see https://docs.voucherify.io/reference
|
|
1504
|
+
* @see https://docs.voucherify.io/reference/update-customers-consents-client
|
|
1493
1505
|
*/
|
|
1494
1506
|
|
|
1495
1507
|
|
|
@@ -1510,7 +1522,7 @@ function VoucherifyClientSide(options) {
|
|
|
1510
1522
|
let headers = {
|
|
1511
1523
|
'X-Client-Application-Id': options.clientApplicationId,
|
|
1512
1524
|
'X-Client-Token': options.clientSecretKey,
|
|
1513
|
-
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"
|
|
1525
|
+
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.0.2"}`
|
|
1514
1526
|
};
|
|
1515
1527
|
|
|
1516
1528
|
if (environment().startsWith('Node')) {
|