Redeem voucher code

Overview

In the scenarios where Airship is the gatekeeper for voucher codes, an unredeemed single use voucher can be marked as 'Redeemed' within Airship, so any subsequent Voucher Checks return the status of 'Redeemed', or attempted Redemptions return an 'Already Redeemed' style message.

Example Request

POST
1
https://api.airship.co.uk/v1/unique_code/redeem
Copied!

Configuration

Headers

Field
Notes
Authentication (bearer token)
The authentication token is linked to the account that you are searching bookings in. If you are unsure of what your Authentication token is, ask our support team to confirm.

Body

Field
Notes
account_id
The account ID represents the account that you are searching bookings in. If you are unsure of what your account ID is, ask our support team to confirm.
unit_id
Airship has predefined locations or "units" to store contacts for different physical locations. The units object represents which location which the voucher code was redeemed at. You can fetch a list of units for your account using the account/unitsendpoint.
unique_code_group_id
Optional (providing the voucher codes are set to unique by account within Airship)
The unique voucher code group which the voucher is associated with. As the same voucher code can exist in different code groups (be issued in different campaigns at different points in time) - the UCGID enables us to narrow down which campaign the voucher belongs to when codes are not unique by account.
unique_code
The unique voucher code which you are attempting to redeem.

Basic Payload example

Request
200 Response
422 Response
1
{
2
"account_id": 2,
3
"unit_id": 10252,
4
"unique_code_group_id": 44125,
5
"unique_code": "AB03-23RTT0"
6
}
Copied!
1
{
2
"id": 62123846,
3
"unique_code": "AB03-23RTT0",
4
"unique_code_group_id": "44125",
5
"contact_id": "5162520",
6
"redeemed_at_unit_id": 10252,
7
"redeemed_at_datetime": "2021-11-02T16:29:05.558280Z",
8
"unique_code_status": "Redeemed"
9
}
Copied!
  1. 1.
    Voucher already redeemed
1
{
2
"message": "The given data was invalid.",
3
"errors": {
4
"unique_code": [
5
"This unique code has already been redeemeed."
6
]
7
}
8
}
Copied!
2. Invalid Unit ID
1
{
2
"message": "The given data was invalid.",
3
"errors": {
4
"unit_id": [
5
"Unit ID 5234 does not exist or has been deleted on this account"
6
]
7
}
8
}
Copied!
3. Invalid Unique Code Group ID
1
{
2
"message": "The given data was invalid.",
3
"errors": {
4
"unique_code_group_id": [
5
"This unique code group id doesn't exist"
6
]
7
}
8
}
Copied!
4. Invalid account ID
1
{
2
"message": "The given data was invalid.",
3
"errors": {
4
"account_id": [
5
"You do not have access to this account"
6
]
7
}
8
}
Copied!

Results

Once a voucher has successfully been redeemed, if it is assigned to a contact - then you will be able to check if the voucher has been redeemed in Airship.
Once a voucher is redeemed, you should see the Redemption date (based on the date/time the call was made) and Redeemed at unit populated (based on the Unit ID provided in the redemption call).