API reference

API overview

The Checkout API is a REST API. It takes JSON request bodies, returns JSON, uses standard HTTP status codes, and authenticates with a secret key.

Base URLs

EnvironmentBase URLKeys
Livehttps://api.saphra.one/v1sk_live_…
Sandboxhttps://sandbox.api.saphra.one/v1sk_test_…

Endpoints

MethodPathDoes
POST/v1/checkout/sessionsCreate a checkout session
GET/v1/checkout/sessions/{id}Retrieve a session
GET/v1/checkout/sessionsList sessions
POST/v1/checkout/sessions/{id}/expireExpire an unpaid session

Requests

  • Send bodies as JSON with Content-Type: application/json. A body that isn’t a JSON object is refused with body_invalid.
  • Money is always a decimal string, such as "25.00", with up to six decimal places. Numbers are refused so no amount is ever rounded by a float.
  • Unknown fields are ignored, so adding fields later never breaks you.
  • Ids are case-insensitive and look like cs_live_ + 24 characters.

Responses

  • Every object has an object field naming its type (checkout.session, list).
  • Timestamps are ISO 8601 strings in UTC. Fields with no value are null, never missing.
  • Amounts come back normalised without trailing zeros: "25.00" is returned as "25".
  • Responses carry Cache-Control: no-store. Errors use one error format.

Rate limits

LimitValue
Requests per secret key100 per minute
Sessions created per business1,000 per hour

Over the limit you get 429 with the code rate_limited. Retry with exponential backoff (for example 1s, 2s, 4s, with jitter). Need more? Contact SaphraONE support.

Object limits

FieldLimit
amount0.50 to 10,000 per session
currencyUSDC (default) or EURC
expires_in_minutes30 to 1,440; default 60
line_itemsUp to 20; quantity 1 to 10,000; name up to 120 characters
metadataUp to 20 keys; keys up to 40 characters, values up to 500
descriptionUp to 140 characters
client_reference_idUp to 200 characters
success_url, cancel_urlUp to 2,048 characters
Active API keys5 per business

Versioning

The version is in the path: /v1. Within v1 we only make additive changes: new endpoints, new optional parameters, new fields in responses and new error codes. Anything that would break an integration ships as a new version, announced in the changelog well ahead.

OpenAPI

A machine-readable description of the API is at /openapi/checkout-v1.json. Import it into Postman or Insomnia, or generate a typed client.