What the agent does
From purchase order to signed receipt.
The agent proposes and pays. A person steps in only above the per-transaction cap.
01
Order
A purchase order comes in from procurement. The agent reads supplier, amount, due date and the boleto line.
02
Mandate
The per-transaction cap and the monthly cap are checked before anything is sent. A payment over the monthly cap is refused.
03
Payment
Under the per-transaction cap the boleto is paid. Above it, the payment waits for a person in the Dashboard; on approval it runs the full cycle: reserved balance, debit, signed receipt.
04
Receipt
Each paid boleto gets a signed receipt and a ledger entry with the supplier category; the order reference rides in the description.
Behind it
The parts that run it.
Three calls from the agent. Everything else is the platform: mandate, payment, approvals, receipt.
Sandbox run · demo data
Cookbook
A supplier payment, end to end.
The consumer signs the mandate on the consent page; the agent makes three calls in code. A payment above the per-transaction cap waits for approval in the Dashboard; the agent reads the status.
- 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.
- A purchase orderAny reference the agent can quote: PO number, supplier, amount, the boleto line.
// 1 · the consumer signed the mandate on the consent page: R$ 3,000.00 per transaction, R$ 20,000.00 a monthimport { CodeSpar, isApprovalRequired } from "@codespar/sdk";const session = await new CodeSpar().create("user_0000", { preset: "brazilian" }); // 2 · the agent pays the boleto from the purchase orderconst run = await session.send("pay the packaging supplier's boleto for PO-0418");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"Sandbox run · demo data