Barcode validation
Fetching and validating barcodes
You can retrieve a barcode of a ticket
by fetching the order to which that ticket belongs through the https://api.eventix.io/order/:GUID
endpoint.
The response lists an order
and its associated tickets.
Each ticket lists its barcode in the ticket_number
field.
To check the validity of a barcode, create a GET request to the https://api.eventix.io/ticketswap/validate
.
The following code block shows some examples of such a request.
- PHP
- GO
- Node
- Shell
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_URL => "https://api.eventix.io/ticketswap/validate"
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
req, _ := http.NewRequest("PUT", "https://api.eventix.io/ticketswap/validate", bytes.NewBuffer(body))
req.Header.Add("Authorization", "Bearer " + accessToken)
resp, _ := http.DefaultClient.Do(req)
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
const options = {
"method": "GET",
"headers": {
"Authorization": `Bearer ${accessToken}`
}
};
fetch("https://api.eventix.io/ticketswap/validate", options)
.then(response => response.json())
.then(response => console.log(response))
curl -X GET \
-H "Authorization: Bearer $accessToken" \
"https://api.eventix.io/ticketswap/validate"
{
"barcode": "TTZ2PM9NGRJXAUTWHHW",
"valid": true,
"swappable": true,
"retrievable_after": 0
}