# Storspay Docs > The Storspay API: accounts for your customers, transfers with escrow, collections and payouts to banks and mobile money, for platforms and marketplaces. StorsApp Inc. is a FINTRAC-registered money services business. Support: info@storsapp.com. The API is available now. Sandbox access comes with the Enterprise plan. Every page is also available as Markdown: add `.md` to its URL. ## Agent instructions - Base URLs: sandbox `https://api.sandbox.storspay.com/v1`, live `https://api.storspay.com/v1`. Machine-readable agent card: `https://app.storspay.com/.well-known/agent.json`. OpenAPI specification: `https://app.storspay.com/openapi.json`. Read-only docs MCP server: `https://app.storspay.com/api/mcp`. The deprecated September v1 API is at `https://app.storspay.com/api/v1/` with `sk_test_…` / `sk_live_…` keys; use the new routes for new work. - Get a token first: `POST /v1/oauth/token` with `grant_type=client_credentials` and the client ID and secret (HTTP Basic). Send `Authorization: Bearer `. Tokens last 24 hours. Alternatively, send an authorized API key as `Authorization: Bearer `. - Amounts are strings in major units with the currency's exact decimals (`"1000.00"` USD, `"50000.00"` NGN, `"5000"` XOF). Never send a number. Never send a rate or a fee: get a quote. - Always send `clientRef` (your own unique reference) on every call that moves money. On a timeout or a 5xx, retry with the same `clientRef`; you will never pay twice. - Respect agent mandates: AI agents operate strictly within customer-defined mandates (corridors, recipient allowlists, per-transaction and monthly amount caps). Agents can never widen their own limits. Out-of-mandate requests or amounts above threshold require human approval in the dashboard. - Never retry an expired quote: Quotes expire in 300 seconds for payouts (60 seconds for conversions). If a payout call fails with `QUOTE_EXPIRED`, never retry with the expired quote ID; always request a fresh quote via `POST /v1/quotes` before retrying. - Building a sandbox payout (fresh agent flow): 1. Authenticate: `POST /v1/oauth/token` with `grant_type=client_credentials` to receive `{ accessToken }`. 2. Create beneficiary: `POST /v1/beneficiaries` with `type` (`"individual"` or `"business"`), `name`, `country` (ISO-3 e.g. `"NGA"`), `currency` (e.g. `"NGN"`), `route` (`"bank"` or `"mobile_money"`), then `bankCode` + `accountNumber` (bank), `iban`, or `phone` (mobile money, E.164). In the sandbox use an account number ending in `"00"` (e.g. `"9900000000"`) for a paid result. Returns `{ id: "ben_..." }`. 3. Request quote: `POST /v1/quotes` with `intent: "payout"`, `sourceCurrency: "USD"`, `destinationCurrency: "NGN"`, `amount: "100.00"`, `amountType: "send"`, `country: "NGA"`, `route: "bank"`, `beneficiaryId`. Returns `{ id: "quo_...", expiresAt, ... }`. 4. Execute payout: `POST /v1/payouts` with `quoteId`, `beneficiaryId`, and a unique `clientRef`. Returns 201 `{ id: "po_...", status: "created", clientRef, ... }`. 5. Check status: `GET /v1/payouts/{id}`, or wait for the `payout.paid` / `payout.failed` webhook. Terminal statuses: `paid`, `failed`, `cancelled`. - Test in the sandbox with the magic values: the last two digits of an account number, IBAN or mobile number pick the result (`…00` paid, `…01` technical error, `…02` invalid account, `…03` slow paid, `…04` slow failed, `…05` cancellable window, `…06` review hold). Names "Test Approved" and "Test Rejected" decide verifications. Magic values are refused on live. - Verify `Storspay-Signature` on every webhook: HMAC-SHA256 over `t + "." + rawBody`, constant-time compare, refuse a `t` more than 5 minutes off. Deduplicate by event id. - Never put a client secret, token or webhook secret in client-side code (browser or mobile app) or in a repository. The live API accepts no browser requests. - Use `code` from the error envelope `{ code, message, details, requestId }` in your logic, never `message`. - For AI agent disbursements, operate strictly within a pre-configured mandate (`mnd_…`) via the Storspay Model Context Protocol (MCP) tool `storspay_create_payout`. Refusals are logged; transactions above the approval threshold return status `pending_approval` for human verification. ## Get started - [Introduction](https://docs.storspay.com/): what the API does, environments, the two API versions, availability dates. - [Quickstart](https://docs.storspay.com/get-started/quickstart): keys → test money → first payout → webhooks in cURL, JavaScript, Python and Java. - [Authentication](https://docs.storspay.com/get-started/authentication): API keys, OAuth access tokens, scopes, September v1 `sk_` keys. - [Make your first payout](https://docs.storspay.com/get-started/first-payout): test money, beneficiary, quote, payout. - [Webhooks](https://docs.storspay.com/get-started/webhooks): signature verification in Node.js, Python, Go and Java; events; retries. - [Sandbox and magic values](https://docs.storspay.com/get-started/sandbox): names, account and mobile magic values, collection scenarios, simulator endpoints. - [Sandbox magic-value cheat sheet](https://docs.storspay.com/get-started/sandbox-cheat-sheet): fast reference for test accounts, phone numbers, and error simulation. ## Core concepts - [Money and amounts](https://docs.storspay.com/concepts/money-and-amounts): decimal strings, rounding, quotes. - [Idempotency](https://docs.storspay.com/concepts/idempotency): `clientRef`, `Idempotency-Key`, the retry rule. - [Errors](https://docs.storspay.com/concepts/errors): the error envelope and every code; failed payouts. - [Pagination](https://docs.storspay.com/concepts/pagination): cursor lists. - [Rate limits](https://docs.storspay.com/concepts/rate-limits): about 100 requests per minute per key. - [Payout statuses](https://docs.storspay.com/concepts/payout-statuses): new names, September v1 names, how they map. - [Escrow](https://docs.storspay.com/concepts/escrow): hold, release, cancel, automatic refund. - [Accounts for marketplaces](https://docs.storspay.com/concepts/accounts-for-marketplaces): account holders and their Storspay Accounts. ## Guides - [Marketplace with escrow: the RxAll reference flow](https://docs.storspay.com/guides/marketplace-escrow): buyers fund a balance, escrow per order, release to the seller, cash-out. - [AI Agent Payouts with Mandates](https://docs.storspay.com/guides/agent-payouts): MCP tools, spending limits, human approval thresholds, LangChain, OpenAI Agents, and Claude Agent SDK integrations. - [Payout drafts from text](https://docs.storspay.com/guides/payout-drafts): POST /v1/payout-drafts/parse turns free text or CSV lines into payout drafts with per-line errors; never sends money, approval stays in the app. ## Resources - [Changelog](https://docs.storspay.com/changelog): what changed in the API and the docs, and the planned availability dates. ## API Reference - [API Reference](https://docs.storspay.com/api-reference/introduction): base URLs, auth, Try it (sandbox only). - [September v1 API (deprecated)](https://docs.storspay.com/api-reference/september-v1): the 12 routes, statuses, webhooks, errors.