Quickstart
Open two accounts, take $50 by card, pay a shop $18 inside ERA, read the signed events. Amounts are always whole cents.
Keys and scopes
Send Authorization: Bearer era_test_… on every call. Keys are shown once and stored by ERA only as a hash. A key reaches only its own platform's accounts.
| Scope | Allows |
|---|---|
| read | balances, proofs, addresses, quotes, events |
| move | accounts, deposits, transfers, conversions, backers, webhook address |
| payout | card and crypto payouts, withdrawal addresses |
Give each part of your system the smallest scope it needs. A key used by a reporting job needs only read.
A key with every scope can make narrower keys (POST /v1/keys), list them by id and revoke them (DELETE /v1/keys/{id}), and rotate the signing secret: the old one keeps signing alongside the new one for 24 hours.
Safe retries
Every POST that changes something takes an Idempotency-Key of 8 to 100 characters. Use your own order or request id. The same key with the same body returns the first answer again, with Idempotent-Replayed: true. The same key with a different body is refused with 409. A timeout is never a reason to guess: send the same request again.
Accounts and balances
| Method | Path | What it does |
|---|---|---|
| POST | /v1/accounts | name (1 to 40 of a-z 0-9 - _), kind customer or business |
| GET | /v1/accounts/{name}/balances | per asset: total, available_to_withdraw, not_yet_final |
| GET | /v1/accounts/{name}/proof/{asset} | the balance, the book's signed seal, and a private proof that it is counted in the total ERA signed. Hand it to your customer: they check it at /check in any browser, or offline with python -m rail.watch balance. No one else's balance or address is in it |
| GET | /v1/accounts/{name}/history/{asset} | the account's statement, read from the book; every line names the entry that proves it. Add ?format=csv for a spreadsheet |
available_to_withdraw is the part that is final. Card money becomes final when its dispute window has closed and the provider's statement confirms it, or at once if a backer stands behind it.
Money in
| Method | Path | What it does |
|---|---|---|
| POST | /v1/deposits/card | account, card_token, amount. Captured now, credited when it settles |
| POST | /v1/deposits/card/{id}/refund | account, amount. Back to the card that paid, never more than was paid |
| GET | /v1/deposits/crypto/{account}/address | network (a or b). A USDC address for this account on that network; credited after 12 confirmations |
ERA never takes a card number. The card provider's own form returns a token; anything that looks like a card number is refused. A card belongs to the first account that uses it.
Money inside
| Method | Path | What it does |
|---|---|---|
| POST | /v1/transfers | from_account, to_account, amount, asset. Instant; whether the money is final travels with it |
Paying another platform
Every account has a pay id. Any account on any platform on the rail can pay it, at once, with no card network or bank in the middle. By default only final money arrives from other platforms, so another platform's chargebacks can never reach your customers; you can choose to accept money that is not final yet. The receiver sees the amount and the sender's pay id, never the sender's name or platform.
| Method | Path | What it does |
|---|---|---|
| GET | /v1/accounts/{name}/pay-id | the account's pay id, to share |
| POST | /v1/payments | from_account, to_pay_id, amount, asset. Payout scope |
| POST | /v1/receiving | accept_not_final true or false (off by default) |
Money out
| Method | Path | What it does |
|---|---|---|
| POST | /v1/payouts/card | to a card the account has paid in with; final money only |
| POST | /v1/payouts/crypto/addresses | account, address, network. Usable after 24 hours, on that network only |
| POST | /v1/payouts/crypto | one daily limit across networks; above $100 a second person at ERA approves |
The money is set aside first. It leaves the account for good only when the payout is confirmed, and comes back only when the provider shows the payout failed.
Conversions
| Method | Path | What it does |
|---|---|---|
| GET | /v1/conversions/quote | from_asset, to_asset, amount |
| POST | /v1/conversions | account, from_asset, to_asset, amount. Final money only |
ERA-USD and ERA-USDC are separate books. Conversion goes through ERA's own capped float and creates nothing.
Backers
A backer locks money in advance and stands behind card payments that are not final yet, for a premium. The shop can then withdraw at once; if the payment is disputed, the locked money pays. How backers join
| Method | Path | What it does |
|---|---|---|
| POST | /v1/backers | open a backer |
| POST | /v1/backers/{name}/lock | lock final money; unlock only what no longer stands behind payments |
| POST | /v1/backers/{name}/offers | max_amount, premium_bps (0 to 2,000) |
| POST | /v1/deposits/card/{id}/back | account, max_premium_bps. Final now if an offer fits |
Events and webhooks
Every change becomes an event, numbered in order and signed with your platform's signing secret (HMAC-SHA256 over the event as JSON with sorted keys). Read them with GET /v1/events?after= or set an https address with POST /v1/webhook: delivered in order, once, retried with back-off.
Types: deposit.credited, deposit.reversed, transfer.completed, payout.started, payout.paid, payout.failed, conversion.completed, payment.backed, fee.charged, account.frozen, account.unfrozen.
Errors and limits
| Status | Meaning |
|---|---|
| 400 | refused; the message says why |
| 401 | no key, wrong key, or a key without that scope |
| 409 | an idempotency key reused for a different request |
| 413 | body over 16 KB |
| 422 | unknown or wrongly typed fields; amounts must be whole numbers |
| 429 | too many requests; wait a moment |
| 503 | the rail paused itself for safety; try again shortly |
Checking ERA's records
Every entry is sealed into a signed record. GET /v1/seal/{asset} and GET /v1/reserves are public. Outside watchers redo every entry and co-sign what they checked; their signatures come with each balance proof.
Finality marks and the open search
Every deposit carries an ERA Finality mark: final, not final yet, or reversed; a level from 0 to 100; the basis once final; and when it becomes final by time. Card deposits return a mark_id at once; crypto deposits name it in their deposit.credited event. A mark holds no amount, account or reference of yours, and is signed so anyone can check it offline.
| Method | Path | What it does |
|---|---|---|
| GET | /v1/marks/{mark_id} | with your key: your marks, always. Without a key: only if you opened the search |
| POST | /v1/marks/open-search | open_search true or false; off until you turn it on |
| POST | /v1/marks/verify | public: is this mark genuine and unchanged |
| GET | /v1/keys | public: the key that signs marks |
| GET | /v1/record | public: marks called final, and how many were later pulled back |
Public pages: /marks (look up a mark by id) and /verify (paste a mark to check it).
Nothing built yet
Start from one of five ready-made apps: Memberships & Subscriptions, Bookings & Appointments, Dues & Group Collections, Shop & Tickets, Donations & Tips. Add a name, logo, colour and prices, and publish. Its payments, renewals and refunds run on the rail into your own account, with finality marks.
When you are ready for code, get a rail API key from the same dashboard: it reaches the same account your apps are paid into.
Already have payments
Keep your card processor and your own app. Add ERA Open Rail beside them for three jobs: payments to and from other apps, balances your customers can prove, and payouts that only use final money.
- Open an account for each customer or business:
POST /v1/accounts. - Bring money in the way you do today. If your processor sits behind ERA Open Rail's card door, its payments land in the account; or top the account up by card or USDC through ERA Open Rail.
- Let customers pay anyone on another app by pay id:
GET /v1/accounts/{name}/pay-idandPOST /v1/payments. It arrives at once; only final money crosses unless the receiver accepts otherwise. - Give each customer their balance proof (
GET /v1/accounts/{name}/proof/{asset}); they check it themselves at/check. - Pay out with
available_to_withdrawonly: card or crypto out never uses money that can still be pulled back. - Listen for signed events to keep your app in step:
transfer.received,deposit.credited,payout.paid.
Your existing ledger can stay the place your app reads from; ERA Open Rail's statements and daily reconciliation let you check the two agree.
Connectors
Ready-made ways in, from two lines on a page to a full plug-in. Every one is tested against a live ERA Open Rail in the sandbox.
| Connector | Where | What it does |
|---|---|---|
| Pay button | POST /v1/checkouts, /era-pay.js | A payment page on ERA Open Rail for one amount; the button opens it; the customer returns to your return_url with era_checkout, era_status, era_amount, era_at and era_sig. Check with verify_checkout / verifyCheckout; ship on the request.paid event. |
| Keep your processor | rail/connectors/processor_mirror.py | Receives your processor's signed events (standard signed-webhook format) and credits the customer named in the payment's metadata (era_account) from your float, once per event; refunds and disputes go back to the float. |
| Online store plug-in | plug-in package | Pay with ERA Open Rail at checkout. Set your notification address to https://your-shop/?wc-api=era_open_rail. An order is marked paid only by a signed notification for its exact amount. |
| Notification kits | rail/connectors/kits/receiver.py, receiver.mjs | Copy into your app. Checks ERA-Signature (and ERA-Signature-Previous during a rotation), refuses events at or below the last handled, saves its place safely. |
| Command line | python -m rail.cli | open, balance, pay, pay-id, move, statement --csv, proof --save, checkout, events. Reads ERA_RAIL_KEY from the environment; asks before moving money. |
| Clients | rail/clients/era_rail.py, era-rail.mjs | Every endpoint, idempotency keys added for you, verify_event and verify_checkout helpers. |
| Scan to pay | /pay/{id}, /pay/{id}/qr.svg | Every payment page shows a QR code of its own address; the printable QR is its own file for counters and invoices. Any app on ERA Open Rail can also pay by the checkout id. |
| Verified balance badge | /era-badge.js | <span data-era-proof="/your/proof-endpoint"></span> on your page; your endpoint returns the signed-in customer's proof. The customer's browser checks it against /v1/keys (readable from any site) and shows Verified or Not verified. |
| Shadow mode | rail/connectors/era_app_shadow.py | For an app already running payments (the ERA app first): replay a day's exported transactions on a sandbox ERA Open Rail and get a report of every balance that agrees or differs, and every transaction the rail would refuse. Read only toward your app; sandbox only. |
| Postman collection | rail/docs/era-open-rail.postman.json | Every /v1 call, ready to try. Set the variables base and key in Postman; each POST gets a fresh Idempotency-Key. |
| Fund a float (sandbox) | POST /v1/sandbox/wire | Your money arrives by bank wire into one of your accounts, final once credited. Use it to fund the float the processor connector pays from. |
The two lines for any web page:
<script src="https://api.eragc.com/era-pay.js" async></script> <button data-era-checkout="req_..."></button>
Sandbox
Test money only. Test cards: 4242 4242 4242 4242 and 5555 5555 5555 4444 succeed, 4000 0000 0000 0002 is declined.
| Method | Path | What it does |
|---|---|---|
| POST | /v1/sandbox/cards | a token for a test card |
| POST | /v1/sandbox/settle | settle captured card payments |
| POST | /v1/sandbox/close-dispute-windows | let card money become final |
| POST | /v1/sandbox/finish-card-payouts | complete or fail pending card payouts |
| POST | /v1/sandbox/finish-refunds | complete or fail pending refunds |
| POST | /v1/sandbox/coins | send test USDC to an address |
| POST | /v1/sandbox/mine | add blocks to the test chain |
Clients
One file each, no dependencies: era_rail.py for Python and era-rail.mjs for JavaScript. Both send an idempotency key on every POST and check event signatures in constant time.
What is live
The full rail is open in the sandbox today: every endpoint on this page, with test money. Live access opens with launch partners, capability by capability, as each one completes its approvals.