The PayPal Agent Toolkit enables popular agent frameworks including OpenAI's Agent SDK, LangChain, Vercel's AI SDK, and Model Context Protocol (MCP) to integrate with PayPal APIs through function calling. It includes support for TypeScript and is built on top of PayPal APIs and the PayPal SDKs.
Available tools
The PayPal Agent toolkit provides the following tools:
Invoices
create_invoice: Create a new invoice in the PayPal system, including recipient billing details, line items, an invoice note, a custom color theme, an optional shipping cost, and an option to enable PAY_BY_BANK as a payment method
list_invoices: List invoices with optional pagination and filtering
get_invoice: Retrieve details of a specific invoice
send_invoice: Send an invoice to recipients
send_invoice_reminder: Send a reminder for an existing invoice
cancel_sent_invoice: Cancel a sent invoice
generate_invoice_qr_code: Generate a QR code for an invoice
delete_invoice: Permanently delete a draft or scheduled invoice
generate_invoice_number: Generate the next invoice number available to the merchant
search_invoicing: Search for invoices or recurring invoice series
update_invoicing: Update an existing invoice or recurring invoice series (full-replacement)
cancel_invoice_auto_reminder: Cancel all scheduled automatic reminders for an invoice
record_payment_for_invoice: Record an external or manual payment against an invoice
record_refund_for_invoice: Record a refund against an invoice
create_conditional_rules_for_invoice: Create conditional rules for an invoice, such as an early payment discount or automatic cancellation date
create_recurring_series: Create a recurring invoice series that automatically generates and sends invoices on a schedule
activate_recurring_series: Activate a draft recurring invoice series
get_recurring_series: Retrieve details of a specific recurring invoice series
cancel_recurring_series: Cancel an active recurring invoice series
delete_recurring_series: Delete a draft recurring invoice series
Payments
create_order: Create an order in PayPal system based on provided details
get_order: Retrieve the details of an order
pay_order: Process payment for an authorized order
create_refund: Process a refund for a captured payment.
get_refund: Get the details for a specific refund.
Dispute Management
list_disputes: Retrieve a summary of all open disputes
get_dispute: Retrieve detailed information of a specific dispute
accept_dispute_claim: Accept a dispute claim
Shipment Tracking
create_shipment_tracking: Create a shipment tracking record
get_shipment_tracking: Retrieve shipment tracking information
update_shipment_tracking: Update shipment tracking information
Catalog Management
create_product: Create a new product in the PayPal catalog
list_products: List products with optional pagination and filtering
show_product_details: Retrieve details of a specific product
Subscription Management
create_subscription_plan: Create a new subscription plan
list_subscription_plans: List subscription plans
show_subscription_plan_details: Retrieve details of a specific subscription plan
create_subscription: Create a new subscription
show_subscription_details: Retrieve details of a specific subscription
update_subscription: update an existing subscription
cancel_subscription: Cancel an active subscription
Reporting and Insights
list_transactions: List transactions with optional pagination and filtering
get_merchant_insights: Retrieve business intelligence metrics and analytics for a merchant
TypeScript
Installation
You don't need this source code unless you want to modify the package. If you just
want to use the package run:
npm install @paypal/agent-toolkit
Requirements
Node 18+
Usage
The library needs to be configured with your account's client id and secret which is available in your PayPal Developer Dashboard.
The toolkit works with Vercel's AI SDK and can be passed as a list of tools. For more details, refer our examples
const llm: LanguageModelV1 = getModel(); // The model to be used with ai-sdk
const { text: response } = await generateText({
model: llm,
tools: paypalToolkit.getTools(),
maxSteps: 10,
prompt: `Create an order for $50 for custom handcrafted item and get the payment link.`,
});
Environment Variables
The following environment variables can be used:
PAYPAL_ACCESS_TOKEN: Your PayPal Access Token
PAYPAL_ENVIRONMENT: Set to SANDBOX for sandbox mode, PRODUCTION for production (defaults to SANDBOX mode)
This guide explains how to generate an access token for PayPal API integration, including how to find your client ID and client secret.
Implement token refresh logic to handle token expiration
Use environment-specific tokens (sandbox for testing, production for real transactions)
Avoid hardcoding tokens in application code
Disclaimer
AI-generated content may be inaccurate or incomplete. Users are responsible for independently verifying any information before relying on it. PayPal makes no guarantees regarding output accuracy and is not liable for any decisions, actions, or consequences resulting from its use.
At a glance
Category
Coding
Pricing model
Free
Best for
ai-agents, mcp-server, payments
What is PayPal Agent Toolkit? PayPal Agent Toolkit is a coding tool listed on Scriptiii AI Tools. PayPal toolkit for integrating PayPal APIs into agent frameworks and MCP clients. Pricing: Free. Free to use. Best for: ai-agents, mcp-server, payments.
Questions & answers
Everything you need to know about PayPal Agent Toolkit
What is PayPal Agent Toolkit?
PayPal Agent Toolkit is a coding tool. PayPal toolkit for integrating PayPal APIs into agent frameworks and MCP clients.
What does PayPal Agent Toolkit cost?
Free. Free to use.
What is PayPal Agent Toolkit best for?
ai-agents, mcp-server, payments. It is filed under Coding.