Skip to Content
RunePayDocs
API referenceCheckout sessions

Create a checkout session

Returns a hosted checkout URL for 1–100 inline line items in one currency. Tax is zero with the none calculator; a tax provider must be selected before live launch.

POST
/checkout_sessions

Returns a hosted checkout URL for 1–100 inline line items in one currency. Tax is zero with the none calculator; a tax provider must be selected before live launch.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret key, sk_test_… or sk_live_….

Query Parameters

expand[]?string

Header Parameters

Idempotency-Key?string

Makes a retry safe: the same key and body within 24 hours does not repeat the request.

Request Body

application/json
  1. body
line_items*array<>
Items1 <= items <= 100
customer_email?string
Match^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Formatemail
customer?string

Reserved for customers. Until the customers resource ships, every id returns 404 not_found. Mutually exclusive with customer_email.

Length1 <= length
client_reference_id?string
Lengthlength <= 500
success_url?|

Absolute http(s) URL. {CHECKOUT_SESSION_ID} is replaced at redirect time.

cancel_url?|

Absolute http(s) cancel URL.

expires_at?integer

30 minutes to 24 hours from now; defaults to 24 hours.

metadata?
locale?string

Hosted checkout supports English; auto uses English.

Default"auto"
Value in"auto""en"

Response Body

Success.

application/json
  1. response
id*string
object*string
livemode*boolean
status*string
Value in"open""complete""expired"
amount_subtotal*integer
amount_tax*integer
amount_total*integer
currency*string

Three-letter ISO 4217 code, uppercase.

tax_behavior*|

Null when line items mix inclusive and exclusive tax behavior.

payment_status*string
Value in"unpaid""paid"
line_items?

Immutable inline line items. First 10 on create/retrieve, omitted on lists; expand[]=line_items returns all items. Also available through the paged line_items endpoint.

client_reference_id*string|null
customer*string|null
customer_email*string|null
description*string|null
payment*string|null
payment_link*string|null
success_url*string|null
cancel_url*string|null
metadata*

Your own key-value strings, returned as sent.

locale*string
url*string
expires_at*integer

Unix timestamp in seconds.

expired_at*|

Unix timestamp in seconds, or null.

created*integer

Unix timestamp in seconds.

Example Request
curl -X POST 'https://runepay.co/api/v1/checkout_sessions' \  -H 'Authorization: Bearer sk_test_...' \  -H 'Content-Type: application/json' \  -d '{  "line_items": [    {      "price_data": {        "currency": "usd",        "unit_amount": 1999,        "product_data": {          "name": "Pro plan, 1 month"        },        "tax_code": "saas"      },      "quantity": 1    }  ],  "client_reference_id": "order_1042",  "success_url": "https://merchant.example/thanks?session={CHECKOUT_SESSION_ID}",  "metadata": {    "order_id": "1042"  }}'
Example Response
{  "id": "cs_01KA4XZY8T2R5M7P1Q4W6E8R0T",  "object": "checkout_session",  "livemode": false,  "status": "open",  "payment_status": "unpaid",  "amount_subtotal": 1999,  "amount_tax": 0,  "amount_total": 1999,  "currency": "USD",  "tax_behavior": "exclusive",  "line_items": {    "object": "list",    "url": "/api/v1/checkout_sessions/cs_01KA4XZY8T2R5M7P1Q4W6E8R0T/line_items",    "data": [      {        "id": "li_01KA4XZY8T2R5M7P1Q4W6E8R0T",        "object": "item",        "currency": "USD",        "quantity": 1,        "price_data": {          "currency": "USD",          "unit_amount": 1999,          "product_data": {            "name": "Pro plan, 1 month"          },          "tax_code": "saas",          "tax_behavior": "exclusive"        },        "amount_subtotal": 1999,        "amount_tax": 0,        "amount_total": 1999      }    ],    "has_more": false  },  "description": "Pro plan, 1 month",  "customer_email": null,  "customer": null,  "client_reference_id": "order_1042",  "payment": null,  "payment_link": null,  "success_url": "https://merchant.example/thanks?session={CHECKOUT_SESSION_ID}",  "cancel_url": null,  "metadata": {    "order_id": "1042"  },  "locale": "auto",  "url": "https://runepay.co/pay/cs_01KA4XZY8T2R5M7P1Q4W6E8R0T",  "expires_at": 1767312000,  "expired_at": null,  "created": 1767225600}