Installation
fetch). TypeScript 5.0+ recommended.
Current version: v1.1.1 — view on npm
Initialization
tn.me()
Get API key and organization info.tn.events
create(params)
Creates an event inDRAFT status. Optionally include inline ticket types.
createAndPublish(params)
Creates an event and immediately publishes it to the marketplace in a single call. Accepts the same parameters ascreate().
list(params?)
get(idOrSlug)
update(eventId, params)
publish(eventId) / unpublish(eventId) / archive(eventId)
delete(eventId)
Only works on DRAFT events with no sold tickets.tn.tickets
create(eventId, params)
list(eventId)
get(eventId, ticketId)
update(eventId, ticketId, params)
publish(eventId, ticketId)
markSoldOut(eventId, ticketId)
SetsremainingQuantity to 0.
delete(eventId, ticketId)
Only works if no tickets have been sold.tn.performers
Manage the performer lineup for an event. Requiresevents:write scope for mutations, events:read for listing.
create(eventId, params)
list(eventId)
remove(eventId, performerId)
tn.schedules
Build a timetable for your event. Schedule entries can optionally link to performers. Requiresevents:write scope for mutations, events:read for listing.
create(eventId, params)
list(eventId)
update(eventId, scheduleId, params)
remove(eventId, scheduleId)
tn.brands
Attach sponsor or partner brands to your event. Requiresevents:write scope for mutations, events:read for listing.
create(eventId, params)
list(eventId)
remove(eventId, brandId)
tn.orders
Orders are read-only. Requiresorders:read scope.
list(eventId, params?)
get(orderId)
Includes payment details.tn.venues
search(params)
tn.webhooks
create(params)
Returns the webhook with asecret field — store it securely, it is only shown once.
list()
update(webhookId, params)
delete(webhookId)
test(webhookId)
Sends a test payload to your webhook URL.deliveries(webhookId, params?)
View delivery history for a webhook.Utilities
The SDK exports helper functions for common tasks.formatPeso(amount)
Formats a number as a Philippine Peso string. Returns"Free" for zero.
validatePrice(price)
Validates that a price is a valid number. Throws aTicketnationError if invalid.
Pagination Helpers
paginate()
Async generator that yields one page at a time:fetchAllPages()
Collects all pages into a single array:Error Handling
All API errors throwTicketnationError with a hint property that provides actionable guidance:

