The Trolley API: a practical guide
Everything you need to go from a new API key to a processed batch, with the details that trip people up: signatures, the 30-second clock, quotes and webhook retries.
Updated
The Trolley API is a JSON REST API at https://api.trolley.com/v1. Create a key pair in Settings › API Keys, then sign each request with Authorization: prsign <access key>:<HMAC-SHA256 signature> and an X-PR-Timestamp header; requests more than 30 seconds old are rejected. A payout is recipient → batch → payments → quote → start-processing, and webhooks tell you when payments are processed, failed or returned. Test everything in the sandbox first.
Keys, sandbox and live
- Create keys in the dashboard under Settings › API Keys › Create Key. You get an access key and a secret key; the secret is shown once, so store it straight away.
- Sandbox and live are separate accounts with separate keys, team roles and webhooks. Switch between them from the avatar menu (top right); account names end in "sandbox" or "live".
- Roles: the developer role can't create live keys.
- No read-only keys: a key can do anything the API can, including sending money. On Standard plans you can allowlist one IP address (unlimited on Trolley Plus).
Signing requests (prsign)
Trolley uses its own HMAC scheme, a carry-over from its Payment Rails days:
- Take the current Unix time in seconds as
timestamp. - Build the message:
timestamp, the HTTP method, the request path including the query string, and the body (empty for GET), joined with newlines and ending in a newline. - Sign it with HMAC-SHA256 using your secret key; hex-encode the result.
- Send
Authorization: prsign <access key>:<signature>andX-PR-Timestamp: <timestamp>.
import hashlib, hmac, time
def trolley_headers(method, path, body, access_key, secret_key):
ts = str(int(time.time()))
message = "\n".join([ts, method.upper(), path, body, ""])
sig = hmac.new(secret_key.encode(), message.encode(), hashlib.sha256).hexdigest()
return {
"Authorization": f"prsign {access_key}:{sig}",
"X-PR-Timestamp": ts,
"Content-Type": "application/json",
}
# GET /v1/batches?page=1&pageSize=10: sign the path with its query string
headers = trolley_headers("GET", "/v1/batches?page=1&pageSize=10", "", ACCESS, SECRET)
Common signature failures: signing the path without its query string, signing a body that differs by even one space from what you send, and clock drift. With only 30 seconds of tolerance, a client with a slow clock gets 401s; read the server time from the response's Date header and correct for it, or keep the clock synced with NTP.
Conventions worth knowing
| Thing | Format |
|---|---|
| Amounts | Strings with two decimals or none, like "1.99" or "123", never floats |
| Currencies, countries | ISO 4217 (USD) and ISO 3166 alpha-2 (US) |
| Dates | ISO 8601 in UTC |
| IDs | R- recipient, B- batch, P- payment, T- transfer |
| Responses | JSON with "ok": true or "ok": false and an errors array; check ok, not only the HTTP code |
| Rate limits | 200/min per IP, 100/min per live merchant, 50/min per sandbox merchant; HTTP 429 rate_limit_exceeded when over |
From recipient to processed batch
| Step | Endpoint |
|---|---|
| Create a recipient (or onboard them with the widget) | POST /v1/recipients |
| Add their payout account | POST /v1/recipients/:id/accounts |
| Check your balances | GET /v1/balances |
| Create a batch with payments | POST /v1/batches |
| Add more payments | POST /v1/batches/:id/payments |
| Lock FX rates (valid up to 90 minutes) | POST /v1/batches/:id/generate-quote |
| Send it | POST /v1/batches/:id/start-processing |
| Totals and status | GET /v1/batches/:id/summary |
| One payment | GET /v1/payments/:id |
A few rules from the reference: a batch should hold at most 10,000 payments; a payment below a recipient's bank-transfer minimum stops the whole batch from processing, so read the minimum from the recipient first; an underfunded batch stays open; once processing starts the batch can't be changed. Recipients from some countries need a government or tax ID before they become active. The full flow, with the dashboard side, is in How to send payouts with Trolley; every status is explained on our Trolley page.
POST /v1/batches
{
"currency": "USD",
"description": "Month end payout",
"payments": [
{ "recipient": { "id": "R-1a2B3c4D5e6F7g8H9i0J1k" }, "amount": "150", "currency": "USD" }
]
}
Webhooks
Add an endpoint under Settings › Webhooks (separately for sandbox and live) and choose the models and actions to receive. The useful ones for payouts:
- Payment: created, updated, deleted,
processed,failed,returned. - Batch: created, updated, deleted, processing, complete, failed.
- Recipient and recipient account: created, updated, deleted (a returned payment can disable a payout method, so listen here too).
- Tax form status changed, recipient verification created and status changed, and funds deposited.
Each delivery is a POST with model, action and body, plus three headers: X-PaymentRails-Signature (a timestamp and an HMAC-SHA256 signature to verify the sender), X-PaymentRails-Delivery (a unique ID, the same on retries) and X-PaymentRails-Created.
- Deduplicate: the same event can arrive more than once; key on the delivery ID.
- Don't rely on order: deliveries can arrive out of order, so compare timestamps or re-read the object.
- Retries: live retries up to 5 times with exponential backoff over about 32 hours; sandbox doesn't retry. 401, 403 and 410 responses are never retried.
- Validation: a new subscription gets an empty
{}POST first and only activates after a 200. - Logs: Settings › Webhooks › Webhook Logs keeps deliveries for 30 days. Webhooks come from 54.80.45.38 and 3.217.196.153 if you allowlist.
SDKs and tools
Trolley maintains SDKs for Python, PHP, JavaScript, .NET, Ruby and Java (github.com/trolley), which sign requests for you, and a Postman collection with signing built in. The reference lives at developers.trolley.com.
What the API doesn't do
- Tax forms: the Tax product has no API access yet, so form status stays in the dashboard (webhooks do announce status changes).
- Funding: you top up your balance by bank transfer; the API reads balances but doesn't pull money in.
- Cross-batch payment search: to find every returned payment you list payments batch by batch.
Built on this API: Payoutdesk
Payoutdesk is an independent phone app built on the Trolley API. You paste a key pair; it signs requests on the phone (with clock-drift correction), keeps the secret in the iOS Keychain or Android Keystore and only ever sends it to api.trolley.com. It shows balances, batches with their quote and fees, returned payments and recipients who can't be paid, and sends batches after Face ID.

Payoutdesk is not affiliated with or endorsed by Trolley, Inc. Details are from Trolley's API reference, checked 26 November 2026; check developers.trolley.com for changes.
Sources
- Trolley API reference
- Trolley: authentication
- Trolley: webhooks
- Trolley pricing (IP allowlisting by plan)
Questions
How do I get a Trolley API key?
In the Trolley dashboard, open Settings › API Keys and choose Create Key. You get an access key and a secret key; the secret is shown only once. Sandbox and live have separate keys, and Trolley's developer role can't create live keys.
How does Trolley API authentication work?
Each request carries an X-PR-Timestamp header (Unix seconds) and an Authorization header of the form prsign
What are the Trolley API rate limits?
200 requests a minute from a single IP address, 100 a minute per live merchant and 50 a minute per sandbox merchant. Over the limit you get HTTP 429 with a rate_limit_exceeded error.
Does Trolley have SDKs?
Yes: official SDKs for Python, PHP, JavaScript (Node), .NET, Ruby and Java on GitHub under the trolley organisation, plus a Postman collection that signs requests for you.
Does the Trolley API expose tax forms?
Trolley's Tax product doesn't have API access yet, so tax form status isn't available through the API; check it in the dashboard. Webhooks do include a tax form status-changed event.
Can I make a read-only Trolley API key?
No. Trolley API keys have full access to the account they were created in. Keep the secret on a server or in a device's secure storage, and use a separate key per tool so you can revoke one without the others.