⇡ POST /redeem
After redeeming a ticket you must register the redemption with City Connect otherwise the ticket will still be still considered valid, and can still be cancelled.
Only tickets that have been redeemed will appear in your reconciliation and invoice report, so this step is important and should not be skipped.
The endpoint you must call is:
https://api.cityconnect.net/v1/redeem_booking
The request must be made as a POST request and must include the ticket or booking barcode as a parameter.
curl https://api.cityconnect.net/v1/accounts/redeem \
-H 'Accept: application/json' \
-u capetowntours.com:XjWNW66RCylqeMU556UaYw
-d barcode=7485936482
It's possible to redeem both an individual ticket within a booking, or the whole booking itself. The supplier is able to return a barcode for both an individual ticket or the whole booking, making both eventualities possible.
City Connect makes this easy to handle by returning an almost identical response for both. Your application shouldn't care to differentiate. For example:
{
"id": "c8fff58f-b650-4480-b88b-83d30f10d0b1",
"type": "ticket",
"agent": "viator.com",
"agent_name": "Viator",
"agent_reference": "VIATOR10052421",
"supplier": "capetowntours.com",
"supplier_name": "Cape Town Tours",
"supplier_reference": "CPT388829932",
"status": "confirmed",
"freesale": false,
"cancelled": false,
"cancelled_at": null,
"redeemed": true,
"redeemed_at": "2017-11-19T10:48:17Z",
"product": "WINETOUR",
"product_name": "Half-Day Wine Tour",
"option": "WITHLUNCH",
"option_name": "With Lunch Included",
"date": "2017-11-19",
"time": "10:00",
"adult": 1,
"child": 0,
"customer": {
"first_name": "John",
"last_name": "Smith",
"email": "[email protected]",
"mobile": "+447844922321",
"language": "en",
"country": "GB"
},
"mobile": true,
"alias": null,
"barcode": "877282737221",
"notes": "Allergic to nuts!"
}
The response will return a 200 OK HTTP response, indicating that the redemption was successful.
Multiple Bookings
Other Errors
If the booking was cancelled, or the ticket was already redeemed, the API will respond with a 400 Bad Request response.
{ "error": "BARCODE_INVALID" }
Possible error messages are:
| Error | Message |
|---|---|
TICKET_REDEEMED | Ticket has already been redeemed. |
DATE_MISMATCH | This ticket isn't valid for today. |
BOOKING_CANCELLED | This booking has been cancelled. |
BARCODE_INVALID | The ticket barcode was not recognised. |
Updated about 8 years ago
