⇣ GET /barcode_lookup
Sometimes a barcode isn't stored on City Connect, and a live request needs to be made to lookup the barcode to work out what booking and tickets are associated to it.
City Connect will only lookup barcodes with a matching prefix to what's registered on your account. You must register a prefix if you plan to implement and allow the barcode lookup callback.
This is typically used as a last resort as it requires a live internet connection on the supplier's ticketing system which isn't always available. This fallback mechanism is useful when connecting to City Connect to the first time, and not all bookings have been registered.
The /barcode_lookup request will be made as a GET request to your callback_url for example: GET https://api.example.com/cc/callbacks/barcode_lookup.
The request will be made as a GET request, with the following as URL parameters:
| Parameter | Description | Example |
|---|---|---|
supplier | The supplier's account that made the original request to lookup the booking. This helps you avoid returning a booking for the wrong supplier. | [email protected] |
barcode | The value of the barcode scanned on the ticket. | CTT847889400 |
You must respond with a full booking object containing all the tickets belonging to the booking, even if the barcode belongs to just one of the tickets. In this case, you should include the ticket object that was scanned at the top. If the barcode is for the booking, this value should be null.
For example:
{
"ticket": {
"type": "adult",
"barcode": "CTT847889400",
"redeemed": true
},
"product": "WINETOUR",
"option": "WITHLUNCH",
"departure": "1030EN",
"date": "2017-10-07",
"adult": 2,
"child": 1,
"cancelled": false,
"customer": {
"first_name": "John",
"last_name": "Smith",
"email": "[email protected]",
"mobile": "+17345551212",
"language": "en",
"country": "GB"
},
"mobile": true,
"barcode": "CTT128465552",
"tickets": [
{ "type": "adult", "barcode": "CTT847889400", "redeemed": true },
{ "type": "adult", "barcode": "CTT2512356846", "redeemed": false },
{ "type": "child", "barcode": "CTT9257377533", "redeemed": false }
],
"notes": "Allergic to nuts"
}
The rest of the response should be almost identical to the Booking Notification Request, so you can use that for reference to what each field means.
If the booking was cancelled, or the barcode wasn't recognised, you should respond with a 400 Bad Request response. For example:
{ "error": "BARCODE_INVALID" }
Possible error messages are:
| Error | Message |
|---|---|
BARCODE_INVALID | The ticket barcode was not recognised. |
Updated over 8 years ago
