Note: This API is part of SimpleLoyalty Third Party V2. For more details, refer to V2 APIs
Description
Redeem a points or SMS voucher in the SimpleLoyalty database.
Parameters
| Parameter | Type | Value | Required |
| operation_name | String | redeemVoucher | true |
| variables | JSON | $JSON_OBJECT | true |
$JSON_OBJECT Structure
| Key | Type | Description | Required |
| outletId | String | SimpleLoyalty Outlet ID | true |
| phoneNumber | String | Customer phone number | true |
| voucherCode | String | Voucher code | true |
Tip: The phone number must include the country code. Example: 60123456789
Tip: The OAuth 2.0 token can be obtained via Get OAuth Token
Example
Sample Request
curl \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OAUTH_TOKEN" \
-d '{
"operation_name": "redeemVoucher",
"variables": {
"outletId": $OUTLET_ID,
"phoneNumber": "60123456789",
"voucherCode": "01234567",
}
}' \
https://simpleloyalty.com/third_party/v2
Sample Success Response
{
"data": {
"redeemVoucher": {
"result": "OK",
"errors": [],
"voucherName": "RM20 Off On Your Next Visit",
"voucherTypeCode": "SL1234"
}
}
}
Sample Error Response
{
"data": {
"redeemVoucher": {
"result": "ERROR",
"errors": [
{"message": "Invalid voucher code"}
]
}
}
}