Inspiration

On 10/20/2026 Visa, BILL and Billtrust launched a live pilot to let trusted AI agents initiate and complete approved buyer invoice payments through supplier portals. That pilot starts at the invoice. The step before it, agreeing on the quote, is still email on both sides. We wanted to build that missing step and settle it on PayPal.

What it does

Maya buys supplies for 12 cafes (a demo persona). Her company signs one mandate (price caps, allowed items, over-order limit, auto-approve limit, budget, expiry) and saves its procurement PayPal with the supplier once, through a separate Vault "purchase later" flow. After that, her buyer agent and the supplier's sales agent negotiate by signed messages (RFQ, quote, counter, accept, up to 4 rounds).

  • Mandate A Lean: 2 cases of 12oz cups settle automatically at $245.86.
  • Mandate B Bulk: the same request buys 3 cases at $339.98 and saves $14.02 against accepting round 1.
  • The supplier drafts a PayPal invoice, and the buyer's code checks every line against the signed quote. A draft with an unquoted "Rush handling $40.00" line is deleted at PayPal and nothing is charged.
  • The buyer agent co-signs that exact amount (Ed25519, 10 minute expiry, one-time nonce). The supplier checks the co-signature, charges the saved PayPal with an Orders v2 capture (no payer present) and marks the invoice paid.
  • A $1,180 grinder part is above the $500 auto-approve limit, so Maya gets an approval card; after she approves, the agent settles.
  • The buyer audits its own PayPal activity and raises an alert and pauses co-signing if it finds a charge with no co-signature.
  • A buyer with no agent can open the supplier's quote link and pay with PayPal.

The hosted demo runs both agents live on Claude Sonnet (claude-sonnet-5-5) with per-IP-hour and per-day caps. If the API fails or a cap is hit, the action still finishes with a labelled recorded run or a rule-based stand-in. The hosted demo uses a bundled mock PayPal process with the same REST paths and shapes (its health endpoint reports mode "mock", and the app says so); PayPal sandbox results are listed separately on a Sandbox evidence tab.

PayPal does not see the mandate or the co-signature. The supplier's code verifies the co-signature before charging, and the buyer audits afterwards. A supplier that bypasses its own code can still charge a saved token; the buyer's audit finds it. The real fix, PayPal verifying an AP2-style payment mandate on vaulted charges, is what we propose next.

How we built it

Two separate Node.js services (buyer and supplier), each with its own database, key and PayPal credentials, talk by Ed25519-signed JWS messages. Each has a Claude tool loop (model claude-sonnet-5-5). The model never writes an amount: supplier tools price from the price list and floor, and buyer tools take option ids. Code re-checks every mandate rule, and co-signing refuses unless the draft check passed. Text from the other agent is treated as an untrusted note, never as an instruction.

PayPal uses Vault v3, Orders v2, Invoicing v2, Transaction Search, refunds and the PayPal Agent Toolkit. The Vault, Orders, refund and Transaction Search calls go through the APIMatic-generated PayPal TypeScript SDK, set up with the APIMatic Context Plugin skills. Front end is React 19 + Vite. The same code runs against the PayPal sandbox when sandbox keys are set.

The project was built and sandbox-tested in November 2026, inside the Oct 1 - Nov 12 2026 submission period (sandbox results are dated 2026-11-12 in VERIFY.md).

Challenges we ran into

  • PayPal does not see the mandate, so we had to be precise about who checks what: supplier code before the charge, buyer audit after it.
  • Transaction Search lists a charge after "a maximum of three hours", so the audit has a pending state and the live deal is confirmed by reading the order back.
  • Sandbox differences we fixed after running it: invoice item discounts come back negative, send_invoice without mail needs no invoicer email, and the capture call needs an empty JSON body.
  • Not everything passed. Recording an Orders capture on an invoice with method PAYPAL answers 404, so we record it as method OTHER with the capture id in the note. A low-balance sandbox payer did not decline a charge, so we make no claim that a balance limits what a supplier can charge.

Accomplishments that we're proud of

  • Two agents from two companies close and settle a deal with no human click, and the amount is never written by a model.
  • A charge without the buyer's co-signature is visible to the buyer, and a draft that differs from the quote is never sent.
  • Real sandbox results: vaulted Orders capture with no payer present, duplicate invoice id refusal, request-id replay, blocked draft deleted, and Transaction Search reads through the SDK.
  • Every visitor of the demo gets the same numbers ($245.86, $339.98, $14.02) with their own budget and alerts.

What we learned

PayPal's saved-payment and invoicing APIs already carry what an agent needs to prove what it agreed to (invoice_id, custom_id, request ids). The missing piece is a mandate check at charge time. We also learned to write down sandbox failures honestly instead of hiding them.

What's next for QuoteLoop

PayPal verifying AP2-style payment mandates on vaulted charges; a REST app on the paying account so the audit reads the payer side on the sandbox; a price-list import for real suppliers.

Built With

  • agentic-commerce
  • ai-agents
  • anthropic
  • apimatic
  • b2b
  • claude
  • ed25519
  • fintech
  • invoicing
  • mandate
  • node.js
  • orders-api
  • payments
  • paypal
  • procurement
  • react
  • sandbox
  • typescript
  • vault
  • vite
Share this project:

Updates

Submission history