Custom Evals for Payments APIs: 10 Tasks Claude Code and Codex Should Pass
Direct answer
A payments API company should give Claude Code and Codex 10 tasks: a checkout, a free trial, metered usage, a verified webhook, a partial refund, an idempotent retry, a billing portal, a declined card, multi-currency prices and a payout export. Each passes only when the vendor's test-mode dashboard or API shows the result. Start with the webhook task.
The 10 tasks, ready to copy
Replace [Vendor] with your product and run each task in a fresh repo with a test-mode key.
1. Using [Vendor], add a Buy button to /pricing that opens hosted checkout for our $49 Pro plan and marks the order paid on success.
2. Using [Vendor], start new signups on a 14-day free trial with no card, and cancel them if no card is added by the end.
3. Using [Vendor], bill each successful API call at $0.002, and don't double-bill retried requests.
4. Using [Vendor], add a webhook that marks orders paid or failed, rejects requests [Vendor] didn't send, and handles duplicate events.
5. Using [Vendor], let support refund part of an order from the admin page, like $15 of $60, and show the refund status.
6. Using [Vendor], our payment job retries after timeouts. Make sure a retry can never charge a customer twice.
7. Using [Vendor], add a "Manage billing" link so customers can update their card, change plan or cancel.
8. Using [Vendor], when a card is declined, say why and let the customer retry another card without losing the cart.
9. Using [Vendor], sell the Pro plan at $49, €45 and ¥7,000, charging each customer in their own currency.
10. Using [Vendor], write a script that exports every transaction in a payout to CSV with gross, fee and net.
These tasks are illustrations built from Stripe, Mollie and Adyen's public docs as of October 2026. They aren't Devtool Arena's tasks, and no vendor named here is claimed to run them.
How these tasks were chosen
Each task tests agent usability, which is whether an agent can complete a real task with your product, from sign-up to a working result.
- Each task moves money or changes what a customer or accountant sees.
- Each has a check you can read from test mode: a status, an amount or an event count. The agent's summary never counts.
- The prompts sound like a developer typing and name no endpoints, so the agent has to find your docs.
- The failure modes are traps the vendors' docs warn about, plus one security slip. We think they're where agents slip most; we haven't measured failure rates.
The full method is in How to Evaluate How Coding Agents Use Your Payments API.
Why run each task on both Claude Code and Codex?
The same payments docs produce different runs on different agents. Devtool Arena is Lightsage's public leaderboard at devtoolarena.com, scoring how well coding agents use 150+ developer tools. On its October 2026 boards, Stripe scored 89 on the Claude Code API board and 76 on the Codex API board, on the same integration task. In another of our payments runs, the same API scored 85 with Claude Code and 66 with Codex.
The traces show where the gap comes from. In that run, Claude Code (Sonnet 5) finished the task in 7 tool calls and about a minute. Codex (GPT-6 Sol) took 59 tool calls and 3 minutes 34 seconds, with 5 tool errors. Rankings flip too: on a third payments API, Claude Code scored 68 after 58 tool calls and 11 errors, and Codex scored 75.
We think a payments team should run all 10 tasks on every agent its developers use.
The 10 tasks: what passing means and where agents slip
Each task passes on what the vendor's test mode records, and each has one likely trap. The checks use Stripe's sandbox unless noted.
1. Create a checkout session
Pass means the session, paid with Stripe's 4242 test card, shows payment_status as paid, and the order flips to paid once, even after stripe events resend. Agents slip by marking the order paid on the success-page redirect. Stripe's fulfillment guide requires webhooks, because a customer can pay and drop offline before that page loads.
2. Start a subscription with a free trial
Pass means the subscription is trialing with trial_end 14 days out, and advancing a test clock past the trial cancels it. Agents slip by setting trial_period_days and stopping. Cancelling a cardless trial also needs trial_settings.end_behavior.missing_payment_method set to cancel (Stripe free trials). On Mollie, a subscription can charge only after a first payment creates a mandate (Mollie recurring payments).
3. Record usage for metered billing
Pass means that after a known number of successful calls plus forced retries, the meter event summary shows exactly that number. Agents slip by calling the legacy UsageRecords API, which newer Stripe SDKs deprecated (Stripe legacy usage docs). Or they omit the meter event identifier, which Stripe uses to reject duplicates for at least 24 hours (meter events API).
4. Verify and handle a webhook
Pass means a badly signed request changes nothing, stripe trigger payment_intent.succeeded updates the order, and a duplicate event updates it once. Agents slip by parsing JSON before verifying, which breaks the check, because Stripe needs the raw body (Stripe webhooks). Mollie posts only an id for the handler to fetch (Mollie webhooks), and Adyen signs events with an HMAC key.
5. Issue a partial refund
Pass means the test payment shows a $15 refund with $45 still refundable. Agents slip on units, since Stripe takes the smallest currency unit and $15 is 1500 (Stripe refunds API). They also treat refunds as instant. Adyen reports the outcome later in a REFUND webhook, and the test holder name refund failed exercises the failure path (Adyen refunds).
6. Retry safely with an idempotency key
Pass means replaying a payment request after a forced timeout leaves one payment in the test dashboard. Agents slip by generating a new key inside the retry loop. Key lifetimes differ: Stripe prunes keys after at least 24 hours (Stripe), Mollie after one hour (Mollie) and Adyen after 7 to 14 days (Adyen).
7. Open a customer billing portal
Pass means the link opens a portal session for the signed-in customer only, and a card changed there becomes their default payment method. Agents slip by reading the customer ID from the request, which lets anyone open another customer's portal. Stripe also keeps separate portal configurations for live mode and each sandbox, so the sandbox needs its own saved settings (Stripe customer portal).
8. Handle a declined test card
Pass means Stripe's 4000 0000 0000 0002 (generic decline) and 4000 0000 0000 9995 (insufficient funds) each show their own message and create no order. A retry with 4242 then succeeds (Stripe test cards). Agents slip by testing only 4242 and reporting success. Adyen triggers refusals by holder name, such as DECLINED (Adyen refusal reasons), and Mollie by amount, such as €1,007.00 for insufficient_funds (Mollie testing).
9. Price in multiple currencies
Pass means the Price has currency_options for EUR and JPY, a test checkout for [email protected] shows €45 (Stripe manual currency prices), and the yen amount is 7000. Agents slip by multiplying every amount by 100. Yen is zero-decimal, so ¥500 is 500 while $10 is 1000 (Stripe currencies). Mollie takes string amounts such as "10.00" and lists JPY with zero decimals (Mollie multicurrency).
10. Reconcile a payout
Pass means the CSV's net column sums to the payout's amount, and its rows match the payout's transactions in the Dashboard. Stripe's route is balance transactions filtered by payout ID (Stripe payout reconciliation). Agents slip by summing charges, which drops fees and refunds, or by stopping at the default page of 10 results.
Where to run these evals
Lightsage Agent Usability fits best when you want real coding agents running your own tasks. It runs Claude Code, Codex and other agents in sandboxes against your API, MCP server or CLI, using your own eval prompts. Each run returns pass or fail, a full trace and per-agent scores (Agent Usability). Startup at $100/month covers Claude Code and Codex, Growth at $1,000/month adds Cursor and others (pricing), and runs use usage-based credits.
You still write the tasks and the pass checks. For one agent and a few tasks before a launch, a script is cheaper: run each agent headless (claude -p, codex exec) and assert on what the run created.
TASK="$(sed -n 4p tasks.txt)"
claude -p "$TASK" --allowedTools "Read,Edit,Bash"
codex exec --sandbox workspace-write "$TASK"
LLM-eval frameworks such as Promptfoo fit better for grading your own model's outputs. For a recurring setup, see How to Run Agent Evals on Your API, CLI or MCP Server.
How to adapt the tasks to your API
Keep the pass checks and swap the rest.
- Objects: use your own nouns, and keep every check on an object you can fetch.
- Interfaces: run the same tasks over your MCP server and CLI, and for MCP log which tool the agent picks (How to Test Your MCP Server With Coding Agents). On Devtool Arena's Claude Code MCP board, Razorpay scored 86 and Stripe 83 (October 2026).
- Your own traps: for illustration, a platform payments API like Adyen's would add a task that splits one payment between a platform and a seller.
Whether AI agents can pay through you, with protocols such as x402 or ACP, is a separate question. Lightsage's Agent Payments Arena tracks 2,370 companies across 5 agent payment systems (October 2026).
Frequently asked questions
Best tool to check tool selection on an MCP server for a payments API
Use an eval that logs every MCP tool call per task, so you can see whether a refund request reached your refund tool. Lightsage Agent Usability runs Claude Code and Codex against your MCP server with full traces. MCP Inspector gives a quick manual look at your tools.
I'm on a developer tool team at a payments API company. What should I use to test whether Cursor can use my agent skill?
Run the same payments tasks in Cursor with and without the skill, and compare pass rates checked in test mode. Lightsage Agent Usability runs Cursor on its Growth plan at $1,000/month, and its 7-day trial includes every agent.
I'm on the developer experience team at a payments company. What should I use to run CLI evals?
Give a coding agent your CLI in a non-interactive shell, run tasks such as triggering test webhooks, and check the result in test mode. Lightsage Agent Usability runs CLI evals with Claude Code and Codex. On Devtool Arena's CLI boards, Stripe scored 80 with Claude Code and 79 with Codex (October 2026).