Skip to main content
POST
/
v1
/
checkout
/
sessions
/
{id}
/
expire
Expire a Checkout Session
curl --request POST \
  --url https://api.leanrails.com/v1/checkout/sessions/{id}/expire \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Idempotency-Key: <idempotency-key>'
{
  "id": "cs_xxx",
  "object": "checkout.session",
  "mode": "payment",
  "status": "open",
  "payment_status": "unpaid",
  "ui_mode": "hosted",
  "customer_creation": "always",
  "billing_address_collection": "auto",
  "expires_at": 123,
  "metadata": {},
  "livemode": false,
  "created": 1234567890,
  "url": "<string>",
  "client_secret": "<string>",
  "success_url": "<string>",
  "cancel_url": "<string>",
  "customer": "cus_xxx",
  "customer_email": "<string>",
  "customer_details": {
    "email": "<string>",
    "name": "<string>",
    "phone": "<string>",
    "address": {
      "city": "<string>",
      "country": "<string>",
      "line1": "<string>",
      "line2": "<string>",
      "postal_code": "<string>",
      "state": "<string>"
    }
  },
  "payment_intent": "pi_xxx",
  "currency": "usd",
  "amount_subtotal": 123,
  "amount_total": 123,
  "total_details": {
    "amount_discount": 123,
    "amount_shipping": 123,
    "amount_tax": 123
  },
  "shipping_address_collection": {
    "allowed_countries": [
      "<string>"
    ]
  },
  "shipping_options": [
    {
      "shipping_rate": "<string>",
      "shipping_amount": 123
    }
  ],
  "shipping_details": {
    "address": {},
    "name": "<string>"
  },
  "phone_number_collection": true,
  "client_reference_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.fluveo.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use your secret API key as the username with an empty password.

Headers

Idempotency-Key
string
required

Unique key to ensure idempotent requests.

Maximum string length: 255
X-API-Version
string

Override the API version for this request.

Path Parameters

id
string
required

The Checkout Session ID.

Response

The expired Checkout Session.

id
string
required
Example:

"cs_xxx"

object
enum<string>
required
Available options:
checkout.session
mode
enum<string>
required

The mode of the Checkout Session.

Available options:
payment,
order
status
enum<string>
required

The status of the Checkout Session.

Available options:
open,
complete,
expired
payment_status
enum<string>
required

The payment status of the Checkout Session.

Available options:
unpaid,
paid,
no_payment_required
ui_mode
enum<string>
required

The UI mode of the session.

Available options:
hosted,
embedded,
custom
customer_creation
enum<string>
required

Whether a customer was always created or only if required.

Available options:
always,
if_required
billing_address_collection
enum<string>
required

Whether billing address was collected.

Available options:
auto,
required
expires_at
integer
required

Unix timestamp for when the session expires.

metadata
object
required

Set of key-value pairs for storing additional information.

livemode
boolean
required
Example:

false

created
integer
required

Unix timestamp.

Example:

1234567890

url
string<uri> | null

The URL to the hosted checkout page. Only set for hosted mode.

client_secret
string | null

The client secret for embedded/custom mode.

success_url
string<uri> | null

The URL to redirect to after successful payment.

cancel_url
string<uri> | null

The URL to redirect to when the customer cancels.

customer
string | null

The ID of the customer.

Example:

"cus_xxx"

customer_email
string | null

The customer's email address.

customer_details
object

Customer details collected during checkout.

payment_intent
string | null

The ID of the PaymentIntent for this session.

Example:

"pi_xxx"

currency
string | null

Three-letter ISO currency code.

Example:

"usd"

amount_subtotal
integer | null

Total before discounts and taxes, in smallest currency unit.

amount_total
integer | null

Total after discounts and taxes, in smallest currency unit.

total_details
object

Breakdown of the total amount.

shipping_address_collection
object

Configuration for collecting shipping addresses.

shipping_options
object[]

The shipping options available for this session.

shipping_details
object

Shipping information collected from the customer.

phone_number_collection
boolean

Whether phone number collection is enabled for this session.

client_reference_id
string | null

A unique string to reference the session.