Skip to main content

Use case · Accounts payable

Sandbox · boleto test payments

Pay approved invoices under your approval policy.

The copilot prepares the payment, checks it against the mandate, sends the exception to a person and comes back with proof.

Payments due today · boletos approved in the ERPdemo

Per-transaction cap

R$ 10,000.00 · above it, approval

Monthly cap

R$ 150,000.00 · above it, refused

Approval

Dashboard · expires in 24 h

Software subscription · INV-2287Boleto approved in the ERP · under the cap−R$ 4,700.00paid
Logistics · INV-2291Approved in the Dashboard · paid under the mandate · rcpt_demo_2291−R$ 18,400.00approved · paid
Print shop · INV-2294Boleto approved in the ERP · under the cap−R$ 2,300.00paid
INV-2291 · R$ 18,400.00 · approved in the Dashboard.
Paid today · of the approved queueR$ 25,400.00 of R$ 25,400.00
approval in the Dashboard · expires in 24 hreceipts rcpt_demo_2287 · rcpt_demo_2294 · rcpt_demo_2291 · signed

Agent run · demo data

Demo

Decide the exception yourself.

Two invoices clear on their own. The third waits for you: approve or refuse it as in the Dashboard, and watch the queue and the receipts follow.

Simulated demo · no real money
Activity demo2 entries
AgentINV-2291 · R$ 18,400.00Boleto approved in the ERP · above the R$ 10,000.00 cap · waits for approval in the Dashboard−R$ 18,400.00waiting for approval
AgentINV-2287 · R$ 4,700.00Boleto approved in the ERP · under the cap · simulated payment · receipt−R$ 4,700.00paid
Simulated result: waiting for approval: above the per-transaction cap.

The session opens with the first two requests already run; Reset brings that state back.

Approval queue demo

Paid today · of R$ 25,400.00 approved

R$ 4,700.00

Per-transaction capR$ 10,000.00
Waiting for approval1
Paid1
Refused0

No real supplier, no real ERP: the demo runs in your browser and nothing is paid.

The pain

Finance spends the day checking invoices against the policy and chasing the approver.

Who uses it

The accounts payable analyst and the person who approves above the cap.

Who buys it

CFO or controller of a mid-size company with an ERP and approval tiers.

The gain

The day's queue clears itself under the mandate. Only the exception reaches a person, with the rule and the receipt attached.

The flow, side by side

From an approved invoice to proof in the ERP.

The obligation already exists. The copilot pays it under the mandate; a person only decides the exception.

  1. 01Customer

    Approved in the ERP

    Finance approves the invoice in its own flow. The copilot reads supplier, amount, due date and the boleto line.

    INV-2291 · R$ 18,400.00 · due in 3 days
  2. 02Agent

    Prepared and checked

    The copilot pays the boleto through codespar_pay. The amount is checked against the mandate's caps before anything is sent.

    R$ 10,000.00 per transaction · R$ 150,000.00 a month
  3. 03CodeSpar

    Waits, approved, paid

    Above the per-transaction cap the payment waits for a person in the Dashboard. Approved, it runs the full cycle: reserved balance, debit, signed receipt.

    waiting → approved → paid · rcpt_demo_2291
  4. 04Payment method · ERP

    Settled and returned

    The boleto settles. Writing the status and the receipt back to the ERP is your integration.

    ERP "paid" · Illustrative · integration

Behind it

Mandate, approvals, payment, receipt.

The policy lives in the mandate: a per-transaction cap where a person steps in, and a monthly cap that refuses. Approvals run in the Dashboard; the copilot only asks and reads the status.

Mandate · mnd_demo_ap demo
Authorized byCFO · finance org
Per-transaction capR$ 10,000.00 · above it a person approves
Monthly capR$ 150,000.00 / month · above it, refused
PurposeSupplier invoices
ExpiryDec 31, 2026
Three paths under the same mandate demo
Happy pathINV-2287 · R$ 4,700 · under the cap → paid by boleto, receipt signed.
ExceptionINV-2291 · R$ 18,400 · above the per-transaction cap of R$ 10,000 → waits in the Dashboard; a person approves or refuses with the rule in view.
RefusalA payment that would take the month past R$ 150,000 → refused before anything is sent. A refused approval sends nothing either.
TypeScript · @codespar/sdk 0.16.11SDK example
const session = await new CodeSpar().create("user_0000", { preset: "brazilian" });const run = await session.send("pay the logistics supplier's boleto for invoice INV-2291");const pay = run.tool_calls.find((c) => c.tool_name === "codespar_pay");// above the per-transaction cap of R$ 10,000.00: approval_required, waits in the Dashboard · approved: paid, rcpt_demo_2291

SDK example · demo data · not run on this page

What runs it demo
Mandate and rulesExistsPer-transaction and monthly caps, checked before anything is sent.Open
ApprovalsExistsAbove the per-transaction cap the payment waits in the Dashboard. An organization admin decides; approvals expire in 24 h.Open
PaySandboxPays the boleto under the mandate.Open
Receipt and audit trailExistsA signed receipt for each paid boleto; every decision in the audit trail.Open
Return to the ERPPilot / integrationStatus and receipt written back to the ERP record by your integration.

What exists today

Exists, sandbox, pilot or direction: one label per control.

What you can run with a test key today, what runs in the sandbox, what depends on a pilot or an integration, and what is only a direction.

Mandate: per-transaction and monthly capsAbove the per-transaction cap a boleto waits for approval; above the monthly cap it is refused.Exists
Boleto test paymentsSettle in the sandbox with a test key.Sandbox
Approval in the DashboardAn organization admin approves or refuses; approvals expire in 24 h.Exists
Changed bank details checkComparing the payee's bank details with the approved record before paying. Not live: the payables API lists it as not covered.Direction
Verified approverApprover identity bound to the decision.Rolling out
Return to the ERPStatus and receipt written back to the ERP by your integration.Pilot / integration

Cookbook

An invoice under the policy, end to end.

The mandate is signed on the consent page; the copilot makes three calls in code. Above the per-transaction cap the payment waits for approval in the Dashboard; the copilot reads the outcome.

  1. A test keyFrom the Dashboard. Test keys are free; nothing moves real money.
  2. A mandatePer-transaction cap and monthly cap. The Dashboard opens the consent page; the consumer signs it.
  3. An approved invoiceAny reference the agent can quote: invoice number, supplier, amount, the boleto line.
@codespar/sdk 0.16.11SDK example
// 1 · the mandate was signed on the consent page: R$ 10,000.00 per transaction, R$ 150,000.00 a monthimport { CodeSpar, isApprovalRequired } from "@codespar/sdk";const session = await new CodeSpar().create("user_0000", { preset: "brazilian" }); // 2 · the copilot pays the boleto of an invoice the ERP approvedconst run = await session.send("pay the logistics supplier's boleto for invoice INV-2291");const pay = run.tool_calls.find((c) => c.tool_name === "codespar_pay"); // 3 · under the cap: paid · above it: waits for approval in the Dashboardif (pay && isApprovalRequired(pay.output)) console.log(pay.output.approval_id, pay.output.expires_at);else if (pay) console.log((await session.paymentStatus(pay.id)).payment_status); // "succeeded"

SDK example · demo data · not run on this page

Related use cases

Use caseSandbox

WhatsApp: Pix payment request in chat

A Pix charge inside the conversation, paid in the bank app.

Use caseSandbox

Autonomous procurement

Supplier orders paid under your rules.

Use caseSandbox

API and compute budgets

Agents pay for APIs and compute under a budget.

Give your agents a way to pay and get paid.

Build is free: hosted MCP, SDK and sandbox.

Test keys are free.

terminal · test modedemo
$ claude mcp add --transport http codespar https://connect.codespar.dev/mcp \    --header "Authorization: Bearer <test key>"> "pay the boletos due today that the ERP approved"  3 invoices · 2 under the per-transaction cap of R$ 10,000.00 · 1 above it  2 paid · 1 waiting for approval in the Dashboard · recorded

Illustrative · demo data

CFO copilot · CodeSpar