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
| Name | Type | Required | Length | Description |
|---|---|---|---|---|
| amount | numeric | true | n/a | Value to be redeemed. If the value exceeds the balance, an error will be returned. |
| transactionId | alphanumeric | false | 0-36 | TransactionId 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 |
| voucherCode | alphanumeric | true | 19 | Voucher 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
| Name | Type | Description |
|---|---|---|
| balanceAmount | double | Value of current gift voucher balance after the redeem action is done |
| currency | string | Currency string in ISO 4217 format. |
| redeemed | boolean | Redeemed action successful |
| transactionId | string | If provided in the request, it is outputed in the response otherwise it's auto generated via the api. |
| status | string | See status codes below |
| statusMessage | string | Descriptive message based on result of the redeem action. |
| voucherCode | string | Gift voucher code used for redeem |
| voucherDescription | string | Descriptive text of the actual gift voucher purchased. |
| voucherExpiryDate | date | Gift voucher expiry date. |
| voucherName | string | Name of the gift voucher. |
| voucherPropertyName | string | Property responsible for issuing the gift voucher |
| voucherStartDate | date | Date 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 Code | Description | Action |
|---|---|---|
| 00 | Success | Voucher is valid and is redeemed by amount requested. |
| 01 | Insufficent balance | Full balance is already redeemed. Use another payment method. The response will have balanceAmount at 0. |
| 02 | Insufficent balance | Partial balance is already redeemed. Use the balanceAmount in response to indicate how much value is left on the gift voucher |
| 03 | Voucher Expired | Voucher expired and can not be used. Please use alternative payment method. |
| 04 | Duplicate transactionId | This transactionId was already used. |
