Skip to main content

Use case · Supplier payments

Agents buy from suppliers. Your rules decide.

The agent proposes the payment. Your rules decide if it clears, waits or stops.

Test keys are free.

Agent run · purchase orderdemo

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

Purchase orderPO-0418 · packaging · R$ 1,180.00 · due in 3 daysopen
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 · anyone can verifysigned
Next order, above the capPO-0421 · R$ 4,200.00 · waits for approval in the Dashboardwaiting
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

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.

  1. 01

    Order

    A purchase order comes in from procurement. The agent reads supplier, amount, due date and the boleto line.

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

    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. 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.

    −R$ 1,180.00 · boleto
  4. 04

    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

The parts that run it.

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

Mandate and rulesPer-transaction cap and monthly cap, signed by the consumer and checked before anything is sent.Open
PaySends the payment under the mandate.Open
ApprovalsAbove the per-transaction cap the payment waits in the Dashboard. An organization admin decides; approvals expire in 24 h.Open
Receipt and audit trailA signed receipt for each paid boleto; every governed action in the audit trail.Open
WalletFunds the payment; every debit is a ledger entry with its category.Open
TypeScript · @codespar/sdk 0.16.11real SDK
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

Sandbox run · demo data

Mandate · mnd_demo_prc demo
Per-transaction capR$ 3,000.00 · above it a person approves
Monthly capR$ 20,000.00 / month
PurposeSupplier payments
ExpiryDec 31, 2026

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
Supplier 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
Supplier boleto R$ 1,180.00Under the cap · test payment · signed receipt−R$ 1,180.00paid
Simulated result: waiting for approval: above the per-transaction cap.
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

Test payment, no real supplier.

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.11real SDK
// 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

Related use cases

Use case

Compute and API spend

Pay per API call under a budget.

Use case

Supplier payments

Supplier invoices paid under a mandate.

Use case

WhatsApp assistant

Checkout with a Pix charge inside the chat.

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

Sandbox run · demo data

Autonomous procurement · CodeSpar