Skip to main content

Pay a vendor

Qopper isn’t only about agents that get paid. The other half is a business that pays vendors. A company funds a Qopper balance in USDC and pays international suppliers with the full accounts-payable flow: invoice → verify → quote → approve → execute → reconcile. Just like the agent side, the business signs in from the console; everything is owner-scoped to your account.

The flow

Every step is its own endpoint, so you can show the CFO a quote and get the human approval before any money moves.

1. Fund a company account

Grab businessId, then credit it:
The credit is idempotent — resending the same idempotencyKey does not double-credit.

2. On-board a vendor

A vendor is either a bank account (receiving local currency, e.g. COP) or a wallet (receiving USDC). Qopper detects a change in the vendor’s bank details and bumps bankRev, forcing re-verification before the next payment.

3. Create and verify an invoice

The AP agent checks duplicates, an un-verified vendor, a changed bank, and invalid amounts, returning a riskFlags array. With no risks the invoice goes to verified.

4. Quote, approve, execute

The routing engine

The quote is produced by integrations/routing-engine.js. Rails are adapters; today there are two:
  • on-chain (onchain) — USDC straight to a vendor wallet. No FX, no fee to the vendor, minutes.
  • off-ramp (offramp) — USDC → local currency to a bank account (COP, MXN, …). Applies an FX spread and a fee.
The router scores each candidate by cost, speed and reliability, and returns the best. Configure FX and corridors with QOPPER_FX_USD_COP, QOPPER_OFFRAMP_CORRIDORS (JSON) and the real payout provider with QOPPER_OFFRAMP_EXECUTOR_URL.

Mass payments

Pay to N recipients in one operation — the company is debited once for the total, and the rail is chain.batchSendUsdc (sequential transfers from the qopper-treasury account).
List them: GET /api/business/:id/payouts/batches. The batch is idempotent by idempotencyKey; if the rail fails, the company balance is refunded and the batch is marked failed.

Fund with Onramp (fiat → USDC)

Top up real USDC. The server mints a Coinbase session token (the CDP secret key never reaches the browser) and returns a single-use onrampUrl you open in a new tab.
After the purchase, claim the on-chain USDC into the internal balance (idempotent by delta):
Agent wallets (Product B) fund the same way: POST /agents/:id/onramp/session — the deposit watcher credits the agent balance automatically once the USDC arrives.
For demos, set QOPPER_ONRAMP_SANDBOX=1: the purchase always succeeds and your card is never charged.

Invoice customers (Invoicing / AR)

The same business can also get paid: issue an invoice to a customer, share the link, and the money lands in your balance when they pay.
Share paymentUrl. The customer pays either from an agent wallet (authenticated with its qp_sk_) or on-chain with USDC (x402):
On payment the invoice goes to paid and businesses.balance_minor is credited — idempotently (an invoice only pays once). List them with GET /api/business/:id/invoicing.