Skip to main content

Void Voucher

Void a customer's voucher by code. Sets the voucher status to VOID so it can no longer be used.

When to Use

Use this endpoint when:

  • A voucher needs to be cancelled before redemption
  • Reversing a voucher issued by mistake

How to Use

Endpoint
POST/v3/voucher/{code}/void

POST to /v3/voucher/{code}/void with no request body.


Request Parameters

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

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

  • [code] is the respond code generated from Issue Voucher endpoint.

  • Pass an empty JSON object if do not have any storeId. Example: {}

Request Parameters

storeIdSTRING

ID of the Store that Create from RM

Example: "1556079400120532579"

Response Parameters

itemOBJECT

Voucher 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: 0

discountRateINTEGER

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

Example: 100

minimumSpendAmountINTEGER

min amount to activate this voucher, required if type = CASH, DISCOUNT, notation in cents, eg. RM 1.00 = 100

Example: 100

originSTRING

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

Example: "SYSTEM"

imageUrlSTRING

Image URL of current voucher, optional

Example: ""

memberProfileSTRING

Member profile of user's social media

Example: ""

assignedAtDATETIME

Date time of voucher issuance (UTC)

Example: "2018-09-28T17:15:17Z"

qrUrlSTRING

QR code for user to scan with Wechat or Facebook to add the voucher into their member account.

Example: QR Url link (refer to below code)

codeSTRING

Voucher Code, members can keep this code for future redemption. Same as the qrURL below except this code is not a URL.

Example: "NAklEfbVdV"

isShippingBOOLEAN

True if items/goods to be delivered physically to customers

Example: false

addressSTRING

Required if isShipping = true

Example: null

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"

usedAtDATETIME

Date time of voucher being voided (UTC)

Example: "GIFT"

redeemedAtDATETIME

Date time of voucher being redeemed (UTC)

Example: "GIFT"

isDeviceRedeemBOOLEAN

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

Example: false

statusSTRING

Status 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)

Example: "VALID"

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"