tolt package wraps every v2 endpoint in a typed method. Run it on your server: it needs your secret API key.
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
Initialize
.data. list returns a pager you can iterate.
Common calls
List partners
Iterating walks every page. The SDK passes eachnext_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 apartner_id, or partner={"email": ..., "program_id": ...}.
Errors
Non-2xx responses raise. Known statuses get their own class; all of them extendApiError.
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, honoringRetry-After. Set defaults on the client, or override per call with request_options.
request_options keys: max_retries, timeout, additional_headers, additional_query_parameters, additional_body_parameters.
Response headers
Prefix a call withwith_raw_response to read headers such as X-RateLimit-Remaining.
Resources
Each method maps to one endpoint in the API reference.

