Skip to main content

Get Usable Voucher

Retrieve vouchers that can be used by the member.

note

The api will also return vouchers that are not eligible to use for the moment but it will have a flag to indicate usability and a field to elaborate on the reason.

Request​

GET:/{integrationId}/member/usablevouchers

Request Parameters​

ParameterDescriptionTypeRemark
memberIdThe Id of member record.numberrequired
spendingAmountAmount spent on the transaction. Return records that matches the spending requirement.numberSet 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/usablevouchers?memberId=2&spendingAmount=100

Response​

Success Response​

Status Code: 200

Response Body​

Usable Voucher View Model
FieldDescriptionType
canUseNowVoucher usability. true indicates member able to use it now.boolean
cantUseNowReasonReason of voucher unusable. Refer here for more details.numbernullable
voucherNoVoucher Id.string
voucherInfoVoucher info.Voucher Info View Model
Example of Success Response Body
[
{
"canUseNow": true,
"cantUseNowReason": null,
"voucherNo": "00001-00001-000001"
"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
}
}
]

Error Response​