PayPal announces its Agent Toolkit in late April 2025, it is a remarkable step in this Agentic Era, allowing developers to integrate PayPal service or create payment workflow using natural language, making operations more intuitive.
As it is a beginning, I have tried it out with using NodeJS as the programming language and share it in form of a video tutorial:
Video url: https://youtu.be/SXngYSKAJQE
Github Repo: https://github.com/gordonchanhk/PayPal-Agent-Toolkit-Demo
I base on the example code in https://paypal.ai > Agent Toolkit > Docs – https://developer.paypal.com/tools/agent-toolkit/ and walk through the coding from ground. Here are couple highlights, which can act as hint to anyone who encountered trouble when trying out the Agent Toolkit:
- The example code doesn’t define
getModel()andgenerateText()clearly. You shall need to define the function definition forgetModel(), whilegenerateText()is a AI SDK function. - The Vercel AI SDK example code doesn’t config the Agent Toolkit to use Sandbox mode, you shall need to add
'context': {'sandbox': true}under the configuration node upon instantizing the Agent Toolkit instance. - For some instance, you may need to use a custom AI endpoint and different API Key environment variable, use
createOpenAI()instead ofopenai()allows you to passapiKeyandbaseUrl.
My example is just showcasing the most base example. It uses terminal instead of building an interactive webpage with SPA. As a developer you shall define your way how to let user to enter the command / the prompt, and shows the response in a way you wish.
Look forward there are more showcase showing how to use PayPal Agent Toolkit.
To learn more about PayPal’s AI related info, check out https://paypal.ai