TixFinDocs

SDKs

Official npm and Python client libraries for the Partner API

3 min read

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.

The SDKs are not on npm or PyPI yet. Until they are, ask support for version 0.2.0, or call the REST API directly. Version 0.2.0 matches the current API: it defaults to https://beta-rest-api.tixfin.com, reads the page envelope's totalItems and totalPages, and reports the API's detail as the error message.

TypeScript / JavaScript

Package: @tixfin/partner-api-client 0.2.0

npm install @tixfin/partner-api-client
import { TixfinPartnerClient } from "@tixfin/partner-api-client";

const client = new TixfinPartnerClient({
  projectId: "YOUR_PROJECT_ID",
  apiKey: process.env.TIXFIN_PARTNER_API_KEY!, // "prefix.secret" format
  baseUrl: "https://beta-rest-api.tixfin.com",
});

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: "PAID" });
const orders = await client.listOrders({ eventId: event.id });

baseUrl also points the client at another host, such as a local partner-api on http://localhost:8087.

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 0.2.0

pip install tixfin-partner-api
import 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
    base_url="https://beta-rest-api.tixfin.com",
)

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="PAID")
orders = client.list_orders(event_id=event.id)

base_url also points the client at another host, such as a local partner-api on http://localhost:8087. The request timeout defaults to 10 seconds (timeout=).

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 call to an endpoint group the key isn't scoped for, or that the project has not enabled, raises/rejects with a 403. status filters for tickets are PAID, SCANNED, SCANNED_OUT and CANCELLED.

Settings → Integrations with the endpoint groups and the Partner API keys
  1. Integrations
  2. Endpoint groups
  3. Create API key
  4. Rotate or revoke a key
📸 Settings → Integrations with the endpoint groups and the Partner API keys

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. The OpenAPI document at https://beta-rest-api.tixfin.com/api/partner/openapi.json can generate a client for any language.

Next Steps

On this page