Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Sumitbose5/tktplz/llms.txt

Use this file to discover all available pages before exploring further.

After a payment is verified, TktPlz creates a ticket record in the tickets table. The tickets API exposes two operations: downloading a PDF version of the ticket (rendered with Puppeteer using HTML/CSS), and retrieving the HMAC-SHA256 signed QR code payload used for venue entry scanning.

POST /api/ticket/download

Generates and streams a PDF ticket. The server renders an HTML page using Puppeteer with the ticket holder’s details, event information, payment details, and an embedded QR code. The response is a binary PDF file with Content-Disposition: attachment.
orderId
string
required
The Razorpay order ID associated with the ticket. The server joins tickets with users on this field.
curl -X POST https://api.tktplz.me/api/ticket/download \
  -H "Content-Type: application/json" \
  -d '{"orderId": "order_Razorpay123"}' \
  --output ticket.pdf
Response headers
Content-Disposition: attachment; filename=ticket-<bookingID>.pdf
Content-Type: application/pdf
The PDF includes:
  • Event name and bookingID in the header
  • Event poster image (from eventDetails.poster stored in the ticket JSON)
  • Date, venue, city, state, and hall name (when applicable)
  • Ticket holder name and email (from the users table)
  • Number of tickets, base amount, convenience fee, and total amount
  • Seat information (seat_no, seat_type) for Seating events
  • Zone information for Open events
  • Order ID, payment ID, and valid_till datetime
  • HMAC-SHA256 signed QR code for venue entry
Error responses
{ "error": "Ticket not found" }
{ "error": "Failed to generate ticket PDF" }

GET /api/user/getQR/:orderId

Returns the HMAC-signed QR code payload for a ticket. The orderId parameter in this endpoint is actually the ticket UUID (tickets.id), not the Razorpay order ID. The QR data is a JSON-stringified object containing:
  • ticketId — the ticket UUID
  • hash — HMAC-SHA256 of the ticket UUID using the server’s TICKET_SECRET
This payload is scanned by the organiser’s QR scanner endpoint (POST /api/organizer/scan-qr) to validate entry.
orderId
string
required
The ticket UUID (tickets.id) — not the Razorpay order ID.
curl https://api.tktplz.me/api/user/getQR/ticket-uuid
Response
success
boolean
true on success.
message
string
"QR generated successfully"
qrCode
string
JSON-stringified string to be encoded into a QR image by the client. Contains ticketId and hash.
{
  "success": true,
  "message": "QR generated successfully",
  "qrCode": "{\"ticketId\":\"ticket-uuid\",\"hash\":\"abc123def456...\"}"
}
Rendering the QR code The qrCode string is the raw data to encode. Pass it to any QR code library on the client:
import QRCode from 'qrcode';

const { qrCode } = await res.json();
const qrImageUrl = await QRCode.toDataURL(qrCode);
// Render <img src={qrImageUrl} />

Ticket schema reference

Tickets are stored in the tickets table with the following key fields:
id
string
Primary UUID of the ticket record.
userId
string
UUID of the ticket holder (references users.id).
eventId
string
UUID of the event (references events.id).
bookingID
string
Unique booking reference displayed on the ticket.
orderId
string
Razorpay order ID.
paymentId
string
Razorpay payment ID.
eventType
string
Event category, e.g. "movie", "concert", "hackathon".
numberOfTickets
number
Quantity of tickets in this booking.
totalAmount
string
Grand total paid (decimal).
baseAmount
string
Base ticket amount excluding convenience fee.
totalConvenienceFee
string
Convenience fee charged.
status
string
"CONFIRMED", "PENDING", "CANCELLED - REFUND DUE", or "CANCELLED - REFUND PROCESSED".
seat_type
string
Seat category for Seating events (e.g. "Normal", "Executive").
seat_no
string
Comma-separated seat labels for Seating events.
seatNumbers
array
JSON array of seat UUIDs for Seating events.
zone
string
Zone name for Open/Online events.
hall_name
string
Hall name for Seating events.
Access URL for Online events.
valid_till
string
Datetime until which the ticket is valid.
checkInStatus
string
"NOT_CHECKED_IN" or "CHECKED_IN".
qr_status
string
"unused" or "used".
eventDetails
object
JSON blob with event metadata (name, date, location, city, state, poster).

Build docs developers (and LLMs) love