Skip to main content

Reinstate Voucher

Reinstate a previously voided voucher — restores the voucher to a usable state.

When to Use

Use this endpoint when:

  • A voucher was voided in error and must be restored
  • Reversing a void decision

How to Use

Endpoint
PATCH/v3/voucher/{code}/reinstate

PATCH /v3/voucher/{code}/reinstate with no request body. Get code from the Issue Voucher response.


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

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

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

Request Parameters

pinSTRING

User Pin

Example: "321123"

reasonSTRING

Reinstate reason

Example: "wrong void"

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 used (UTC)

Example: "2025-04-08T03:36:22Z"

redeemedAtDATETIME

Date time of voucher being redeemed (UTC)

Example: "2025-04-08T03:36:17Z"

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=reinstate)

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"