Skip to main content

Use case · Supplier payments

Sandbox · boleto under a mandate

Every supplier order, paid under your rules.

A need becomes an order with your supplier, and the agent pays it under the mandate: under the per-transaction cap it pays, above it a person approves, past the monthly cap it is refused.

Agent run · purchase orderdemo

"pay the packaging supplier's boleto for PO-0418"

Need · packaging below the reorder pointFrom your inventory system · demo dataneed
Order placed with the supplier · PO-0418Placed by your purchasing flow · R$ 1,180.00 · the supplier issues a boletoordered
Check the mandateUnder the R$ 3,000.00 per-transaction cap · R$ 6,120.00 of R$ 20,000.00 this monthallowed
Pay by boletoPO-0418 in the description · ledger entry, supplier category−R$ 1,180.00paid
Receipt signedrcpt_demo_8a31 · Ed25519 signaturesigned
Next order, above the capPO-0421 · R$ 4,200.00 · waits for approval in the Dashboard−R$ 4,200.00waiting
Monthly cap · OctoberR$ 7,300.00 of R$ 20,000.00
1 waiting for approval · R$ 4,200.00approval in the Dashboard · expires in 24 h

Agent run · demo data

Demo

Follow a supplier payment from request to decision.

Two boletos against the same mandate: one under the per-transaction cap, one above it. Then approve the one that waited.

Simulated demo · no real money
Activity demo2 entries
AgentSupplier boleto R$ 4,200.00Above the R$ 3,000.00 per-transaction cap · waits for approval in the Dashboard−R$ 4,200.00waiting for approval
AgentSupplier boleto R$ 1,180.00Under the cap · simulated payment · receipt−R$ 1,180.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.

Purchase orders demo

Wallet balance

R$ 13,620.00

Per-transaction capR$ 3,000.00
Paid this monthR$ 7,300.00
Waiting for approval1
Signed receipts1

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

The pain

Orders go out every week, and paying each supplier still waits for someone.

Who uses it

The operations or purchasing agent, and the person who approves above the cap.

Who buys it

COO or head of operations of a company that buys from the same suppliers every month.

The gain

The purchase goes out under the per-transaction cap. Above it, a person decides with the rule in view; past the monthly cap, it is refused.

The flow, side by side

From a need to a signed receipt.

Your system raises the need and places the order; the agent pays it. A person steps in only above the per-transaction cap.

  1. 01Your system

    Need and order

    Your inventory flags the need and your purchasing flow places the order with a supplier you work with. The agent reads supplier, amount, due date and the boleto line.

    PO-0418 · R$ 1,180.00
  2. 02CodeSpar

    Mandate

    The per-transaction cap and the monthly cap are checked before anything is sent. A payment over the monthly cap is refused.

    R$ 3,000.00 per transaction · R$ 20,000.00 a month
  3. 03Payment method

    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.

    −R$ 1,180.00 · boleto
  4. 04CodeSpar · audit trail

    Receipt

    Each paid boleto gets a signed receipt and a ledger entry with the supplier category; the order reference rides in the description.

    rcpt_demo_8a31 · signed

Behind it

Mandate, payment, approvals, receipt.

Three calls from the agent. Everything else is the platform: mandate, payment, approvals, receipt.

Mandate · mnd_demo_prc demo
Authorized byHead of operations
Per-transaction capR$ 3,000.00 · above it a person approves (boleto the agent pays)
Monthly capR$ 20,000.00 / month · above it, refused
PurposeSupplier payments
ExpiryDec 31, 2026
Three paths under the same mandate demo
Happy pathPO-0418 · R$ 1,180 · under the cap → paid by boleto, receipt signed.
ExceptionPO-0421 · R$ 4,200 · above the R$ 3,000 per-transaction cap → waits for approval in the Dashboard; a person approves or refuses.
RefusalA boleto that would take the month past R$ 20,000 → refused before anything is sent. An approval does not lift the monthly cap.
TypeScript · @codespar/sdk 0.16.20SDK example
const session = await new CodeSpar().create("user_0000", { preset: "brazilian" });const 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");// under the cap: paid, rcpt_demo_8a31 · above it: approval_required, waits in the Dashboard

SDK example · demo data · not run on this page

What runs it demo
Mandate and rulesExistsPer-transaction cap and monthly cap, signed by the consumer and checked before anything is sent.Open
PaySandboxSends the payment under the mandate.Open
ApprovalsExistsAbove the per-transaction cap the payment waits in the Dashboard. An organization admin decides; approvals expire in 24 h.Open
Receipt and audit trailExistsA signed receipt for each paid boleto; every governed action in the audit trail.Open
WalletExistsFunds the payment; every debit is a ledger entry with its category.Open

Two ways to pay

Where the order comes from.

Two ways an order forms before the agent pays it. With your own suppliers, your purchasing flow places it. At the stores codespar_shop supports, the agent searches, compares and checks out itself.

Path A · your supplier

Sandbox

Your purchasing flow places the order

The order goes to a supplier you already work with; the agent pays the supplier's boleto under the mandate. Above the per-transaction cap a person approves in the Dashboard.

PO-0418 · boleto · R$ 1,180.00codespar_pay · under the cap → paid→ rcpt_demo_8a31 · signed

What the scene and the demo show. Choosing among your suppliers stays in your purchasing flow.

Path B · a supported store

Sandbox

The agent shops itself

At the stores codespar_shop supports, the agent searches the live catalog, compares offers and starts the store's checkout; the order is paid by Pix under the mandate. Above the per-transaction cap that payment is refused, not held.

codespar_shop · search → compare offerscheckout → ready_for_payment · Pix→ paid under the mandate (auto_pay)

Only the stores codespar_shop supports, not a catalog of your suppliers. Runs in test mode with a test key.

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 paymentSettles in the sandbox with a test key.Sandbox
Payment above the cap approved in the DashboardAn organization admin decides; approvals expire in 24 h.Exists
Choosing the supplier and placing the orderYour purchasing flow, or your agent's own integration with the supplier. CodeSpar does not pick suppliers.Pilot / integration
Buying at a supported storecodespar_shop searches, compares and checks out; the order is paid by Pix under the mandate.Sandbox
Verified approverApprover identity bound to the decision.Rolling out
Reconciliation with PO and invoiceMatching in your ERP; the PO reference rides in the payment description.Illustrative

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.

  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. A purchase orderAny reference the agent can quote: PO number, supplier, amount, the boleto line.
@codespar/sdk 0.16.20SDK example
// 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"

SDK example · demo data · not run on this page

Related use cases

Use caseSandbox

CFO copilot

Pay approved invoices under your approval policy.

Use caseSandbox

API and compute budgets

Agents pay for APIs and compute under a budget.

Use caseSandbox

WhatsApp: Pix payment request in chat

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

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 packaging supplier's boleto for PO-0418"  under the R$ 3,000.00 per-transaction cap · R$ 6,120.00 of R$ 20,000.00 this month  paid · rcpt_demo_8a31 · ledger entry, supplier category

Illustrative · demo data

Autonomous procurement · CodeSpar