Skip to main content

Get Voucher Batch By Key

Method : GET
Url : https://sb-open.revenuemonster.my/v3/voucher-batch/EhQKCE1lcmNoYW50EJXVzd3wraqTORIYCgxWb3VjaGVyQmF0Y2gQi5rUhcrdx78V/vouchers

Sandbox Url : https://sb-open.revenuemonster.my/v3/voucher-batch/EhQKCE1lcmNoYW50EJXVzd3wraqTORIYCgxWb3VjaGVyQmF0Y2gQi5rUhcrdx78V/vouchers

note

To get Multiple voucher batches by Key .

Request Parameters

note
  • The URL is consists of [base_URL]/v3/voucher-batch/[batchkey]/vouchers.

  • [batchkey] can be retrieved by viewing at merchant portal or using endpoint Get voucher By Batches

  • Pass an empty JSON object Example: {}

Response Parameters

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

Voucher object (items):
ParameterTypeDescriptionExample
keyStringVoucher key"EhQKCE1lcmNoYW50E
JXVzd3wraqTORIVCgdWb3Vja
GVyGgpOQWtsRWZiVmRW"
labelStringlabel of voucher for merchant remarks"Free Breakfast”
voucherBatchKeyStringParent key of current voucher"EhQKCE1lcmNo
YW50EJXVzd3wraqTORIYCgx
Wb3VjaGVyQm
F0Y2gQkvnGweaB2uQg"
typeStringDefine type of vouchers: DISCOUNT, GIFT, CASH“GIFT"
amountUintRequired if type = CASH, notation in cents, eg. RM 1.00 = 10010000
discountRateUintRequired if type = DISCOUNT, notation without decimals, eg. 1% = 1000
imageUrlStringImage URL of current voucher, optionalImage Url link
(Refer to the below code)
quantityUintTotal quantity of voucher(s) in this batch1
balanceQuantityUintTotal quantity of voucher(s) remaining in this batch0
usedQuantityUintTotal quantity of voucher(s) used/assigned/redeemed in this batch1
expiryObject of ExpiryExpiry date time of current voucher(Refer below)
originStringSYSTEM (voucher code generated from RM server), SELF (voucher code uploaded from merchant csv file)“SYSTEM”
isShippingBooleanTrue if items/goods to be delivered physically to customersfalse
reasonStringWill show if voucher batch is fail during creation. Optional.”"
isDeviceRedeemBooleanTRUE means only can be redeemed through merchant app. FALSE means customer can do redemption from own loyalty app.false
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

{
"items": [
{
"key": "EhQKCE1lcmNoYW50EJXVzd3wraqTORIWCgdWb3VjaGVyGgtVVUVyYTIyVlN5Mg",
"label": "test",
"voucherBatchKey": "EhQKCE1lcmNoYW50EJXVzd3wraqTORIYCgxWb3VjaGVyQmF0Y2gQi5rUhcrdx78V",
"type": "CASH",
"amount": 100,
"discountRate": 0,
"minimumSpendAmount": 0,
"origin": "SYSTEM",
"imageUrl": "",
"memberProfile": {
"id": "1039768290679711875",
"name": "yussuf",
"email": "yussuf888@gmail.com",
"nric": "",
"address": {
"addressLine1": "",
"addressLine2": "",
"postcode": "",
"city": "",
"state": "",
"country": ""
},
"gender": "",
"state": "",
"birthDate": "0001-01-01T00:00:00Z",
"loyaltyPoint": 0,
"credit": 112,
"countryCode": "60",
"phoneNumber": "176473298",
"profileImageUrl": "https://storage.googleapis.com/rm-sandbox-asset/img/avatar.png",
"hasPinCode": false,
"memberTier": null,
"status": "ACTIVE",
"createdAt": "2018-10-19T03:39:47Z"
},
"assignedAt": "0001-01-01T00:00:00Z",
"qrUrl": "",
"code": "UUEra22VSy2",
"isShipping": false,
"address": null,
"expiry": {
"type": "DYNAMIC",
"day": 1,
"expiredAt": "2050-12-31T23:59:59Z"
},
"usedAt": "0001-01-01T00:00:00Z",
"redeemedAt": "2019-03-22T04:58:38Z",
"isDeviceRedeem": true,
"status": "REDEEMED",
"voucherComboKey": null,
"createdAt": "2019-02-01T03:13:19Z",
"updatedAt": "2019-03-13T03:16:26Z"
}
],
"code": "SUCCESS",
"meta": {
"count": 1
}
}