Skip to main content

Get Voucher By Code

Method : POST
Url :https://open.revenuemonster.my/v3/voucher/NAklEfbVdV
Sandbox Url : https://sb-open.revenuemonster.my/v3/voucher/NAklEfbVdV

note

To get single voucher by code

Request Parameters

note
  • The URL is consists of [base_URL]/v3/voucher/[voucher_code].

  • [base_URL] is the base URL depending on your environment (Sandbox or production)

  • Pass an empty JSON object Example: {}

Response Parameters

ParameterTypeDescriptionExample
itemObjectVoucher object(Refer to explanation below)
codeStringSuccessfully call this endpoint. If fail, will return error code object (Refer Appendix 1: Error Codes)"SUCCESS"

Voucher object (item):
ParameterTypeDescriptionExample
keyStringVoucher key"EhQKCE1lcmNoYW50E
JXVzd3wraqTORIVCgdWb3Vja
GVyGgpOQWtsRWZiVmRW"
labelStringlabel of voucher for merchant remarks"Free Breakfast"
voucherBatchKeyStringParent key of current voucher"EhQKCE1lcmNoYW50E
JXVzd3wraqTORIYCgxWb3Vja
GVyQmF0Y2gQkvnGweaB2uQg"
typeStringDefine type of vouchers: DISCOUNT, GIFT, CASH"GIFT"
amountUintRequired if type = CASH, notation in cents, eg. RM 1.00 = 1000
discountRateUintRequired if type = DISCOUNT, notation without decimals, eg. 1% = 100100
minimumSpendAmountUintmin amount to activate this voucher, required if type = CASH, DISCOUNT, notation in cents, eg. RM 1.00 = 100100
originStringSYSTEM (voucher code generated from RM server), SELF (voucher code uploaded from merchant csv file)"SYSTEM"
imageUrlStringImage URL of current voucher, optional""
memberProfileStringMember profile of user's social media""
assignedAtDateTimeDate time of voucher issuance (UTC)"2018-09-28T17:15:17Z"
qrUrlStringQR code for user to scan with Wechat or Facebook to add the voucher into their member account.QR Url link (refer to below code)
codeStringVoucher Code, members can keep this code for future redemption. Same as the qrURL below except this code is not a URL."NAklEfbVdV"
isShippingBooleanTrue if items/goods to be delivered physically to customersfalse
addressStringRequired if isShipping = truenull
expiryObject of ExpiryExpiry date time of current voucher(Refer below)
usedAtDateTimeDate time of voucher being voided (UTC)"GIFT"
redeemedAtDateTimeDate time of voucher being redeemed (UTC)"GIFT"
isDeviceRedeemBooleanTRUE means only can be redeemed through merchant app. FALSE means customer can do redemption from own loyalty app.false
statusStringStatus of current voucher:
1. Merchant created voucher batch (status=VALID)

2. Merchant issued or going to transfer voucher to customer (status=ISSUED)

3. Merchant shows voucher to customer and customer scans to get it (status=REDEEMED)

4. Customers go back to shop and use the voucher (status=VOID)
"VALID"
createdAtDateTimeDate time of voucher being created (UTC)"2018-06-21T11:08:00Z"
updatedAtDateTimeDate time of voucher being updated (UTC)"2018-09-28T17:19:44.686549977Z"

Expiry object (expiry):
ParameterTypeDescriptionExample
typeStringDYNAMIC (days from now), FIXED (specific fixed date)"DYNAMIC"
dayUintOnly required by DYNAMIC expiry type. To indicate number of days from now until expiry.30
expiryAtDateTimeOnly required by FIXED. To indicate specific expiry date."2020-10-07T17:44:26.679908+08:00"

Example Response

{
"item": {
"key": "EhQKCE1lcmNoYW50EJXVzd3wraqTORIVCgdWb3VjaGVyGgpOQWtsRWZiVmRW",
"label": "oijfge",
"redemptionRuleKey": null,
"voucherBatchKey": "EhQKCE1lcmNoYW50EJXVzd3wraqTORIYCgxWb3VjaGVyQmF0Y2gQkvnGweaB2uQg",
"type": "GIFT",
"amount": 0,
"discountRate": 0,
"minimumSpendAmount": 0,
"origin": "SYSTEM",
"imageUrl": "",
"memberProfile": null,
"redemptionRule": null,
"assignedAt": "2018-09-28T17:15:17Z",
"payload": null,
"qrUrl": "http://api.revenuemonster.my/qr/4118165203679668885/voucher/NAklEfbVdV",
"code": "NAklEfbVdV",
"isShipping": false,
"address": null,
"expiry": {
"type": "DYNAMIC",
"day": 100,
"expiredAt": "2019-01-06T17:19:35Z"
},
"usedAt": "2018-09-28T17:19:44.686549737Z",
"redeemedAt": "2018-09-28T17:19:35Z",
"isDeviceRedeem": false,
"status": "VOID",
"createdAt": "2018-06-21T11:08:00Z",
"updatedAt": "2018-09-28T17:19:44.686549977Z"
},
"code": "SUCCESS"
}