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
API reference
Everything the API does, in roughly the order you'll need it. It works like Stripe, with one difference: we don't charge the card right away. Our card fields turn the card into a token. You ask for a quote, we tell you if the card is credit or debit and what the surcharge is, and nothing is charged until you confirm the payment. It's REST with JSON in and out, every amount is in cents, and it's in preview, so names may still change.
Authentication
Send your secret key as a bearer token. Test keys start with sk_test_ and only touch the sandbox. Live keys start with sk_live_. Base URL is https://api.upchargepayments.com/v1.
Authorization: Bearer sk_test_51Hx... Idempotency-Key: 6f1c2b7e-checkout-1042
Send an Idempotency-Key on every POST. Retrying with the same key returns the first result instead of charging twice.
Upcharge is PCI DSS compliant through our parent company, Carpay. Send the token from our card fields, never raw card numbers.
Tells you whether the card is credit, debit or prepaid, whether a surcharge applies at this merchant, how much it is and what to show the customer. Nothing is charged. Quotes last 15 minutes.
curl https://api.upchargepayments.com/v1/surcharge/quote \ -H "Authorization: Bearer $UPCHARGE_KEY" \ -d amount=100000 \ -d payment_method=pm_7Rk2Qx \ -d merchant_state=NY
{
"id": "qt_8Fq2mX",
"eligible": true,
"card_type": "credit",
"rate": 0.0289,
"surcharge": 2890,
"total": 102890,
"rule": "NY: at cost, dollars-and-cents display",
"disclosure": "Credit price $1,028.90. Debit or cash $1,000.00."
}When eligible is false, reason says why: debit_card, prepaid_card or state_prohibits.
The current surcharge rules for one state, with the cap, required notices and the date we last reviewed them.
curl https://api.upchargepayments.com/v1/rules/OK \ -H "Authorization: Bearer $UPCHARGE_KEY"
{
"state": "OK",
"status": "restricted",
"cap": { "type": "lesser_of", "percent": 2.0, "actual_cost": true },
"notice_required": true,
"receipt_itemized": true,
"reviewed_at": "2026-11-01"
}Confirms the payment and charges the card for the quoted total. Nothing is charged until you call this, and if you never do, the quote just expires. The surcharge is itemized on its own receipt line.
curl https://api.upchargepayments.com/v1/payments \ -H "Authorization: Bearer $UPCHARGE_KEY" \ -H "Idempotency-Key: checkout-1042" \ -d quote=qt_8Fq2mX
{
"id": "pay_3Kd91Z",
"status": "succeeded",
"amount": 100000,
"surcharge": 2890,
"total": 102890,
"receipt": {
"lines": [
{ "label": "Sale", "amount": 100000 },
{ "label": "Credit card surcharge 2.89%", "amount": 2890 }
]
}
}One payment with its status, surcharge, fees and the batch it settled in.
curl https://api.upchargepayments.com/v1/payments/pay_3Kd91Z \ -H "Authorization: Bearer $UPCHARGE_KEY"
{
"id": "pay_3Kd91Z",
"status": "succeeded",
"total": 102890,
"batch": "bat_20261117",
"declined_reason": null
}Refunds all or part of a payment. The surcharge comes back in the same proportion as the sale.
curl https://api.upchargepayments.com/v1/refunds \ -H "Authorization: Bearer $UPCHARGE_KEY" \ -d payment=pay_3Kd91Z \ -d amount=50000
{
"id": "ref_7Hn20Q",
"amount": 50000,
"surcharge_refunded": 1445,
"total_refunded": 51445
}A hosted payment page that shows the surcharge notice for you. Text or email it, or drop it on an invoice.
curl https://api.upchargepayments.com/v1/payment_links \ -H "Authorization: Bearer $UPCHARGE_KEY" \ -d amount=42500 \ -d merchant_state=FL \ -d description="RO 2291, brakes"
{
"id": "pl_Qm4c8T",
"url": "https://pay.upchargepayments.com/pl_Qm4c8T",
"expires_at": "2026-12-01T00:00:00Z"
}Webhooks
We POST events to your endpoint as JSON. Check the Upcharge-Signature header with your webhook secret before trusting the body. Failed deliveries retry for 3 days.
Errors
Errors come back with an HTTP status and a code you can switch on. The message is written for people.
{
"error": {
"code": "surcharge_not_allowed",
"message": "Connecticut does not allow credit card surcharges."
}
}Test mode
Every endpoint works in the sandbox with an sk_test_ key. The rules are real, but the money isn't. Test cards and edge cases are on the SDKs and sandbox page.
Stuck on something?
Leave your number and one of our engineers will call you back.