You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+37-3
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ Result:
61
61
"code": "9mYBpIk",
62
62
"campaign": null,
63
63
"category": "API Test",
64
+
"type": "DISCOUNT_VOUCHER",
64
65
"discount": {
65
66
"type": "AMOUNT",
66
67
"amount_off": 400
@@ -80,9 +81,9 @@ Result:
80
81
"code": "AzTsIH",
81
82
"campaign": null,
82
83
"category": "API Test",
83
-
"discount": {
84
-
"type": "AMOUNT",
85
-
"amount_off": 400
84
+
"type": "GIFT_VOUCHER",
85
+
"gift": {
86
+
"amount": 5000
86
87
},
87
88
"start_date": "2016-03-01T10:00:00Z",
88
89
"expiration_date": null,
@@ -113,6 +114,7 @@ Result:
113
114
{
114
115
"code": "v1GiJYuuS",
115
116
"campaign": "vip",
117
+
"type": "DISCOUNT_VOUCHER",
116
118
"discount": {
117
119
"percent_off": 10.0,
118
120
"type": "PERCENT"
@@ -142,6 +144,7 @@ Example:
142
144
143
145
```python
144
146
payload = {
147
+
"type": "DISCOUNT_VOUCHER",
145
148
"discount": {
146
149
"type": "AMOUNT",
147
150
"amount_off": 1000# 10.00
@@ -161,6 +164,7 @@ Result:
161
164
"code": "JxiJaV",
162
165
"campaign": null,
163
166
"category": "API Test",
167
+
"type": "DISCOUNT_VOUCHER",
164
168
"discount": {
165
169
"type": "AMOUNT",
166
170
"amount_off": 1000
@@ -303,6 +307,7 @@ Result *(for both)*:
303
307
"code": "FR-zT-u9I7zG",
304
308
"campaign": "First Ride",
305
309
"category": null,
310
+
"type": "DISCOUNT_VOUCHER",
306
311
"discount": {
307
312
"type": "PERCENT",
308
313
"amount_off": 50
@@ -359,6 +364,7 @@ Result (voucher details after redemption):
359
364
"voucher": {
360
365
"code": "v1GiJYuuS",
361
366
"campaign": "vip",
367
+
"type": "DISCOUNT_VOUCHER",
362
368
"discount": {
363
369
"percent_off": 10.0,
364
370
"type": "PERCENT"
@@ -422,6 +428,7 @@ Result:
422
428
"voucher": {
423
429
"code": "v1GiJYuuS",
424
430
"campaign": "vip",
431
+
"type": "DISCOUNT_VOUCHER",
425
432
"discount": {
426
433
"percent_off": 10.0,
427
434
"type": "PERCENT"
@@ -485,6 +492,31 @@ payload = {
485
492
voucherify.redeem(payload)
486
493
```
487
494
495
+
##### 4. With customer id
496
+
497
+
If you already created a customer profile in Voucherify's database, whether it was implicitly by providing it to the `redeem` function or explicitly by invoking the [`customer.create`](#create-customer) method, you can identify your customer in following redemptions by a generated id (starting with `cust_`).
498
+
499
+
```python
500
+
voucherify.redeem({
501
+
voucher: "v1GiJYuuS",
502
+
customer: {
503
+
id: "cust_C9qJ3xKgZFqkpMw7b21MF2ow"
504
+
})
505
+
```
506
+
507
+
##### 5. With order amount
508
+
509
+
Redeeming a gift voucher requires to pass an amount that you wish to withdraw from the voucher.
510
+
Order amount have to be expressed in cents, as an integer. For example $22.50 should be provided as2250:
511
+
512
+
```python
513
+
voucherify.redeem({
514
+
voucher: "91Ft4U",
515
+
order: {
516
+
amount: 2250
517
+
})
518
+
```
519
+
488
520
### Listing redemptions
489
521
490
522
Use `redemptions` to get a filtered list of redemptions.
0 commit comments