Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

5282 articles

Manage limited inventory


Manage limited inventory

Prevent customers from holding inventory in carts by expiring Checkout Sessions.

For some types of limited-inventory businesses, it’s necessary to prevent customers from reserving items for a long time without completing the purchase. For example, an event ticket seller wants to allow customers only a few minutes to buy their selected tickets before cancelling the sale and making those tickets available again. You can cancel a pending sale by expiring the Checkout Session.

Checkout supports both manual and timed session expiry. When a Checkout Session expires, its status property changes to expired.

Manual expiry

To immediately expire an open Checkout Session and cancel any pending purchase, use the expire endpoint.

Command Line

Select a language

cURL

Stripe CLI

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

Set an expiry time

When you create a Checkout Session, specify an expiration timestamp by setting the expires_at parameter. The value must be between 30 minutes and 24 hours after the current time. If you don’t specify expires_at, the default value is 24 hours after the current time.

Command Line

Select a language

cURL

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

Return items to your inventory

When a Checkout Session expires, Stripe sends the checkout.session.expired event. Configure your webhook endpoint to listen for this event so your webhook handler can return to inventory any items reserved in the expired session. For more information, see Expire a Session.

Last verified 2026-09-25

Is this helpful?