SDKs
Official npm and Python client libraries for the Partner API
TIXFIN publishes official client libraries for the Partner API so you don't have to hand-roll HTTP calls, pagination, or error handling.
Both SDKs only cover the Partner API's read endpoints (events, ticket catalog, tickets, orders) — the same surface documented in the API Overview.
TypeScript / JavaScript
Package: @tixfin/partner-api-client
Source: tixfin/tixfin-rest-api/clients/typescript
npm install @tixfin/partner-api-clientimport { TixfinPartnerClient } from "@tixfin/partner-api-client";
const client = new TixfinPartnerClient({
projectId: "YOUR_PROJECT_ID",
apiKey: process.env.TIXFIN_PARTNER_API_KEY!, // "prefix.secret" format
});
const events = await client.listEvents({ page: 0, size: 20 });
const event = await client.getEvent(events.items[0].id);
const catalog = await client.listTicketCatalog({ eventId: event.id });
const tickets = await client.listTickets({ eventId: event.id, status: "VALID" });
const orders = await client.listOrders({ eventId: event.id });Point the client at a different host (e.g. staging) with baseUrl:
new TixfinPartnerClient({
projectId,
apiKey,
baseUrl: "https://staging-api.tixfin.com",
});Failed requests reject with a TixfinPartnerApiError exposing status,
message, and the raw response body:
import { TixfinPartnerApiError } from "@tixfin/partner-api-client";
try {
await client.listEvents();
} catch (error) {
if (error instanceof TixfinPartnerApiError) {
console.error(error.status, error.message);
}
}Ships as ESM and CJS with full TypeScript types — no separate @types
package needed.
Python
Package: tixfin-partner-api
Source: tixfin/tixfin-rest-api/clients/python
pip install tixfin-partner-apiimport os
from tixfin_partner_api import TixfinPartnerClient
client = TixfinPartnerClient(
project_id="YOUR_PROJECT_ID",
api_key=os.environ["TIXFIN_PARTNER_API_KEY"], # "prefix.secret" format
)
events = client.list_events(page=0, size=20)
event = client.get_event(events.items[0].id)
catalog = client.list_ticket_catalog(event_id=event.id)
tickets = client.list_tickets(event_id=event.id, status="VALID")
orders = client.list_orders(event_id=event.id)Point the client at a different host (e.g. staging) with base_url:
client = TixfinPartnerClient(
project_id=project_id,
api_key=api_key,
base_url="https://staging-api.tixfin.com",
)Failed requests raise TixfinPartnerApiError, exposing status_code,
message, and the raw response body:
from tixfin_partner_api import TixfinPartnerApiError
try:
client.list_events()
except TixfinPartnerApiError as error:
print(error.status_code, error.message)Requires Python 3.9+; depends only on requests.
Choosing a key
Both SDKs need a Partner API key scoped to the endpoint groups you call —
see Authentication for how to generate one.
A key called with an endpoint group it isn't scoped for raises/rejects
with a 403.
No official SDK for your language?
Every SDK is a thin wrapper around plain HTTP — see the API Overview for the raw endpoints and call them directly with any HTTP client.