Search contact by voucher

Overview

Any contact that has a unique voucher code assigned can be searched for using the get /Contact endpoint. An account ID, voucher code and voucher code group must be provided to ensure the relevant contact is returned.
This is currently used to identify a contact by a unique voucher code, and the POS / Order and pay provider will then apply a basket to that contact using the Append booking data

Example Request

GET
1
https://api.airship.co.uk/v1/contacts
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.
code
The unique voucher code which you are searching for.
ucgid
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

Request
200 Response
422 Response
1
{
2
"account_id": 2,
3
"voucher_code_data":
4
{
5
"code": "PL1022393E",
6
"ucgid": 523
7
}
8
}
Copied!
1
{
2
"allow_sms": false,
3
"allow_email": true,
4
"allow_call": false,
5
"allow_snail_mail": false,
6
"udfs": [],
7
"units": [
8
{
9
"id": 14458,
10
"name": "Head Office",
11
"groups": [
12
{
13
"id": 126832,
14
"name": "Football visitor"
15
},
16
{
17
"id": 126842,
18
"name": "Christmas Competition entry"
19
}
20
]
21
},
22
{
23
"id": 14478,
24
"name": "Stafford venue",
25
"groups": [
26
{
27
"id": 126778,
28
"name": "WIFI"
29
}
30
]
31
}
32
],
33
"feedback": "https://api.airship.co.uk/v1/contact/51616336/feedback",
34
"bookings": "https://api.airship.co.uk/v1/contact/51616336/bookings",
35
"purchases": "https://api.airship.co.uk/v1/contact/51616336/purchases",
36
"proof_of_presence": "https://api.airship.co.uk/v1/contact/51616336/pops",
37
"id": 51616336,
38
"gender": "M",
39
"title": "Mr",
40
"first_name": "Anthony",
41
"last_name": "Moore",
42
"dob": "1984-11-27",
43
"building_name": "",
44
"building_num_street": "2 stafford Way",
45
"locality": "",
46
"postcode": "ST01 1AA",
47
"city": "Stafford",
48
"country": "United Kingdom",
49
"county": "",
50
"mobile_number": "447816083828",
51
"home_number": "",
52
"preferred_method_id": "0",
53
"work_number": "",
54
"email": "[email protected]",
55
"source_id": "134747",
56
"membership_number": "",
57
"membership_type": ""
58
}
Copied!
A 422 response can be given in the following scenarios;
  1. 1.
    Account ID is incorrect
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!
2. Unique code group ID is incorrect
1
{
2
"message": "The given data was invalid.",
3
"errors": {
4
"ucgid": [
5
"This ucgid does not exist"
6
]
7
}
8
}
Copied!