Endpoint
Retrieve a checkout session
GET
/v1/checkout_sessions/{id}With a publishable key the response holds only id, object, status, order, livemode.
- Scope a restricted key needs
checkout_sessions:read- Publishable key
- Allowed
- Idempotency-Key
- Not used. A GET is already safe to repeat.
Parameters
| Parameter | Type and place | Meaning |
|---|---|---|
idrequired | stringpath | The id of the session. |
expand | stringquery | Comma-separated fields to expand (Filtering, sorting and expanding), up to 5, one level deep: order, customer. Each field needs the read scope that its object's own GET needs (customers:read for a customer, payments:read for a payment); without it the call answers insufficient_scope naming that scope, and nothing is expanded. |
Orrerie-Version | stringheader | API version date. Default: the version the key was created with. Example 2026-10-11. |
Example request
curl
curl https://api.orrerie.com/v1/checkout_sessions/cs_z7ek5wj68fyz80j7bz1eq4e0 \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY"JavaScript
const response = await fetch("https://api.orrerie.com/v1/checkout_sessions/cs_z7ek5wj68fyz80j7bz1eq4e0", {
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
},
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
console.log(result);Python
import os
import requests
response = requests.get(
"https://api.orrerie.com/v1/checkout_sessions/cs_z7ek5wj68fyz80j7bz1eq4e0",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)PHP
<?php
$request = curl_init('https://api.orrerie.com/v1/checkout_sessions/cs_z7ek5wj68fyz80j7bz1eq4e0');
curl_setopt_array($request, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
],
]);
$body = curl_exec($request);
if ($body === false) {
throw new RuntimeException(curl_error($request));
}
$result = json_decode($body, true);
if (curl_getinfo($request, CURLINFO_HTTP_CODE) >= 400) {
throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);Responses
200 OK
The answer is the checkout_session object. Headers: Orrerie-Request-Id.
Example response, 200
{
"id": "cs_z7ek5wj68fyz80j7bz1eq4e0",
"object": "checkout_session",
"livemode": true,
"created": "2026-10-11T14:03:22.418Z",
"status": "open",
"mode": "payment",
"order": "ord_0zymngngvf12b8b2cra7tb8e",
"url": "https://pay.orrerie.com/c/cs_z7ek5wj68fyz80j7bz1eq4e0",
"app_url": "https://pay.orrerie.com/o/cs_z7ek5wj68fyz80j7bz1eq4e0",
"success_url": "https://acme.example/thanks?session={CHECKOUT_SESSION_ID}",
"cancel_url": "https://acme.example/cart",
"customer": "cus_8ea07c40qsvv19f7rgmeb8ha",
"customer_email": "jane@example.com",
"client_reference_id": "1042",
"collect": {
"email": "required",
"name": "optional",
"shipping_address": "hidden"
},
"collected": {
"email": null,
"name": null,
"shipping_address": null
},
"locale": "auto",
"subscription": null,
"expires_at": "2026-10-11T15:03:22.418Z",
"completed_at": null,
"metadata": {
"cart_id": "c_7781"
}
}Any other status: an error
A status of 400 or above answers with the error object. Branch on its code, never on its message.
Errors
This call has no error of its own. It answers with the errors every call can answer with: a bad key, a missing scope, an object that does not exist, the rate limit. Every error code has its own entry.