Inspiration Are you against replacing the archaic, paper-heavy $2.5 trillion trade finance industry with programmable AI? We asked cross-border small businesses if they were ready to give up on international sourcing because of prohibitive $1,500 bank letter-of-credit fees. Their answer was a resounding no. Yet, buyers refuse blind upfront wires, and suppliers refuse risky net-30 terms. This trust vacuum inspired the Agentic Clearing Network (ACN). We realized PayPal didn’t have to just be a checkout button—it could serve as an autonomous clearing house.

What it does ACN replaces expensive trade finance with milestone-gated micro-letters-of-credit (mLoC) backed by PayPal Sandbox APIs. A buyer inputs a natural-language procurement request. Our Procurement Agent negotiates and converts this into a JSON mLoC contract, locking funds via PayPal Orders v2 (AUTHORIZE). Our autonomous Fulfillment Agent then tracks DHL/FedEx telemetry via the PayPal Tracking API. Once delivery is cryptographically verified, the agent automatically executes multi-tranche payouts to the supplier.

How we built it We orchestrated a multi-agent state machine using the PayPal Agent Toolkit. Would it be a ridiculous idea to manage complex financial workflows via a chat interface? Yes—so we built an institutional-grade command center instead. We used Next.js and AG Grid to render a live clearing blotter, streaming escrow state transitions and hierarchical webhook payloads. To guarantee our AI never hallucinated critical financial payloads, we generated strictly typed, contract-validated SDK bindings using the APIMatic Context Plugin.

Challenges we ran into Is it unreasonable to expect an AI to flawlessly manage escrow states on day one? Our agents initially struggled with deterministic execution, occasionally attempting to capture funds before authorization cleared. Aligning the PayPal Orders and Payouts logic with unpredictable real-world shipping anomalies required us to build a robust, idempotent fallback loop to prevent duplicate transactions.

Accomplishments that we're proud of We successfully eliminated the human bottleneck in B2B clearing. We are especially proud of our AI Dispute Arbiter: if a shipment hits a CUSTOMS_HOLD, the system doesn't break. Instead, it dynamically calculates an SLA penalty and proposes an autonomous split-settlement using PayPal Refund and Payout APIs.

What we learned We learned that agentic commerce demands institutional-grade transparency. Tools like AG Grid are mandatory to give human auditors the confidence to trust AI.

What's next for AGENTIC CLEARING NETWORK (ACN) Have you given up on the idea that global B2B trade can be completely frictionless? We haven't. Next, we will integrate PYUSD for programmable cross-border settlement, routing idle escrow float into yield-bearing vaults so capital works while shipments transit.

Built With

  • ag-grid
  • anthropic
  • apimatic
  • artificial-intelligence
  • autonomous-agents
  • b2b
  • escrow
  • fastapi
  • fintech
  • langchain
  • llm
  • model-context-protocol
  • next.js
  • openai
  • paypal
  • paypal-agent-toolkit
  • python
  • pyusd
  • railway
  • react
  • rust
  • tailwind-css
  • typescript
  • vercel
Share this project:

Updates

Submission history