Account & wallets
Fund company wallets with Stripe Checkout, create wallets with a budget (rill_vw_*), manage fleet policy, and open the billing portal. Owner JWT for account wallets and create; wallet key for allowance status.
Same flow in MCP: rill_create_wallet
Auth
Create wallet, list accounts, revoke, rotate, and billing portal need an owner Supabase JWT. Send X-Rill-Environment: live|test (default live) on owner JWT calls — Test mode uses a separate wallet balance and mints rill_vw_test_* / rill_sk_test_* keys. Fund-checkout accepts an owner JWT or a rill_vw_* key (VW may only fund its own account wallet; agents prefer POST /agent/fund-checkout). Wallet status uses Authorization: Bearer rill_vw_*. Send Idempotency-Key on fund-checkout, mock fund, and other mutating writes.
Authorization: Bearer <owner JWT or rill_vw_*>Featured endpoints
Fund with Stripe Checkout
POST /accounts/:id/fund-checkoutCreate a top-up PaymentIntent for the dashboard Payment Element (default), or pass hosted=true for a Stripe Checkout URL. Response includes amount (wallet credit), processing_fee, total_charged, and either client_secret (+ publishable_key) or checkout_url. Wallet credits face amount; human pays total. Poll GET /funding/:id until paid, then create wallets.
Request body
What to save
Save funding_intent_id. Dashboard uses client_secret in-modal; agents that need a link should pass hosted=true and send checkout_url. Poll the funding intent until paid before expecting Spend to succeed.
- Agents: POST /agent/fund-checkout with a rill_vw_* key (always hosted Checkout URL).
- Local or non-production may allow POST /accounts/:id/fund (mock) when Stripe is unset, mock credits face amount with no card fee.
- MCP twin: rill_fund with action=checkout, then action=intent.
Create a wallet
POST /walletsCreate a wallet with a budget from a funded account wallet. Set period allowance and max per transaction in USD. Optional allowlist and policy_template_id apply fleet defaults for many agents sharing one template.
Request body
What to save
Save the rill_vw_* key immediately, it is shown once. Use it for POST /spend/pay-url and POST /pay. Store the wallet id for revoke/rotate.
- Fund the account wallet before creating a wallet or pays fail with insufficient balance.
- MCP twin: rill_create_wallet.
Read wallet allowance
GET /wallets/me/statusReturn remaining period allowance and per-tx caps for the calling wallet. Call after pays to stay inside budget. Seller balance is a different route (GET /sellers/me/balance).
What to save
Use remaining allowance and max_transaction from the response to decide whether to pay, wait for period reset, or create a wallet with a higher budget.
- Auth with the wallet key (Bearer rill_vw_*).
- MCP twin: rill_balance with vw_key.
All endpoints
Usage notes
- Revoke or rotate a wallet with POST /wallets/:id/revoke|rotate when a key leaks.
- Fleet defaults: create a policy template, then pass policy_template_id when creating a wallet.
- Spend happy path: claim → fund-checkout → create wallet → pay Accept link (seed_gate) or payment_ready URL via POST /spend/pay-url.