Skip to main content

Get Voucher Batch By Key

Retrieve all vouchers belonging to a specific voucher batch by its batchkey.

When to Use

Use this endpoint when:

  • Listing every voucher in a given batch
  • Auditing voucher issuance under a batch

How to Use

Endpoint
GET/v3/voucher-batch/{batchKey}/vouchers

GET /v3/voucher-batch/{batchkey}/vouchers. Find batchkey via the merchant portal or Get Voucher Batches.


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

itemsOBJECT

Transaction object

keySTRING

Voucher key

Example: "EhQKCE1lcmNoYW50EJXVzd3wraqTORIVCgdWb3VjaGVyGgpOQWtsRWZiVmRW"

labelSTRING

label of voucher for merchant remarks

Example: "Free Breakfast”

voucherBatchKeySTRING

Parent key of current voucher

Example: "EhQKCE1lcmNoYW50EJXVzd3wraqTORIYCgxWb3VjaGVyQmF0Y2gQkvnGweaB2uQg"

typeSTRING

Define type of vouchers: DISCOUNT, GIFT, CASH

Example: “GIFT"

amountINTEGER

Required if type = CASH, notation in cents, eg. RM 1.00 = 100

Example: 10000

discountRateINTEGER

Required if type = DISCOUNT, notation without decimals, eg. 1% = 100

Example: 0

imageUrlSTRING

Image URL of current voucher, optional

Example: Image Url link (Refer to the below code)

quantityINTEGER

Total quantity of voucher(s) in this batch

Example: 1

balanceQuantityINTEGER

Total quantity of voucher(s) remaining in this batch

Example: 0

usedQuantityINTEGER

Total quantity of voucher(s) used/assigned/redeemed in this batch

Example: 1

expiryOBJECT

Expiry date time of current voucher

typeSTRING

DYNAMIC (days from now), FIXED (specific fixed date)

Example: "DYNAMIC"

dayINTEGER

Only required by DYNAMIC expiry type. To indicate number of days from now until expiry.

Example: 30

expiryAtDATETIME

Only required by FIXED. To indicate specific expiry date.

Example: "2020-10-07T17:44:26.679908+08:00"

originSTRING

SYSTEM (voucher code generated from RM server), SELF (voucher code uploaded from merchant csv file)

Example: “SYSTEM”

isShippingBOOLEAN

True if items/goods to be delivered physically to customers

Example: false

reasonSTRING

Will show if voucher batch is fail during creation. Optional.

Example: ”"

isDeviceRedeemBOOLEAN

TRUE means only can be redeemed through merchant app. FALSE means customer can do redemption from own loyalty app.

Example: false

createdAtDATETIME

Date time of voucher being created (UTC)

Example: "2018-06-21T11:08:00Z"

updatedAtDATETIME

Date time of voucher being updated (UTC)

Example: "2018-09-28T17:19:44.686549977Z"

codeSTRING

Successfully call this endpoint. If fail, will return error code object (Refer Appendix 1: Error Codes)

Example: "SUCCESS"