API reference
API reference
The API is plain JSON over HTTPS. The base address is:
https://overflowpay.net/api/v1A machine-readable version lives at /openapi.json.
Server library
overflow-node.mjs is one file with no dependencies, for Node 18 and later, Bun and Deno. Copy it into your project.
import {Overflow,verifyWebhook} from "./overflow-node.mjs"
const ovf = new Overflow(process.env.OVERFLOW_SECRET_KEY,"https://overflowpay.net")
const co = await ovf.checkouts.create({items:[{name:"Poster",amount:1900}],currency:"eur"})
const ok = verifyWebhook(rawBody,request.headers,process.env.OVERFLOW_WEBHOOK_SECRET)Every resource below has a matching method, such as ovf.products.list() or ovf.subscriptions.cancel(id). A POST gets an Idempotency-Key by itself, and a 429 or 5xx answer is retried twice with the same key. A failed call throws an OverflowError with code, status and requestId.
Versioning
Every answer carries an overflow-version header with the date of the API it follows, currently 2026-12-05. New fields and new endpoints can appear at any time, so ignore fields you don't know. A change that could break an integration gets a new date and an entry in the changelog.
Authentication
Send your store's secret key as a bearer token on every request.
curl https://overflowpay.net/api/v1/checkouts \
-H "Authorization: Bearer $OVERFLOW_SECRET_KEY"A key belongs to one store. Create and revoke keys under Developers in the dashboard, give each a label, and make it read-only if it only needs to look things up : a read-only key gets 403 read_only_key on anything that changes data. Call the API from your server only.
Once the Overflow you use runs on live keys it may also offer test keys. A checkout made with one takes Stripe's test cards, such as 4242 4242 4242 4242, shows a test badge, and moves no money. A test key only sees test objects and a live key only live ones, so a test key can't refund a real payment. Every object and every webhook carries livemode, so one endpoint can tell them apart.
Every answer carries a request-id header. Errors carry the same id as request_id, so quote it when you ask about a request. Answers also say how much of the rate limit is left : ratelimit-limit (300 a minute per store) and ratelimit-remaining, plus retry-after on a 429.
Errors
A failed request returns a matching HTTP status and a body like this:
{"error": {"code": "invalid_items", "message": "items[0].amount must be an integer in the smallest currency unit (cents)", "request_id": "req_..."}}Branch on code. The message is written for a developer to read and may change. When one field is at fault, field names it.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json, invalid_items, invalid_currency, invalid_amount, invalid_email, invalid_return_url, invalid_metadata, invalid_type, invalid_expires_in | Something in the request body is wrong. The message says what. |
| 400 | amount_too_small | The total is below the smallest amount Stripe charges in that currency. |
| 401 | unauthorized | The key is missing, mistyped or revoked. |
| 403 | read_only_key | This key can only read. |
| 403 | store_pending | The person who runs Overflow hasn't approved your store yet. |
| 403 | store_suspended | Your store is suspended and can't take payments. |
| 403 | limit_exceeded | The checkout is above your store's limit for one payment, a day or 30 days. Ask the person who runs Overflow to raise it. |
| 404 | not_found | No such checkout in this store. |
| 409 | store_not_ready | Your store hasn't finished payout setup under Settings → Payouts, so it can't take payments yet. |
| 409 | not_refundable | Only paid checkouts can be refunded. |
| 409 | not_open | Only an open checkout can be expired. |
| 409 | idempotency_mismatch | This Idempotency-Key was already used with a different request. |
| 409 | idempotency_in_progress | A request with this key is still running. Try again in a moment. |
| 400 | invalid_cursor | starting_after isn't an object from that list. |
| 400 | invalid_reason | The refund reason isn't one of the three allowed. |
| 409 | idempotency_key_reused | This key made a checkout more than a day ago. Use a new key. |
| 429 | rate_limited | Too many requests. Wait a moment. |
| 500 | internal | Something broke on Overflow's side. Try again later. |
| 502 | stripe_error | Stripe refused the request. The message is Stripe's. |
| 502 | platform_misconfigured | Stripe refused this Overflow's own key, for example because it lacks a permission. Nothing is wrong with your request. Tell the person who runs Overflow. |
| 503 | stripe_not_configured | Payments aren't set up on Overflow yet. Tell the person who runs it. |
Idempotency
Every POST accepts an Idempotency-Key header, like your own order id or a random UUID. Sent again within 24 hours with the same body, the request isn't run a second time : you get the first answer back, with an idempotent-replayed: true header. That makes a retry after a timeout safe, including for refunds. The same key with a different body gets 409 idempotency_mismatch.
For POST /checkouts the key is also stored on the checkout, so two requests racing with one key still make one checkout. After a day the key can't make another checkout : send a new one.
The checkout object
{
"id": "co_xv6nGkF6H2cYxIVmtfiI6M6l",
"object": "checkout",
"status": "paid",
"amount": 1900,
"currency": "eur",
"items": [{"name": "Pro license", "amount": 1900, "quantity": 1, "description": "1 year"}],
"customer_email": "buyer@example.com",
"return_url": "https://yoursite.com/thanks",
"metadata": {"order": "1001"},
"url": "https://overflowpay.net/pay/co_xv6nGkF6H2cYxIVmtfiI6M6l",
"risk": {
"verdict": "allow",
"score": 0,
"reasons": [],
"radar_level": "normal",
"radar_score": null,
"three_d_secure": "authenticated"
},
"refunded_amount": 0,
"created": 1796435758,
"paid_at": 1796435820,
"expires_at": 1796522158
}| Field | Notes |
|---|---|
status | open, processing, paid, trialing, blocked, failed, expired, refunded or disputed. trialing : a subscription with a free trial started, and nothing was charged yet. See Checkout. |
amount | The total in the smallest currency unit: the sum of each item's amount times its quantity. |
url | The full-page checkout. Send the buyer here or open it with the loader. |
risk.verdict | allow, challenge (3D Secure was forced) or block. null until the buyer opens the checkout. |
risk.score | The gate's score from 0 to 100. |
risk.reasons | The signals that added points, such as vpn or webdriver. |
risk.radar_level | Stripe Radar's level for the payment: normal, elevated or highest. |
risk.radar_score | Radar's numeric score. Only present if the Stripe account's plan exposes it. |
risk.three_d_secure | The 3D Secure outcome, such as authenticated, or null if it wasn't used. |
kind | payment, subscription for the checkout that starts one, or renewal for each later period. |
discount | What a code took off, already left out of amount. |
product, subscription | The product it was made from, and the subscription it belongs to. null otherwise. |
shipping | {"name", "address"} for a product that ships, once paid. |
fee, reserve, net | Once paid : the platform fee, the part held back for a while before it is sent to you, and what is yours after refunds. null before. |
refunded_amount | What was refunded so far. |
| Timestamps | Seconds since 1970, UTC. |
Create a checkout
POST /checkouts| Body field | Type | Notes |
|---|---|---|
items | array, required unless you send product | 1 to 50 objects with name (string), amount (integer), quantity (integer, 1 to 999, default 1) and description (string, optional). |
currency | string, required unless you send product | Lowercase ISO code, one of usd, eur, gbp, aud, cad, chf, nzd, sgd, hkd, jpy, dkk, nok, sek, pln, czk, ron, bgn, mxn, brl, inr, myr, thb or aed. The total must be at least what Stripe charges in that currency, such as 0.50 in usd or eur. |
customer_email | string | Prefills the buyer's email. |
return_url | string | Where the buyer goes after paying. ?checkout_id=... is added. |
metadata | object | Up to 20 keys, values are stored as strings. |
expires_in | integer | Seconds the buyer has to pay, 1800 to 86400. Default 86400, a day. |
product | string | A product id. Its price, files, keys and shipping apply, and items and currency are ignored. A subscription product starts a subscription. |
quantity | integer | With product : how many, up to its quantity_max. The buyer can still change it on the checkout. |
Returns the checkout object with status open. Once expires_at passes it reads as expired, and a checkout.expired webhook follows.
Retrieve a checkout
GET /checkouts/{id}Returns the checkout object.
List checkouts
GET /checkouts?limit=20&status=paid&starting_after=co_...| Query | Notes |
|---|---|
limit | 1 to 100, default 20. |
status | Only checkouts with this status. |
starting_after | A checkout id. Returns the ones created before it. |
Newest first. The response is {"object": "list", "data": [...], "has_more": true}. To page, pass the last id you received as starting_after until has_more is false.
Refund a checkout
POST /checkouts/{id}/refund| Body field | Type | Notes |
|---|---|---|
amount | integer | Leave out to refund everything that is left. |
Send the body as JSON with content-type: application/json, or send no body at all to refund everything. A body Overflow can't read is refused with invalid_json and nothing is refunded.
| reason | string | requested_by_customer, duplicate or fraudulent. fraudulent also teaches Stripe Radar to block that card and email. |
Returns the updated checkout object.
Refunds
GET /checkouts/{id}/refunds
GET /refunds?limit=20&starting_after=rf_...Every refund, newest first, including ones made by hand in Stripe's dashboard, which have source set to stripe.
{"id": "rf_...", "object": "refund", "checkout": "co_...", "amount": 500, "currency": "eur", "reason": "requested_by_customer", "status": "succeeded", "source": "overflow", "created": 1796435822}status is pending until Stripe settles it. One that ends failed sends a refund.failed webhook and counts as unrefunded again.
Expire a checkout
POST /checkouts/{id}/expireFor an order you cancelled on your side : the buyer can't pay it any more. Only an open checkout can be expired. Returns the checkout object with status expired, and sends checkout.expired.
Add an event
POST /checkouts/{id}/eventsAdds your own entry to the checkout's timeline, to be used as dispute evidence.
| Body field | Type | Notes |
|---|---|---|
type | string, required | A short name such as delivered, download or login. |
note | string | What happened, up to 500 characters. |
ip | string | The buyer's address at that moment. |
Returns {"ok": true}.
List events
GET /checkouts/{id}/eventsThe whole timeline, oldest first, as {"object": "list", "data": [{"id", "type", "data", "created"}]}.
Products
GET /products
POST /products
GET /products/{id}
POST /products/{id}A product is something you sell with a pay link of its own. Create and change one with name, amount, currency, description, return_url, quantity_max (1 to 99), active, and for a subscription kind set to subscription with interval (day, week, month or year), interval_count and trial_days. Sending null clears description or return_url. Only the fields you send change. Files, licence keys, shipping and the image are set in the dashboard.
The product object adds url, its pay link, sold, files (how many), license, shipping and image.
Discount codes
GET /coupons
POST /coupons
GET /coupons/{id}
POST /coupons/{id}Create one with code and either percent_off or amount_off with its currency, and optionally product, max_uses and expires_at. Change only active afterwards. Buyers type codes on a product's checkout. Subscriptions and checkouts made from your own items don't take codes.
Customers
GET /customers?email=buyer@example.comEveryone who paid, one entry per email and currency, with orders, spent, refunded, first_paid_at and last_paid_at.
Subscriptions
GET /subscriptions?status=active
GET /subscriptions/{id}
POST /subscriptions/{id}/cancel{"id": "sub_...", "object": "subscription", "status": "active", "amount": 500, "currency": "eur", "interval": "month", "interval_count": 1, "customer_email": "buyer@example.com", "product": "lnk_...", "checkout": "co_...", "current_period_end": 1799027822, "cancel_at_period_end": false, "canceled_at": null, "created": 1796435822}A subscription starts when a buyer pays a subscription product's checkout. Each later period is charged by Stripe and shows up as a checkout of its own with kind set to renewal. Cancel ends it at the end of the paid period. Send {"at_period_end": false} to end it now.
List disputes
GET /disputesThe store's 100 most recent disputes.
{
"object": "list",
"data": [{
"id": "dp_QQO69JOE8M7n9fmI",
"object": "dispute",
"checkout": "co_xv6nGkF6H2cYxIVmtfiI6M6l",
"reason": "fraudulent",
"status": "needs_response",
"amount": 1900,
"currency": "eur",
"evidence_submitted": false,
"evidence_due_by": 1797000000,
"created": 1796435822
}]
}Evidence is reviewed and submitted from the dashboard, where a person can check it first.