
The PayPal Agent Toolkit enables popular agent frameworks including OpenAI's Agent SDK, LangChain, V
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.
·
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.
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 detailsget_order: Retrieve the details of an orderpay_order: Process payment for an authorized ordercreate_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 disputesget_dispute: Retrieve detailed information of a specific disputeaccept_dispute_claim: Accept a dispute claimShipment Tracking
create_shipment_tracking: Create a shipment tracking recordget_shipment_tracking: Retrieve shipment tracking informationupdate_shipment_tracking: Update shipment tracking informationCatalog Management
create_product: Create a new product in the PayPal cataloglist_products: List products with optional pagination and filteringshow_product_details: Retrieve details of a specific productSubscription Management
create_subscription_plan: Create a new subscription planlist_subscription_plans: List subscription plansshow_subscription_plan_details: Retrieve details of a specific subscription plancreate_subscription: Create a new subscriptionshow_subscription_details: Retrieve details of a specific subscriptionupdate_subscription: update an existing subscriptioncancel_subscription: Cancel an active subscriptionReporting and Insights
list_transactions: List transactions with optional pagination and filteringget_merchant_insights: Retrieve business intelligence metrics and analytics for a merchantYou 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-toolkitThe 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
import { PayPalAgentToolkit } from '@paypal/agent-toolkit/ai-sdk';
const paypalToolkit = new PayPalAgentToolkit({
clientId: process.env.PAYPAL_CLIENT_ID,
clientSecret: process.env.PAYPAL_CLIENT_SECRET,
configuration: {
actions: {
invoices: {
create: true,
createRecurringSeries: true,
list: true,
send: true,
sendReminder: true,
cancel: true,
delete: true,
generateQRC: true,
generateInvoiceNumber: true,
search: true,
update: true,
cancelReminders: true,
recordPayment: true,
recordRefund: true,
createConditionalRules: true,
},
products: { create: true, list: true, update: true },
subscriptionPlans: { create: true, list: true, show: true },
shipment: { create: true, show: true, cancel: true },
orders: { create: true, get: true },
disputes: { list: true, get: true },
},
},
});To use sandbox mode, add context within your configuration.
configuration: {
context: {
sandbox: true,
}
}import { PayPalWorkflows, ALL_TOOLS_ENABLED } from '@paypal/agent-toolkit/ai-sdk';
const paypalWorkflows = new PayPalWorkflows({
clientId: process.env.PAYPAL_CLIENT_ID,
clientSecret: process.env.PAYPAL_CLIENT_SECRET,
configuration: {
actions: ALL_TOOLS_ENABLED,
},
});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.`,
});
The following environment variables can be used:
PAYPAL_ACCESS_TOKEN: Your PayPal Access TokenPAYPAL_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.
Create a PayPal Developer Account:
Access Your Credentials:
Create or View an App:
Retrieve Credentials:
curl -v https://api-m.sandbox.paypal.com/v1/oauth2/token \\
-H \"Accept: application/json\" \\
-H \"Accept-Language: en_US\" \\
-u \"CLIENT_ID:CLIENT_SECRET\" \\
-d \"grant_type=client_credentials\"Replace CLIENT_ID and CLIENT_SECRET with your actual credentials. For production, use https://api-m.paypal.com instead of the sandbox URL.
https://api-m.sandbox.paypal.com/v1/oauth2/tokengrant_type with value client_credentialsA successful response will look like:
{
"scope": "...",
"access_token": "Your Access Token",
"token_type": "Bearer",
"app_id": "APP-80W284485P519543T",
"expires_in": 32400,
"nonce": "..."
}Copy the access_token value for use in your Claude Desktop integration.
Once you have your access token, update the PAYPAL_ACCESS_TOKEN value in your Claude Desktop connector configuration:
{
"env": {
"PAYPAL_ACCESS_TOKEN": "YOUR_NEW_ACCESS_TOKEN",
"PAYPAL_ENVIRONMENT": "SANDBOX"
}
}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.
This repo does not document an install step we could read. Check the README on GitHub.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/paypal-agent-toolkit to learn what the "PayPal Agent Toolkit" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
This server doesn't publish a machine-readable tool manifest, and it doesn't expose a public endpoint we could ask. Connect the server locally to see what it exposes.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/paypal-agent-toolkit)Let AI agents work with Stripe payments, customers and invoices
v1.8.0Release 1.8.0Release notesv1.7.0Release 1.7.0Release notesConnect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "paypal-agent-toolkit" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
Let AI agents work with Stripe payments, customers and invoices
Payments & Commerce
One email a week. New agents, MCP servers and skills, and what is actually getting traction.