Get Ticket By Ticket ID
Introduction
The Get Ticket By Ticket ID API allows you to retrieve ticket details for a specific ticket based on the ticket ID. This API provides information about ticket types, ticket prices, ticket availability, and more.
Retrieve Ticket
To retrieve a ticket, you need to send an HTTP POST request to the following endpoint:
Endpoint
https://api.paydexp.com/v1/ticket/{id}
Authorization
Users need to include basic authentication credentials in the request headers.
Where base64_encoded_username_password is a Base64-encoded string of your API username and password joined by a colon.
Code Examples
Below are code examples in different programming languages demonstrating how to retrieve event details using HTTP POST requests.
- Curl
- Go
- Nodejs
- Python
- PHP
curl --location --request POST 'https://api.paydexp.com/api/v1/ticket/118' \
--header 'Authorization: ••••••'
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paydexp.com/api/v1/ticket/118"
method := "POST"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "••••••")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
const axios = require('axios');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.paydexp.com/api/v1/ticket/118',
headers: {
'Authorization': '••••••'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
url = "https://api.paydexp.com/api/v1/ticket/118"
payload = {}
headers = {
'Authorization': '••••••'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.paydexp.com/api/v1/ticket/118');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization': '••• •••'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Example of a successful response
{
"success": true,
"data": {
"id": 1759,
"name": "VIP Ticket",
"description": "VIP access with premium seating",
"price": 150.00,
"status": "active",
"is_sold_out": false,
"sale_start_date": "2025-11-01",
"sale_end_date": "2025-12-14",
"fields": [
{
"id": 1,
"name": "T-Shirt Size",
"type": "dropdown",
"required": true,
"options": ["S", "M", "L", "XL"]
}
]
},
"message": "Ticket retrieved successfully."
}
Conclusion
The Get Ticket By Ticket ID API allows you to retrieve ticket details for a specific ticket based on the ticket ID. This API provides information about ticket types, ticket prices, ticket availability, and more.