Seating
Seating
menta supports the integration of seating at the time of ticket issuance, allowing each ticket to contain detailed information about the seat location within the event. To achieve this integration, it is necessary to send additional information with each ticket during the creation process. This information must be included within ticket.props.seating
.
Integration Example
To create tickets with seating information, you should use the following endpoint:
- cURL
- Python
- Java
- PHP
Here is an example of how to notify menta of a ticket issuance with fictional data using 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": "URL",
"locator": "https://storage.googleapis.com/default_mentatickets-core/Captura%20de%20pantalla%202023-03-21%20a%20la(s)%2010.46.42.png",
"status": "LOCKED"
},
"props": {
"seating": {
"row": "A",
"seat": "12",
"section": "VIP",
"door": "North",
"image": "https://example.com/seating-image.png"
}
}
}
]'
Here is an example of how to notify menta of a ticket issuance with fictional data using 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 = "URL"
locator = "https://storage.googleapis.com/default_mentatickets-core/Captura%20de%20pantalla%202023-03-21%20a%20la(s)%2010.46.42.png"
status = "LOCKED"
data = [
{
"ticketOptionId": ticketOptionId,
"showId": showId,
"externalReferenceEventId": externalReferenceEventId,
"buyer": buyer,
"ticketId": ticketId,
"ticketAccess": {
"type": ticketAccessType,
"locator": locator,
"status": status,
},
"props": {
"seating": {
"row": "A",
"seat": "12",
"section": "VIP",
"door": "North",
"image": "https://example.com/seating-image.png"
}
}
}
]
response = requests.post(url, headers=headers, data=json.dumps(data))
Here is an example of how to notify menta of a ticket issuance with fictional data using 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 = "URL";
String locator = "https://storage.googleapis.com/default_mentatickets-core/Captura%20de%20pantalla%202023-03-21%20a%20la(s)%2010.46.42.png";
String status = "LOCKED";
String json = String.format("""
[
{
"ticketOptionId": "%s",
"showId": "%s",
"externalReferenceEventId": "%s",
"buyer": "%s",
"ticketId": "%s",
"ticketAccess": {
"type": "%s",
"locator": "%s",
"status": "%s"
},
"props": {
"seating": {
"row": "A",
"seat": "12",
"section": "VIP",
"door": "North",
"image": "https://example.com/seating-image.png"
}
}
}
]
""", ticketOptionId, showId, externalReferenceEventId, buyer, ticketId, ticketAccessType, locator, status);
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 of a ticket issuance with fictional data using 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" => "URL",
"locator" => "https://storage.googleapis.com/default_mentatickets-core/Captura%20de%20pantalla%202023-03-21%20a%20la(s)%2010.46.42.png",
"status" => "LOCKED"
),
"props" => array(
"seating" => array(
"row" => "A",
"seat" => "12",
"section" => "VIP",
"door" => "North",
"image" => "https://example.com/seating-image.png"
)
)
)
);
$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;
?>
Respuesta JSON
{
"status": 200,
"data": [{TICKETDATA}],
"errors": null
}
Seating Parameters
Field | Data Type | Description | Example |
---|---|---|---|
row | String | Row where the seat is located. | "A" |
seat | String | Seat number. | "12" |
section | String | Section where the seat is located. | "VIP" |
door | String | Entrance door corresponding to the seat. | "North" |
image | String | URL of the image showing the seat location. | "https://example.com/seating-image.png" |
For more detailed information about Ticket and Seating, please refer to the ticket data section.