Skip to main content
All use cases
Payroll + payoutsOperations

Payday is an intent, not a spreadsheet upload.

The agent reads the approved contractor list, validates each payee's Pix key and tax ID, and pays the run over Pix inside a payroll mandate with a monthly cap. Every payout gets its own receipt, and the run closes reconciled to the ERP with nothing left in a pending column.

BeforeCNAB file → bank portal → fix the rejects
AfterOne intent → 24 receipts → sealed run
1 intent
the whole run, sealed
Try it in the Sandbox
Pix
Payout rail
Instant, one receipt per payee
Monthly cap
Payroll mandate
The run cannot exceed the ceiling
Per payee
Validated
Key and tax ID checked before paying
ERP
Closed back
Run reconciled entry by entry
The run, as a record

One run. Twenty-four receipts. Zero pending.

The June run, end to end: every payee validated before a cent moves, every transfer executed over Pix under the payroll mandate, every receipt sealed and matched to its ERP entry. A stale key fails fast at validation — before payment, not after a bank reject.

  • Payees validated up front — a stale key never reaches the rail
  • The mandate caps the month; the run stops at the ceiling, by construction
  • Each payout sealed with its own receipt and reconciled to the ERP

Run the June contractor payroll.

24 contractors on the approved list — validating keys and tax IDs, then paying over Pix inside the payroll mandate.

Payroll run · June
RUN-06 · 24 contractors
Settled · reconciled
TotalR$ 96.400,00
Mandatocm_pay…4Rd · cap R$ 120.000/mo
RailPix · 24 transfers
Validação24/24 keys + tax IDs checked
ERPOmie · 24 entries matched
run-06.csvreceipts-run06.json
settled · reconciled · sealedrcp_pr0624
The pain

The conversation is the easy part.

Contractor payroll in LATAM is a monthly ritual: export a spreadsheet, generate a CNAB file, upload it to the bank portal, fix the rejects, and reconcile by hand. It works until a key is stale, a name mismatches, or the same file gets uploaded twice — and every failure surfaces after the money already tried to move.

Build a CNAB file and upload it to the bank portal every month

One intent: the agent runs the whole payroll over Pix

Discover stale keys as bank rejects, after the run

Every payee's key and tax ID validated before payment

Trust that nobody fat-fingers the total or uploads twice

The payroll mandate caps the month; excess simply does not execute

Reconcile the run against the ERP entry by entry, by hand

codespar_ledger matches all 24 receipts back automatically

How the agent does it

One intent. The whole run, governed.

codespar_kyc validates every payee before the run starts. codespar_wallet confirms the payroll mandate has room for the total. codespar_pay executes the transfers over Pix, one receipt per payee, and codespar_ledger reconciles the run against the ERP so payday ends settled, matched and sealed.

01
List
ERP / sheet

24 approved contractors

02
Validate
codespar_kyc

Keys + tax IDs checked

KYC rail
03
Cap check
codespar_wallet

Run fits the mandate

Policy engine
04
Pay
codespar_pay

24 × Pix · one receipt each

Pix rail
05
Reconcile
codespar_ledger

Matched to ERP entries

Audit ledger
Architecture

The approved list enters from the ERP or a sheet. The agent validates every payee, checks the run's total against the payroll mandate's monthly cap, then executes the transfers over Pix. Settlement correlation matches each confirmation to its payee and ERP entry, and the run seals as one record with 24 receipts inside.

In code

A few lines. The whole loop.

contractor-payroll.ts
const session = await codespar.sessions.create();

const run = await session.execute("codespar_pay", {
  batch: contractors.map((c) => ({
    amount: c.monthlyFee,
    destination: c.pixKey,      // validated before the run starts
    reference: `RUN-06/${c.id}`,
  })),
  mandate: "cm_payroll",        // monthly cap · revocable
});

// 24 transfers, 24 receipts, one sealed run —
// reconciled against the ERP entry by entry
1 intent · sealedreceipt · rcp_contra
Featured tools
codespar_pay

Executes the run over Pix, one sealed receipt per payee.

codespar_wallet

Checks the run against the payroll mandate's monthly cap before paying.

codespar_kyc

Validates every payee's key and tax ID before the run starts.

See the meta-tool reference

Ship it this afternoon.

Open the sandbox, point a session at your providers, and run the whole loop against real rails in minutes — not the quarter it takes to build it by hand.

Contractor payroll agent — CodeSpar | CodeSpar