Redeem
POST
/client/Next/redeemRedeems a voucher to the account connected to the api key.
Request body
| Field name | Type | Required | Default | Description |
|---|---|---|---|---|
| code | String | Yes | - | Redeem code of a Rewarble voucher |
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| test | Boolean | No | false | Enables test mode. For more information see Test Mode |
Example Request
curl -X POST api.rewarble.com/client/Next/redeem \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
-d '
{
"code":"ABC123ABC123"
}'
Example Response
{
"faceValue": 10.00,
"faceValueCurrency": "eur",
"voucherSerial": "12345678901234567892",
"transactionWTRX": "WTRX-9Q110AX81RG3JIMAR22AUDVNSD8ZWH",
"state": "test"
}
Response Fields
| Field name | Field type | Field description |
|---|---|---|
| faceValue | Decimal | Amount of voucher |
| faceValueCurrency | Currency | Currency of voucher |
| voucherSerial | String | Serial of voucher |
| transactionWTRX | String | Unique transaction identifier |
| state | String | State of the request. Either production or test |
Errors
| Http status code | Https status | Message | Reason |
|---|---|---|---|
| 400 | BAD_REQUEST | VOUCHER_INVALID_LENGHT | Voucher length is not correct |
| 422 | UNPROCESSABLE_ENTITY | VOUCHER_EXPIRED | Voucher has expired |
| 404 | NOT_FOUND | UNKNOWN_VOUCHER | Voucher cannot be found |
| 422 | UNPROCESSABLE_ENTITY | VOUCHER_USED | Voucher has already been used |
| 422 | UNPROCESSABLE_ENTITY | VOUCHER_INACTIVE | Voucher is inactive |
| 422 | UNPROCESSABLE_ENTITY | VOUCHER_EMPTY | Voucher has no money on it |
| 500 | INTERNAL_SERVER_ERROR | REDEEM_FAILED | Unknown error |
Notes
note
transactionWTRXcan vary in length