Payoutdesk

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

Short answer

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

Signing requests (prsign)

Trolley uses its own HMAC scheme, a carry-over from its Payment Rails days:

  1. Take the current Unix time in seconds as timestamp.
  2. 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.
  3. Sign it with HMAC-SHA256 using your secret key; hex-encode the result.
  4. Send Authorization: prsign <access key>:<signature> and X-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

ThingFormat
AmountsStrings with two decimals or none, like "1.99" or "123", never floats
Currencies, countriesISO 4217 (USD) and ISO 3166 alpha-2 (US)
DatesISO 8601 in UTC
IDsR- recipient, B- batch, P- payment, T- transfer
ResponsesJSON with "ok": true or "ok": false and an errors array; check ok, not only the HTTP code
Rate limits200/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

StepEndpoint
Create a recipient (or onboard them with the widget)POST /v1/recipients
Add their payout accountPOST /v1/recipients/:id/accounts
Check your balancesGET /v1/balances
Create a batch with paymentsPOST /v1/batches
Add more paymentsPOST /v1/batches/:id/payments
Lock FX rates (valid up to 90 minutes)POST /v1/batches/:id/generate-quote
Send itPOST /v1/batches/:id/start-processing
Totals and statusGET /v1/batches/:id/summary
One paymentGET /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:

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.

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

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.

Connecting a Trolley API key pair in Payoutdesk
Paste an access key and secret; they're checked with Trolley and stored on the phone.

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

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 :, where the signature is the hex HMAC-SHA256, keyed with your secret, of the timestamp, method, path with query string and body, each followed by a newline. Requests older than 30 seconds are rejected.

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.