Plain Text QR
TicketAccess Specification for Ticket Issuance
When issuing a ticket, it is necessary to specify the ticketAccess
field, which determines the information used for accessing the event. This field is crucial as it defines how the access information is presented to the end-user.
In most cases, ticketAccess
is used to provide a link to a QR code that allows attendees to access the event. This link is generally a URL that, when accessed, displays the corresponding QR code.
However, we also offer the option to send access information in plain text format. This can be useful in situations where a QR code is not required or when it is preferable to provide a code or access identifier directly.
Implementation Examples
Here, the locator
field contains text or a code that can be used directly for event access.
"ticketAccess": {
"type": "OTHER",
"locator": "D02KWWKS029F"
}
To create text-based QR tickets, you must use the following endpoint:
- cURL
- Python
- Java
- PHP
curl -X POST 'https://api.mentatickets.com/v1/tickets'
-H 'Authorization: YOUR_API_KEY'
-H 'Content-Type: application/json'
--data-raw '[
{
"ticketOptionId": "0001",
"showId": "4726",
"externalReferenceEventId": "the-lion-king-broadway",
"buyer": "buyer@emaildomain.com",
"ticketId": "111",
"ticketAccess": {
"type": "OTHER",
"locator": "D02KWWKS029F"
}
}
]'
import requests
import json
url = "https://api.mentatickets.com/v1/tickets"
headers = {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json",
}
ticketOptionId = "0001"
showId = "4726"
externalReferenceEventId = "the-lion-king-broadway"
buyer = "buyer@emaildomain.com"
ticketId = "111"
ticketAccessType = "OTHER"
locator = "D02KWWKS029F"
data = [
{
"ticketOptionId": ticketOptionId,
"showId": showId,
"externalReferenceEventId": externalReferenceEventId,
"buyer": buyer,
"ticketId": ticketId,
"ticketAccess": {
"type": ticketAccessType,
"locator": locator
}
}
]
response = requests.post(url, headers=headers, data=json.dumps(data))
import okhttp3.*;
import java.io.IOException;
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.get("application/json; charset=utf-8");
String ticketOptionId = "0001";
String showId = "4726";
String externalReferenceEventId = "the-lion-king-broadway";
String buyer = "buyer@emaildomain.com";
String ticketId = "111";
String ticketAccessType = "OTHER";
String locator = "D02KWWKS029F"
String json = String.format("""
[
{
"ticketOptionId": "%s",
"showId": "%s",
"externalReferenceEventId": "%s",
"buyer": "%s",
"ticketId": "%s",
"ticketAccess": {
"type": "%s",
"locator": "%s"
}
}
]
""", ticketOptionId, showId, externalReferenceEventId, buyer, ticketId, ticketAccessType, locator);
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder()
.url("https://api.mentatickets.com/v1/tickets")
.post(body)
.addHeader("Authorization", "YOUR_API_KEY")
.addHeader("Content-Type", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
} catch (IOException e) {
e.printStackTrace();
}
<?php
$url = "https://api.mentatickets.com/v1/tickets";
$headers = array(
"Authorization: YOUR_API_KEY",
"Content-Type: application/json",
);
$data = array(
array(
"ticketOptionId" => "0001",
"showId" => "4726",
"externalReferenceEventId" => "the-lion-king-broadway",
"buyer" => "buyer@emaildomain.com",
"ticketId" => "111",
"ticketAccess" => array(
"type" => "OTHER",
"locator" => "D02KWWKS029F",
)
)
);
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
JSON Response
```
{
"status": 200,
"data": [{TICKETDATA}],
"errors": null
}
```
For more detailed information on Ticket and Seating, refer to the section on ticket data.