Get Obtainable Voucher
Retrieve vouchers that can be obtained by the member.
note
The api will also return vouchers that are not eligible to obtain for the moment but it will have a flag to indicate obtainability and a field to elaborate on the reason.
Request
GET:/{integrationId}/member/getablevouchersRequest Parameters
| Parameter | Description | Type | Remark | |
|---|---|---|---|---|
memberId | The Id of member record. | number | required | |
spendingAmount | Amount spent on the transaction. Return records that matches the spending requirement. | number | Set it to null if want to ignore checking the minimum spending requirement. |
Example of Request URL:
Parameters:memberId = 2 spendingAmount = 100 integrationId = d9cdb75e-da7c-43dc-8dee-7d786b464c59 URL:
GET: https://onerewards-integration-api.autocountcloud.com/d9cdb75e-da7c-43dc-8dee-7d786b464c59/member/getablevouchers?memberId=2&spendingAmount=100 Response
Success Response
Status Code: 200
Response Body
Getable Voucher View Model
| Field | Description | Type | |
|---|---|---|---|
canGetNow | Voucher obtainability. true indicates member able to obtain this voucher now. | boolean | |
cantGetNowReason | Reason of voucher unobtainable. Refer here for more details. | number | nullable |
canUseNow | Voucher usability. true indicates member able to use it now if obtained. | boolean | |
cantUseNowReason | Reason of voucher unusable. Refer here for more details. | number | nullable |
voucherInfo | Voucher info. | Voucher Info View Model |
Example of Success Response Body
[
{
"canGetNow": false,
"cantGetNowReason": 3,
"canUseNow": false,
"cantUseNowReason": 3,
"voucherInfo": {
"voucherId": 1,
"voucherName": "Birthday Voucher",
"isPercent": true,
"discountValue": 20,
"description": "20% off to any meal.",
"numberOfVoucherToIssue": 250,
"numberOfVoucherIssued": 250,
"mobileTitle": "Birthday voucher to celebrate your birthday!",
"getIsReobtainable": false,
"getStartDate": "2023-10-01T00:00:00",
"getEndDate": "2023-11-01T00:00:00",
"getRequiredPoints": 0,
"getTermAndCondition": null,
"getMemberLevelIds": [],
"useStartDate": "2023-10-01T00:00:00",
"useEndDate": "2023-11-01T00:00:00",
"useStartTime": "2000-11-10T00:00:00",
"useEndTime": "2023-11-01T23:59:00",
"useEndDateTime": null,
"useValidDays": [
1,
2,
3,
4,
5,
6,
0
],
"useValidOnMemberBirthday": true,
"useValidOnMemberBirthMonth": false,
"useRepeatable": true,
"useMinimumSpending": 0,
"useNumberOfDaysAllowedBeforeMemberBirthday": 1,
"useNumberOfDaysAllowedAfterMemberBirthday": 1,
"useTermAndCondition": null
}
},
{
"canGetNow": true,
"cantGetNowReason": null,
"canUseNow": true,
"cantUseNowReason": null,
"voucherInfo": {
"voucherId": 2,
"voucherName": "PWP 10% off",
"isPercent": true,
"discountValue": 10,
"description": "10% off for second purchase.",
"numberOfVoucherToIssue": null,
"numberOfVoucherIssued": 1,
"mobileTitle": "10% off for second purchase.",
"getIsReobtainable": true,
"getStartDate": "2021-01-01T00:00:00",
"getEndDate": null,
"getRequiredPoints": 0,
"getTermAndCondition": null,
"getMemberLevelIds": [],
"useStartDate": null,
"useEndDate": null,
"useStartTime": "2000-11-10T00:00:00",
"useEndTime": "2000-11-10T23:59:00",
"useEndDateTime": null,
"useValidDays": [
1,
2,
3,
4,
5,
6,
0
],
"useValidOnMemberBirthday": false,
"useValidOnMemberBirthMonth": false,
"useRepeatable": true,
"useMinimumSpending": 0,
"useNumberOfDaysAllowedBeforeMemberBirthday": null,
"useNumberOfDaysAllowedAfterMemberBirthday": null,
"useTermAndCondition": null
}
}
]