Upcharge

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.

Start the quickstartSDKs and sandbox

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.

Headers
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.

POST/v1/surcharge/quote

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.

FieldTypeWhat it is
amountintegerSale amount in cents, before any surcharge
payment_methodstringThe card token from our card fields
merchant_statestringTwo-letter state where the sale happens
merchantstringOptional. A merchant id, for platforms acting for a merchant
Request
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
Response
{
  "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.

GET/v1/rules/:state

The current surcharge rules for one state, with the cap, required notices and the date we last reviewed them.

FieldTypeWhat it is
statepathTwo-letter state code
Request
curl https://api.upchargepayments.com/v1/rules/OK \
  -H "Authorization: Bearer $UPCHARGE_KEY"
Response
{
  "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"
}
POST/v1/payments

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.

FieldTypeWhat it is
quotestringA quote id. Locks the amount and surcharge
payment_methodstringOptional. Taken from the quote if you leave it out
descriptionstringOptional. Shows in the portal and on the receipt
metadataobjectOptional. Your own keys, returned on every event
Request
curl https://api.upchargepayments.com/v1/payments \
  -H "Authorization: Bearer $UPCHARGE_KEY" \
  -H "Idempotency-Key: checkout-1042" \
  -d quote=qt_8Fq2mX
Response
{
  "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 }
    ]
  }
}
GET/v1/payments/:id

One payment with its status, surcharge, fees and the batch it settled in.

FieldTypeWhat it is
idpathA payment id
Request
curl https://api.upchargepayments.com/v1/payments/pay_3Kd91Z \
  -H "Authorization: Bearer $UPCHARGE_KEY"
Response
{
  "id": "pay_3Kd91Z",
  "status": "succeeded",
  "total": 102890,
  "batch": "bat_20261117",
  "declined_reason": null
}
POST/v1/refunds

Refunds all or part of a payment. The surcharge comes back in the same proportion as the sale.

FieldTypeWhat it is
paymentstringThe payment to refund
amountintegerOptional. Sale amount to refund in cents. Defaults to all of it
Request
curl https://api.upchargepayments.com/v1/refunds \
  -H "Authorization: Bearer $UPCHARGE_KEY" \
  -d payment=pay_3Kd91Z \
  -d amount=50000
Response
{
  "id": "ref_7Hn20Q",
  "amount": 50000,
  "surcharge_refunded": 1445,
  "total_refunded": 51445
}

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.

EventWhen it fires
payment.succeededA charge went through
payment.declinedA charge was declined, with a plain-English reason
refund.createdA full or partial refund was issued
batch.closedThe day's batch closed for a merchant account
deposit.sentFunds left for the merchant's bank
dispute.openedA cardholder disputed a payment
rules.updatedA state's surcharge rules changed

Errors

Errors come back with an HTTP status and a code you can switch on. The message is written for people.

CodeHTTPWhat happened
surcharge_not_allowed422Debit, prepaid or a state that bans surcharges
rate_above_cap422A rate you passed is above the card brand or state cap
quote_expired409The quote is older than 15 minutes. Quote again
invalid_payment_method400We couldn't read that card
idempotency_conflict409Same key, different request body
authentication_failed401Missing or wrong API key
Error body
{
  "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.

Or try the calculator