Quickstart
PayPal's agent toolkit supports the integration of PayPal APIs into agentic workflows using OpenAI's Agents SDK, Vercel's AI SDK, Model Context Protocol (MCP), LangChain, and CrewAI.
This guide provides a step-by-step process for setting up the server, building a basic conversational front-end interface using Next.js, and testing the integration. It also includes best practices to follow for secure and efficient usage.
Set up the server
Complete these steps to set up the server and begin your integration.
Installation
Ensure that Node.js version 18 or later is installed, then run the following command to install PayPal's agent toolkit and other necessary packages.
Configuration
Create a local environment (.env.local
) file in your project root, and add your PayPal API and OpenAI credentials.
Initialization
Initialize the agent toolkit.
Get OpenAI API keys
Complete the following steps to generate and store your OpenAI keys to use in your integration with PayPal's agent toolkit.
Best practices
To have the best integration experience, follow these tips:
Sandbox environment: Always use the sandbox environment for initial testing to avoid real transactions.
API keys: Keep client ID, client secret, and API keys secure. Do not hard-code them in your source files.
Environment variables: Use environment variables to manage sensitive data.
Error handling: Implement robust error handling to ensure reliable integration.
System prompts: Use well-defined system prompts to control the behavior of the agent effectively.
Additional resources
For more information about the concepts covered here, see these additional documents:
Was this helpful?