Skip to main content
The tolt package wraps every v2 endpoint in a typed method. Run it on your server: it needs your secret API key.
client.partners.list()GET /v2/partners Tolt
Returned
response200
successtrue
data[part_8fKq…, …]
has_moretrue
next_cursor
Raised on 4xx, 5xx
ApiErrorNotFoundError
status_code404
body.code
body.doc_url…/errors#not_found

Install

Get an API key in Dashboard → Settings → Integrations → Tolt API.

Initialize

Methods take keyword arguments and return typed models. Single-item calls return the API envelope, so read .data. list returns a pager you can iterate.

Common calls

List partners

Iterating walks every page. The SDK passes each next_cursor back as starting_after for you.
pager.items holds one page’s rows, and pager.response the envelope with has_more. Iteration only moves forward: with ending_before, read pager.items and don’t iterate.

Create a customer

Bind a signup to a partner. customer_id is your id for the customer, ideally the one your billing system uses (a Stripe customer id, say), since billing integrations match payments on it. Send it or email. A partner_id (or link_id) is required; add the click_id tolt.js captured to keep the click’s link.

Record a payment

Amounts are integers in minor units (4900 = $49.00). Responses return money fields as strings ("4900") because they are stored as 64-bit integers. customer_id here is the Tolt cus_ id.

Refund it

Mint an embed token

For the partner dashboard embed. Pass a partner_id, or partner={"email": ..., "program_id": ...}.

Errors

Non-2xx responses raise. Known statuses get their own class; all of them extend ApiError.
Timeouts raise httpx’s TimeoutException, not ApiError. Read e.status_code and e.body rather than str(e), which starts with the response headers. The specific classes import from tolt. e.body is the error object (ErrorResponse) with message, code, doc_url and errors.

Retries and timeouts

Requests that fail with 408, 409, 429, 5xx or a connection error are retried with exponential backoff, honoring Retry-After. Set defaults on the client, or override per call with request_options.
Calls that create something (every create, and transactions.rerun_flows) are never retried, because a retry after a server error could create it twice. Before retrying one yourself, check whether it took effect. transactions.create with a charge_id is safe to retry: a duplicate raises ConflictError with code already_exists, so treat that as done.
request_options keys: max_retries, timeout, additional_headers, additional_query_parameters, additional_body_parameters.

Response headers

Prefix a call with with_raw_response to read headers such as X-RateLimit-Remaining.

Resources

Each method maps to one endpoint in the API reference.