Ticket PDF
If you wish to use your own ticket PDF instead of the one we provide, you must provide the URL of it in the ticket inside props.urls.qrTicketPdfUrl
.
Additionally, to use this functionality, you must inform your Account Manager.
Integration Examples
To create tickets with the PDF URL, you should use the following endpoint:
- cURL
- Python
- Java
- PHP
Here is an example of how to notify Menta about the issuance of a ticket with the PDF URL, using fictitious data, with cURL.
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"
},
"props": {
"urls": {
"qrTicketPdfUrl": "https://yourplatform.com/tickets/qr-pdf/111"
}
}
}
]'
Here is an example of how to notify Menta about the issuance of a ticket with the PDF URL, using fictitious data, with Python.
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"
qrTicketPdfUrl = "https://yourplatform.com/tickets/qr-pdf/111"
data = [
{
"ticketOptionId": ticketOptionId,
"showId": showId,
"externalReferenceEventId": externalReferenceEventId,
"buyer": buyer,
"ticketId": ticketId,
"ticketAccess": {
"type": ticketAccessType,
"locator": locator,
"status": status,
},
"props": {
"urls": {
"qrTicketPdfUrl": qrTicketPdfUrl
}
}
}
]
response = requests.post(url, headers=headers, data=json.dumps(data))
Here is an example of how to notify Menta about the issuance of a ticket with the PDF URL, using fictitious data, with Java.
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 qrTicketPdfUrl = "https://yourplatform.com/tickets/qr-pdf/111"
String json = String.format("""
[
{
"ticketOptionId": "%s",
"showId": "%s",
"externalReferenceEventId": "%s",
"buyer": "%s",
"ticketId": "%s",
"ticketAccess": {
"type": "%s",
"locator": "%s",
"status": "%s"
},
"props": {
"urls": {
"qrTicketPdfUrl": "%s"
}
}
}
]
""", ticketOptionId, showId, externalReferenceEventId, buyer, ticketId, ticketAccessType, locator, status, qrTicketPdfUrl
);
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();
}
Here is an example of how to notify Menta about the issuance of a ticket with the PDF URL, using fictitious data, with PHP.
<?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",
),
"props" => array(
"urls" => array(
qrTicketPdfUrl => "https://yourplatform.com/tickets/qr-pdf/111"
)
)
)
);
$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 QR pdf, refer to the ticket data section.