What the agent does
The run reads PayPal through PayPal's remote MCP server, https://mcp.paypal.com/mcp, the PayPal entry in the Rush connector catalog. Connect it once with POST /me/connections {"type": "mcp", "name": "paypal", "url": "https://mcp.paypal.com/mcp", "auth": {"mode": "oauth"}} and sign in to the PayPal business account from the authorize_url. The server is the one PayPal publishes from its paypal/agent-toolkit repository, and its reporting tool is list_transactions.
The agent calls list_transactions for the first to the last day of the previous calendar month and pages through every result. Each transaction carries its gross amount, the PayPal fee, a status and an event type, and where the payment came from a cart, the item lines. The agent keeps completed payments as sales and refunds as refunds, and sets aside pending, reversed and held transactions in their own count so they do not inflate the month.
With the month in the sandbox, it adds up gross sales, refunds, fees and net, then splits sales by ISO week. For the top 10 it uses item names where the transactions carry them; where many payments have no item detail, such as money sent directly or a button with no cart, it says what share of sales had no item and ranks only what it can. Invoices paid through PayPal Invoicing appear as transactions too, and list_invoices can name the invoice when a line needs it.
Disputes opened during the month are read with list_disputes and listed at the end, since an open dispute is money that may still leave. The agent writes sales.md and transactions.csv and calls none of the tools that change the account: no create_refund, send_invoice or accept_dispute_claim.
Start it with one API call
POST https://api.prix.dev/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Use the PayPal connection to read every transaction from last calendar month. Write sales.md with total gross sales, refunds, PayPal fees and net, sales by week, the top 10 products or items by revenue (say what share of sales had no item detail), a count of pending, reversed or held transactions kept out of the totals, and disputes opened in the month. Write transactions.csv with one row per transaction: date, transaction id, type, status, gross, fee, net, currency, item names. Read only: no refunds, invoices or dispute actions.",
"connections": [
"paypal"
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.prix.dev/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
The session returns two artifacts. sales.md is one page: the month's gross, refunds, fees and net at the top, a week-by-week table, the top 10 items with revenue and units, the held and pending count, and any open disputes with their amounts. transactions.csv has every transaction behind those numbers, one row each, so an accountant can rebuild any total with a pivot table.
Check the currency line first: a seller paid in more than one currency gets a total per currency, and the agent does not convert between them. Then compare net with the month's PayPal statement for the same dates; a gap usually means a transaction type such as a currency conversion or a transfer to your bank, which the agent lists separately rather than counting as a sale. Every list_transactions page it read is kept in the transcript.
Run it on every first of the month
A Project automation on a monthly schedule can send the same request on the first of each month, which gives a report in the same shape every time. A cron job on your own server works too; give it an Idempotency-Key with the month so a retry does not start a second report.
When run.completed reaches your webhook, your server can download both artifacts from the session and email them or file them with the month's books.
The use case this job follows, with its automation and trigger: Produce a report or file, no repo.
Why run it on Rush?
PayPal's activity export gives you rows, not a report, and turning it into sales, refunds and top items takes a spreadsheet session every month. The agent reads the same transactions through PayPal's own server, does the sums in its sandbox, and keeps the CSV beside the summary so the numbers can be checked.
It runs without anyone downloading a file or leaving a laptop open, the prompt keeps it read only, and the transcript shows every call it made. A bookkeeper with several PayPal clients can start one session per client at the same time, each reading only its own connection.
Frequently asked questions
Does it include fees and refunds?
Yes. Fees come from each transaction's fee amount and refunds from refund transactions in the month. The report shows gross, refunds, fees and net separately so they can be matched to your statement.
What if my sales are in more than one currency?
The report gives totals per currency and does not convert. Ask in a follow-up for a converted total at a rate you name if you need one.
Can I try it on a PayPal sandbox account first?
PayPal runs a separate sandbox MCP server at https://mcp.sandbox.paypal.com. Connect that URL under another name and name it on the run to test against sandbox data.
Can it change anything in PayPal?
The server has tools that refund and send invoices, so the prompt says read only. The transcript lists every tool the agent called, which lets you confirm it used only reading tools.