-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into gift-utils
Conflicts: README.md
- Loading branch information
Showing
2 changed files
with
128 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,48 +58,66 @@ vouchers_list = voucherify.list(filter_params) | |
Result: | ||
```json | ||
[{ | ||
"code": "9mYBpIk", | ||
"campaign": null, | ||
"category": "API Test", | ||
"type": "DISCOUNT_VOUCHER", | ||
"discount": { | ||
"type": "AMOUNT", | ||
"amount_off": 400 | ||
}, | ||
"start_date": "2016-03-01T12:00:00Z", | ||
"expiration_date": null, | ||
"redemption": { | ||
"quantity": 1, | ||
"redeemed_quantity": 0, | ||
"redemption_entries": [] | ||
}, | ||
"active": true, | ||
"additional_info": null, | ||
"metadata": null | ||
}, | ||
{ | ||
"code": "AzTsIH", | ||
"campaign": null, | ||
"category": "API Test", | ||
"type": "GIFT_VOUCHER", | ||
"gift": { | ||
"code": "9mYBpIk", | ||
"campaign": null, | ||
"category": "API Test", | ||
"type": "DISCOUNT_VOUCHER", | ||
"discount": { | ||
"type": "AMOUNT", | ||
"amount_off": 400 | ||
}, | ||
"start_date": "2016-03-01T12:00:00Z", | ||
"expiration_date": null, | ||
"publish": { | ||
"object": "list", | ||
"count": 1, | ||
"data_ref": "entries", | ||
"entries": [{ | ||
"channel": "Email", | ||
"published_at": "2016-04-10T12:00:00Z", | ||
"customer": "[email protected]", | ||
"customer_id": "cust_1fnSUBno3iimKTPNDCkjg4xV" | ||
}] | ||
}, | ||
"redemption": { | ||
"object": "list", | ||
"quantity": 1, | ||
"data_ref": "redemption_entries", | ||
"redeemed_quantity": 0, | ||
"redemption_entries": [] | ||
}, | ||
"active": true, | ||
"additional_info": null, | ||
"metadata": null | ||
},{ | ||
"code": "AzTsIH", | ||
"campaign": null, | ||
"category": "API Test", | ||
"type": "GIFT_VOUCHER", | ||
"gift": { | ||
"amount": 10000, | ||
"balance": 5000 | ||
|
||
}, | ||
"start_date": "2016-03-01T10:00:00Z", | ||
"expiration_date": null, | ||
"redemption": { | ||
}, | ||
"start_date": "2016-03-01T10:00:00Z", | ||
"expiration_date": null, | ||
"publish": { | ||
"object": "list", | ||
"count": 0, | ||
"data_ref": "entries", | ||
"entries": [] | ||
}, | ||
"redemption": { | ||
"object": "list", | ||
"quantity": 1, | ||
"data_ref": "redemption_entries", | ||
"redeemed_quantity": 0, | ||
"redeemed_amount": 0, | ||
"redemption_entries": [] | ||
}, | ||
"active": true, | ||
"additional_info": null, | ||
"metadata": null | ||
}, | ||
... | ||
] | ||
}, | ||
"active": true, | ||
"additional_info": null, | ||
"metadata": null | ||
}] | ||
``` | ||
|
||
#### Getting voucher details | ||
|
@@ -122,18 +140,29 @@ Result: | |
"type": "PERCENT" | ||
}, | ||
"expiration_date": "2016-12-31T23:59:59Z", | ||
"publish": { | ||
"object": "list", | ||
"count": 1, | ||
"data_ref": "entries", | ||
"entries": [{ | ||
"channel": "Email", | ||
"published_at": "2016-04-10T12:00:00Z", | ||
"customer": "[email protected]", | ||
"customer_id": "cust_1fnSUBno3iimKTPNDCkjg4xV" | ||
}] | ||
}, | ||
"redemption": { | ||
"quantity": 3, | ||
"redeemed_quantity": 1, | ||
"redemption_entries": [ | ||
{ | ||
"id": "r_gQzOnTwmhn2nTLwW4sZslNKY", | ||
"object": "redemption", | ||
"date": "2016-04-24T06:03:35Z", | ||
"customer_id": "GENERATED-CUSTOMER-ID", | ||
"tracking_id": "GENERATED-OR-PROVIDED-TRACKING-ID" | ||
} | ||
] | ||
"object": "list", | ||
"quantity": 1, | ||
"data_ref": "redemption_entries", | ||
"redeemed_quantity": 0, | ||
"redemption_entries": [{ | ||
"id": "r_gQzOnTwmhn2nTLwW4sZslNKY", | ||
"object": "redemption", | ||
"date": "2016-04-24T06:03:35Z", | ||
"customer_id": "GENERATED-CUSTOMER-ID", | ||
"tracking_id": "GENERATED-OR-PROVIDED-TRACKING-ID" | ||
}] | ||
}, | ||
"additional_info": "" | ||
} | ||
|
@@ -186,8 +215,16 @@ Result: | |
}, | ||
"start_date": "2016-01-01T00:00:00Z", | ||
"expiration_date": "2016-12-31T23:59:59Z", | ||
"publish": { | ||
"object": "list", | ||
"count": 0, | ||
"data_ref": "entries", | ||
"entries": [] | ||
}, | ||
"redemption": { | ||
"quantity": 1, | ||
"object": "list", | ||
"quantity": 0, | ||
"data_ref": "redemption_entries", | ||
"redeemed_quantity": 0, | ||
"redemption_entries": [] | ||
}, | ||
|
@@ -296,7 +333,9 @@ result = voucherify.redemption("Testing7fjWdr") | |
Result: | ||
```json | ||
{ | ||
"object": "list", | ||
"quantity": 3, | ||
"data_ref": "redemption_entries", | ||
"redeemed_quantity": 1, | ||
"redemption_entries": [ | ||
{ | ||
|
@@ -329,11 +368,22 @@ result = voucherify.publish("First Ride") | |
|
||
`voucherify.publish(params)` | ||
|
||
Example: | ||
Using campaign name: | ||
|
||
```python | ||
payload = { | ||
"campaign": "First Ride", | ||
"channel": "SDK Test", | ||
"customer": "[email protected]" | ||
} | ||
result = voucherify.publish(payload) | ||
``` | ||
|
||
Using voucher code: | ||
|
||
```python | ||
payload = { | ||
"voucher": "FR-zT-u9I7zG", | ||
"channel": "Email", | ||
"customer": "[email protected]" | ||
} | ||
|
@@ -344,31 +394,36 @@ Result *(for both)*: | |
|
||
```json | ||
{ | ||
"code": "FR-zT-u9I7zG", | ||
"campaign": "First Ride", | ||
"category": null, | ||
"type": "DISCOUNT_VOUCHER", | ||
"discount": { | ||
"type": "PERCENT", | ||
"amount_off": 50 | ||
}, | ||
"start_date": "2015-01-01T00:00:00Z", | ||
"expiration_date": "2016-12-31T23:59:59Z", | ||
"publish": { | ||
"count": 1, | ||
"code": "FR-zT-u9I7zG", | ||
"campaign": "First Ride", | ||
"category": null, | ||
"type": "DISCOUNT_VOUCHER", | ||
"discount": { | ||
"type": "PERCENT", | ||
"amount_off": 50 | ||
}, | ||
"start_date": "2015-01-01T00:00:00Z", | ||
"expiration_date": "2016-12-31T23:59:59Z", | ||
"publish": { | ||
"object": "list", | ||
"count": 0, | ||
"data_ref": "entries", | ||
"entries": [{ | ||
"channel": "Email", | ||
"customer": "[email protected]", | ||
"customer_id": "cust_84LPwcHJ1jVEpxV1uF9nLLBB", | ||
"published_at": "2016-01-22T09:25:07Z" | ||
}] | ||
}, | ||
"redemption": { | ||
"quantity": 1, | ||
"redeemed_quantity": 0, | ||
"redemption_entries": [] | ||
}, | ||
"active": true, | ||
"additional_info": null | ||
}, | ||
"redemption": { | ||
"object": "list", | ||
"quantity": 0, | ||
"data_ref": "redemption_entries", | ||
"redeemed_quantity": 0, | ||
"redemption_entries": [] | ||
}, | ||
"active": true, | ||
"additional_info": null | ||
} | ||
``` | ||
|
||
|
@@ -821,7 +876,8 @@ new_price = utils.calculate_price(base_price, voucher, unit_price) | |
|
||
### Changelog | ||
|
||
- **2016-12-02** - `1.4.1` - Support gift vouchers in utils | ||
- **2016-12-02** - `1.4.2` - Support gift vouchers in utils | ||
- **2016-10-04** - `1.4.1` - Publish update | ||
- **2016-07-18** - `1.4.0` - Voucher code pattern | ||
- **2016-07-18** - `1.3.0` - Update voucher | ||
- **2016-06-23** - `1.2.1` - Gift vouchers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters