Airship Developers
HomeAcademy
  • Welcome
  • Rest API
    • Overview
    • Authentication
    • API Reference
    • Accreditation
  • Basics
    • Contacts
      • Write a contact
      • Append feedback
      • Append purchase history
      • Append booking data
      • Append WiFi data
      • Append Stay data
      • Append Loyalty data
      • Append ticket data
      • Append other PoPs
    • Bookings
      • Booking Search by reference
      • Booking Search by data_element
      • Booking Update
    • Search Contact
      • Search PoPs by contact
      • Search contact by Email, Mobile, Name
      • Search contact by voucher
    • Vouchers
      • Redeem voucher code
      • Check voucher code
      • Create Unique Code Group
    • Anonymous purchase data
      • Add anonymous purchase data
    • Units
    • Postman collection
  • SOAP API (legacy)
    • Overview
Powered by GitBook
On this page
  • Overview
  • Example Request
  • Configuration
  • Basic Payload example
  1. Basics
  2. Vouchers

Check voucher code

Overview

A vouchers current status can be checked within Airship. This will return the following information:

  • Contact id associated

  • Redemption unit (if redeemed)

  • Redemption date/time (if redeemed)

  • Status;

    • "Active" (not yet redeemed)

    • "Redeemed"

Example Request

https://api.airship.co.uk/v1/unique_code

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.

unique_code

The unique voucher code which you are searching for.

unique_code_group_id

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 code is being searched for.

Basic Payload example

{
    "account_id": 2,
    "unique_code": "AB9201E11",
    "unique_code_group_id": 14252
}
  1. Code Active

{
    "id": 62123810,
    "unique_code": "AB9201E11",
    "unique_code_group_id": "14252",
    "contact_id": "51626835",
    "redeemed_at_unit_id": "0",
    "redeemed_at_datetime": "0000-00-00 00:00:00",
    "unique_code_status": "Active"
}

2. Code redeemed

{
    "id": 62123810,
    "unique_code": "AB9201E11",
    "unique_code_group_id": "14252",
    "contact_id": "51626835",
    "redeemed_at_unit_id": "14458",
    "redeemed_at_datetime": "2021-11-02 10:12:26",
    "unique_code_status": "Redeemed"
}
  1. Invalid Unique Code Group ID

{
    "message": "The given data was invalid.",
    "errors": {
        "unique_code_group_id": [
            "This unique code group id doesn't exist"
        ]
    }
}

2. Invalid Unique Code

{
    "message": "The given data was invalid.",
    "errors": {
        "unique_code": [
            "This unique code doesn't exist"
        ]
    }
}

3. Invalid Account ID

{
    "message": "The given data was invalid.",
    "errors": {
        "account_id": [
            "You do not have access to this account"
        ]
    }
}
PreviousRedeem voucher codeNextCreate Unique Code Group

Last updated 3 years ago