Use the PayPal Agent Toolkit to expose PayPal payment operations as LLM tool calls so your AI agent can create, capture, and refund orders via function calling

domain: developer.paypal.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install the PayPal Agent Toolkit from npm or PyPI (the toolkit is open-source and published by PayPal); initialize it with your PayPal client ID and secret from the PayPal Developer Dashboard.
  2. Register the toolkit's tool definitions with your LLM framework (OpenAI Agents SDK, LangChain, or CrewAI); the toolkit exposes PayPal APIs as structured function-call schemas including create_order, capture_payment, create_refund, and get_order_details.
  3. When the agent needs to initiate a purchase, call create_order with amount, currency, and item details; PayPal returns an order ID and an approval URL — for agent-autonomous flows using pre-authorized payment methods, approval happens without redirecting the user.
  4. After the buyer's payment method is confirmed, call capture_payment with the order ID to settle the transaction; handle INSTRUMENT_DECLINED and PAYER_ACTION_REQUIRED errors explicitly as they require user intervention.
  5. For returns, call create_refund with the capture ID and amount; PayPal supports partial refunds — specify the amount field to refund a subset of the capture total.

Known gotchas

Related routes

Integrate PayPal payment capabilities into a LangChain or CrewAI agent using the PayPal Agent Toolkit
pypi.org · 5 steps · unrated
Create a PayPal order and capture payment (Checkout v2)
paypal.com · 4 steps · unrated
Initiate an agent-driven payment and generate a verifiable receipt using Catena Agent Commerce Kit ACK-Pay
agentcommercekit.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans