Redeem Voucher

This is a POST request to validate and redeem a voucher in one request. This can be used without using the previous Request Balance.

POST https://shop.bookin1.com/redeem/api/redeem

Redeem Request Object

NameTypeRequiredLengthDescription
amountnumerictruen/aValue to be redeemed. If the value exceeds the balance, an error will be returned.
transactionIdalphanumericfalse0-36TransactionId of the redeem request which can be used to reverse a redeem in future if needed. If not supplied, a unique value will be generated. If supplied, the value must be unique per transaction. We recommend to use UUID
voucherCodealphanumerictrue19Voucher code value.

Request Example

curl -X POST \
https://shop.bookin1.com/redeem/api/redeem \
-H 'Content-Type: application/json' \
-H 'apiKey: 4eC39HqLyjWDarjtT1zdp7dc' \
-d '{
"amount": 10,
"transactionId": "67b6df4a-81d2-4693-a19f-a49e4e157038",
"voucherCode": "1001-1234-567I-8P8Q"
}'

Response Example

{
"balanceAmount": 0,
"currency": "string",
"redeemed": true,
"transactionId": "string",
"status": "string",
"statusMessage": "string",
"voucherCode": "string",
"voucherDescription": "string",
"voucherExpiryDate": "2020-01-13T11:43:21.887Z",
"voucherName": "string",
"voucherPropertyName": "string",
"voucherStartDate": "2020-01-13T11:43:21.887Z"
}

Redeem Response Object

NameTypeDescription
balanceAmountdoubleValue of current gift voucher balance after the redeem action is done
currencystringCurrency string in ISO 4217 format.
redeemedbooleanRedeemed action successful
transactionIdstringIf provided in the request, it is outputed in the response otherwise it's auto generated via the api.
statusstringSee status codes below
statusMessagestringDescriptive message based on result of the redeem action.
voucherCodestringGift voucher code used for redeem
voucherDescriptionstringDescriptive text of the actual gift voucher purchased.
voucherExpiryDatedateGift voucher expiry date.
voucherNamestringName of the gift voucher.
voucherPropertyNamestringProperty responsible for issuing the gift voucher
voucherStartDatedateDate from which the gift voucher is active. This is usually the purchase date, but can also be delayed start date.

Status Codes

Depending the on the status value, please lookup the below table for explanation and further action.

Status CodeDescriptionAction
00SuccessVoucher is valid and is redeemed by amount requested.
01Insufficent balanceFull balance is already redeemed. Use another payment method. The response will have balanceAmount at 0.
02Insufficent balancePartial balance is already redeemed. Use the balanceAmount in response to indicate how much value is left on the gift voucher
03Voucher ExpiredVoucher expired and can not be used. Please use alternative payment method.
04Duplicate transactionIdThis transactionId was already used.