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
  • Example Payload
  1. Basics
  2. Vouchers

Create Unique Code Group

Overview

Unique Code Groups are containers for vouchers, they are typically related to a specific campaign or promotion and the group will contain all unique voucher codes for that specific campaign or promotion.

When creating a unique code group, no unique vouchers will be generated. This is a manual process that will require Airship customer success to generate them.

Example Request

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

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 group to be created against. You can fetch a list of units for your account using the account/unitsendpoint.

Typically code groups are created against the Head Office account, but check with Airship Customer Services if you are unsure.

name

A text descriptive name is required against the code group. The unique code group name must be unique against the Account > Unit. An error will be returned if the group name already exists.

Example Payload

{
    "account_id": 2,
    "unit_id": 14212,
    "name": "test group"
}
{
    "id": 10616
}
  1. Duplicate group name

{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "Sorry, You've all ready used this name on another unique code group in this unit."
        ]
    }
}

2. Invalid unit ID

{
    "message": "The given data was invalid.",
    "errors": {
        "unit_id": [
            "Unit ID 2 does not exist or has been deleted on this account"
        ],
        "name": [
            "In order to add a name the unit id must also be correct"
        ]
    }
}

3. Invalid account ID

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

PreviousCheck voucher codeNextAnonymous purchase data

Last updated 3 years ago