Payments
Checkout
A checkout is one payment a buyer is about to make: a list of items, a currency and a total. Your server creates it, the buyer pays it once, and it keeps the record of everything that happened to that payment.
Create one
curl https://overflowpay.net/api/v1/checkouts \
-H "Authorization: Bearer $OVERFLOW_SECRET_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1001" \
-d '{
"items": [{"name": "Pro license", "description": "1 year", "amount": 1900, "quantity": 1}],
"currency": "eur",
"customer_email": "buyer@example.com",
"return_url": "https://yoursite.com/thanks",
"metadata": {"order": "1001"}
}'| Field | Required | Notes |
|---|---|---|
items | yes | 1 to 50 items. Each has a name, an amount in the smallest currency unit, an optional quantity (default 1) and an optional description. |
currency | yes | Three-letter ISO code such as eur or usd. |
customer_email | no | Prefills the receipt email. If you leave it out the buyer types it in. |
return_url | no | Where the buyer goes after paying. Overflow adds ?checkout_id=co_... to it. |
metadata | no | Up to 20 string keys of your own, returned on the checkout and in webhooks. Put your order id here. |
Send an Idempotency-Key header with your own order id and a retried request returns the checkout that already exists instead of making a second one.
Statuses
| Status | Meaning |
|---|---|
open | Waiting for the buyer. Expires 24 hours after it was created, or after expires_in seconds. |
processing | The buyer confirmed and the bank hasn't answered yet. Delayed methods such as bank debits can stay here for days. |
paid | The money arrived. This is the only status to fulfil on. |
trialing | A subscription with a free trial started. Nothing was charged yet. |
blocked | The fraud gate turned the buyer away. No payment was attempted. |
failed | A delayed payment method failed after the buyer confirmed. |
expired | Nobody paid in time. |
refunded | Fully refunded. A partial refund keeps the status and raises refunded_amount. |
disputed | The buyer's bank reversed the payment. See Dispute evidence. |
A card that is declined does not end the checkout. The buyer can try another card, and each failed attempt is added to the timeline.
Ways to show it
Full page. Send the buyer to the checkout's url. Works everywhere and needs no script.
On your page. The loader opens the same checkout as a modal, a drawer or inline.
Pay link. Every product in the dashboard has a link of its own. Share its address and every visit gets a fresh checkout, with the product's files, licence keys, shipping and quantity. No server code needed. Your server can also open a product's checkout with {"product": "lnk_..."}.
<a href="https://overflowpay.net/l/lnk_...">Buy the preset pack</a>In the buyer's language
The checkout speaks English, German, French, Spanish, Dutch, Italian and Portuguese, and picks the one the buyer's browser asks for. Stripe's card fields follow along. Your item names stay as you wrote them.
After the payment
On the full page, the buyer sees a confirmation and is sent to return_url a moment later. In a modal, your success handler is called.
Either way, treat the return as a courtesy to the buyer and nothing more. The webhook is what tells you the payment is real.
Refunds
Refund from the payment's page in the dashboard, or over the API:
curl -X POST https://overflowpay.net/api/v1/checkouts/co_.../refund \
-H "Authorization: Bearer $OVERFLOW_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 500, "reason": "requested_by_customer"}'Leave amount out to refund everything that is left. A reason of fraudulent also tells Stripe Radar to block that card and email in future.
A refund takes back the share you received for the refunded part from your Stripe account. You never pay back more than you were paid for it. See How you get paid.