API reference
Conventions shared by every endpoint, and the generated reference for each one.
The endpoint pages in this section are generated from RunePay's OpenAPI 3.1 spec, /openapi/runepay-v1.json, which is generated from the same schemas that validate requests. If a page and the API disagree, that is a bug.
Base URL and authentication
POST https://runepay.co/api/v1/checkout_sessions
Authorization: Bearer sk_test_...
Content-Type: application/jsonSend a secret key as a bearer token (Keys and security). The API is server to server: it sends no CORS headers.
Requests
- Request bodies are JSON objects, at most 256 KB.
POSTcreates objects and runs actions;GETreads and lists. Updating a webhook endpoint usesPATCHtoday; payment links update withPOST.- Unknown body parameters are rejected (
parameter_unknown), so a typo fails instead of being ignored. - Every
POST,PATCHandDELETEaccepts anIdempotency-Keyheader. See Idempotency.
Responses
- Objects have an
idwith a type prefix (cs_,pay_,re_,dp_,plink_,evt_,we_),livemode, and acreatedtime. - Times are unix timestamps in seconds.
- Money is an integer in the currency's smallest unit (
1999is $19.99) with a three-lettercurrency, uppercase in responses and any case in requests. USD is the currency enabled today. metadatais a set of string keys and string values you attach and get back. Today, non-string values are dropped.- Every response, errors included, has a
Request-Idheader (req_…) andCache-Control: no-store. - Errors share one shape. See Errors.
- Lists are paged. See Pagination.
Resources
| Resource | What it is |
|---|---|
| Checkout sessions | A hosted checkout page for one payment. The main way to take payments. |
| Payments | Card payments, created by checkout. |
| Refunds | Money returned to the buyer for a payment. |
| Disputes | Chargebacks and inquiries raised by the buyer's bank. |
| Payment links | Reusable checkout URLs you can share. |
| Balance | Funds RunePay holds for you, by state. |
| Payouts | Transfers of your available balance to your bank or wallet. |
| Events | Things that happened in your account; the same objects webhooks deliver. |
| Webhook endpoints | URLs RunePay sends signed events to. |
Webhook payloads are listed in the event reference.