Skip to main content
PayLive

One governed call.Any rail.

Your agent calls pay once. The runtime checks the mandate, picks the rail — USDC over x402, Pix in Brazil — and seals the receipt. The agent never names a provider; the router does.

pay() · call trace
Mandate checkSignedOK
RouterPixSelected
SettlementR$142.50Asaas
Receiptrcpt_9f2c1a4eSealed

Field names and sequence are real — mandate check, then routing, then settlement, then a sealed receipt. The settlement row names an outbound Pix provider: Mercado Pago's Pix line creates an inbound charge, so the router does not use it for pay.

The problem

Paying a supplier shouldn't take three integrations.

Route money to a supplier, a contractor, or a payout across the border today, and you're wiring up a Pix PSP, a card processor, and a stablecoin wallet — three SDKs, three retry policies, three reconciliation reports to match up by hand. Pay collapses all of that into one call.

Integration
Wire up three separate SDKs — a Pix PSP, a card processor, a stablecoin wallet — each with its own auth and setup.
One codespar_pay call. The router already speaks to every rail.
Retries & idempotency
Every rail retries and dedupes differently — a timeout on one integration can double-pay on another.
One governed call, checked against the mandate before anything moves.
Rail selection
Your code has to decide up front which rail to call for which destination.
The agent never names a rail — the router picks it from the mandate and the destination.
Reconciliation
Reconciling spend means matching receipts across three separate dashboards by hand.
Every settled payment returns one sealed receipt, same shape no matter which rail settled it.
How it works

The mandate decides what's allowed. The router decides how.

One call, checked against the signed mandate before anything moves, then routed to whichever rail fits: USDC settling over x402, Pix for BRL. USDC/x402 is one slot of the same wallet; the Pix lane runs on the same runtime, not a separate integration.

The call, step by step
1Your agent calls pay() once — amount, destination, nothing else.
2The runtime checks the call against the signed mandate before anything moves.
3The runtime resolves the rail: the router picks the provider for Pix, card and USDC over x402; a boleto settles by its linha digitável.
4The rail settles and a sealed receipt comes back to the agent.
In code

The call your agent actually makes.

Your agent calls pay once — amount, destination, and the mandate reference. There's no provider parameter to set. The runtime checks the call against the signed mandate first, because the cap has to hold before money moves, not after — then it resolves the call to whichever provider fits.

pay-supplier.ts
const session = await codespar.sessions.create({
  mandate: mandate.id,
});

const payment = await session.execute("codespar_pay", {
  input: {
    amount: 14250,              // R$142.50 in centavos
    currency: "BRL",
    destination: "supplier_8f21a",
    mandateRef: mandate.id,     // cap enforced before the call executes
    // no `rail` field — the router picks Pix, boleto, card, or USDC
  },
});

console.log(payment.result);
// → { receiptId: "rcpt_9f2c1a4e", rail: "pix", status: "settled" }
rcpt_9f2c1a4e · settled via pix

codespar_pay is the same call regardless of what settles underneath it — Asaas or Celcoin for Pix today, another provider tomorrow, without your agent's code changing.

What this call chain does

  • The mandate is checked before the call executes — spend past the cap simply doesn't happen
  • No provider field — for Pix, card and USDC the router alone picks who settles it
  • One receipt comes back regardless of which rail actually moved the money
Coverage

Where each rail actually stands.

One rule for this list: what the code does today, and how far each rail has been proven. Pix payouts route to the outbound providers on this surface, Asaas and Celcoin, and failover stays inside the rail. Mercado Pago's Pix line creates an inbound charge, so the router refuses it for pay. Boleto skips the router: codespar_pay settles an existing boleto on its own consult-then-confirm path, exercised end to end against the provider's sandbox. Card and USDC over x402 are named in the same governed call. Each row says what the code does with that rail; where a rail has only run against a provider's sandbox, the row says sandbox.

Pix · Asaas
Outbound transfer, routed by pay
Pix · Mercado Pago
Inbound charge, not routed by pay
Pix · Celcoin
Sandbox-proven
Boleto
Settle path, sandbox-proven
DDA
Provider has not authorized DDA on our credentials
Card
Named in the call
USDC · x402
Base mainnet on operator opt-in, Base Sepolia otherwise
Same call, two rails

One codespar_pay call, two different destinations. The router reads the mandate and picks the rail — the call your agent writes doesn't change.

pay() · domestic supplier
Mandate checkSignedOK
RouterPixSelected
SettlementR$3,200.00Asaas
Receiptrcpt_7a41c9b0Sealed
pay() · cross-border payout
Mandate checkSignedOK
RouterUSDCSelected
Settlement$1,240.00 USDCx402
Receiptrcpt_4b7f9d21Sealed
Rail status
Live today
  • Pix routes to an outbound provider, Asaas or Celcoin, chosen by the router
  • Boleto settles on its own consult-then-confirm path, inside the same governed call
  • Every call is checked against the mandate before it executes
  • Every settled payment returns a sealed, auditable receipt
  • Billing is active for early organizations at the published rate
Rolling out
  • Pix via Celcoin moving from sandbox to production settlement
  • Card and USDC/x402 confirmed production-live for every account
  • Billing turned on for every organization, not just the rollout cohort
Pricing

10 bps, floor R$0.05, cap R$2.00 per transaction.

That's the published rate for money moved under mandate. Billing is rolling out org by org, not universally charged yet — your dashboard billing page shows whether it's active on your account.

10bps
Take rate
On money moved under mandate
R$0.05
Floor
Minimum charge per transaction
R$2.00
Cap
Maximum charge per transaction
5
Rails named
Named in one governed call

LivePix payouts route to the outbound providers on this surface, Asaas and Celcoin.

FAQ

Pay, answered

It doesn't. The agent calls pay once; the runtime picks the rail based on the mandate and what's available, then seals the receipt.

Not through Mercado Pago: its Pix line creates an inbound charge, so the router does not use it for pay. codespar_pay routes Pix to an outbound provider, Asaas or Celcoin, and Celcoin is proven in sandbox, not yet settling production traffic.

Pix, boleto, card and USDC over x402 are named in the same governed call. How far each one has been proven differs by rail, and the coverage section on this page says which is which.

The mandate — checked before the call executes, not after.

The published rate is 10 bps, floor R$0.05, cap R$2.00 per transaction. Billing is rolling out account by account.

No. Agents never name a provider — the router does, and every decision is audited.

The call fails closed. Nothing settles outside the mandate, and the failure is recorded on the receipt the same way a success would be.

No. CodeSpar holds the rail connections; your agent only ever calls pay.

Pay anything with one governed call.

The mandate decides what's allowed; the router decides how.

pay: Pix payouts route to the outbound providers on this surface, Asaas and Celcoin.

Pay — one governed call that pays anything | CodeSpar | CodeSpar