Coming soon. The Upcharge API, SDKs and MCP server aren't live yet. This is a preview of what we're building, and paths and fields may change. Leave your number for early access
Priya's AI agent wrote most of her checkout. It couldn't promise every surcharge was legal. We can.
Lovable, Cursor, Claude Code, Replit: an agent can build a booking checkout in an afternoon, and it can find out which states allow a surcharge. What it can't do is make sure a surcharge never lands on a debit card or goes over a cap. That takes a compliance layer that checks every payment. Give it our SDK or MCP server and that's what it gets. Pick an example to see what that sounds like.
Add a few lines to your agent's config
This is the block Priya pasted into Cursor. After that, her agent could check any payment, quote a surcharge and write the disclosure on its own.
- upcharge.get_rulesState and card brand rules, current
- upcharge.quoteExact surcharge for a card and amount
- upcharge.disclosureSign and checkout copy for the location
- upcharge.create_paymentCharge with the surcharge itemized
- upcharge.auditWhy a surcharge was or wasn't applied
{
"mcpServers": {
"upcharge": {
"command": "npx",
"args": ["-y", "@upcharge/mcp"],
"env": { "UPCHARGE_KEY": "sk_test_..." }
}
}
}The prompt Priya used
Copy it as is. It tells the agent what a legal checkout needs, so it doesn't have to work it out.
Add credit card surcharging to this app using Upcharge. - Use @upcharge/sdk (or the upcharge MCP tools). - Don't guess whether a card is credit or debit. Quote every card through Upcharge after it's entered, and only add a surcharge when the quote says it's eligible. - Show the surcharge and total before the Pay button. - Use the disclosure text Upcharge returns for the merchant's state. - Itemize the surcharge on the receipt.
What happens when the agent gets it wrong
Agents make mistakes. These are the three Priya worried about, and why none of them made it to a real customer.
It tries to add a surcharge to a debit card
The API refuses. Same if it asks for more than the cap allows. The checkout it builds can't charge an illegal fee, because we won't process one.
It wrote code for last year's law
Doesn't matter. The rules live on our side, and when a state changes its law, the quote changes with it. The agent's code stays the same.
It runs a thousand test charges at 2 a.m.
Fine. With a test key nothing touches real money, and there are test cards for every state and card type.
Building with an agent? We'll send you a sandbox key
Leave your number and tell us what you're building. Point your agent at the key and the docs and see how far it gets.