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.
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 days02Agent
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 month03CodeSpar
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_229104Payment 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.
SDK example · demo data · not run on this page
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.
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.
- A test keyFrom the Dashboard. Test keys are free; nothing moves real money.
- A mandatePer-transaction cap and monthly cap. The Dashboard opens the consent page; the consumer signs it.
- An approved invoiceAny reference the agent can quote: invoice number, supplier, amount, the boleto line.
// 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