Countdown to conversion: introducing timed checkout.
Our Checkout MFE now supports a timed option — a built-in countdown that enforces payment deadlines and keeps flash sales, drops, and limited offers fair and predictable.
Our Checkout app is a PCI-compliant, production‑ready micro frontend that lets shoppers place orders using the business logic, shipping methods, and payment methods configured in the Commerce Layer organization. With timed checkout, merchants can now define a hard deadline for completing payment, automatically expiring the checkout when the timer runs out.
Why it matters
Timed checkout lets you reserve inventory for a limited window and enforce strict purchase deadlines without custom code. It’s ideal for ticketing, high‑demand drops, limited inventory, and flash sales where fairness and predictability matter. When the deadline is reached, the underlying order becomes expired and can no longer be placed, removing ambiguity and manual cleanup.
How it works
Timed checkout is powered by two order attributes set via confidential API credentials:
expires_at— the UTC timestamp that defines the checkout deadline.expiration_info— a structured object for the shopper experience, including the active and expired messages and a return_url to guide customers back to browsing.
When the former is set, the Checkout app renders a countdown and enforces the deadline at the edge. Once the deadline is reached, the order becomes expired and the checkout can’t be completed.
What's included
- Countdown UI in the Checkout app that reflects the remaining time with sensible defaults.
- Hard enforcement of order placement when the deadline expires.
- Shopper messaging and a post‑expiration return path via expiration_info.
- Works with existing business rules, shipping methods, and payment methods.
Set it up with the CLI
In this walkthrough we'll use the Commerce Layer CLI to create a timed checkout, configure it, and then let it expire to demonstrate the end‑to‑end behavior.
First, we need to login with sales channel API credentials:
cl app:login -o <org-slug> -i <client-id> -S <scope> -a <app-alias>
After successful login, we can create a checkout link (feel free to use any SKU of your organization as long as it is purchasable within the market in scope):
cl checkout -S <sku-code>
Open the generated link to confirm the standard hosted version of the Checkout renders.
To set an expiration date for the checkout, we need to switch API credentials, since this operation is allowed using integration API credentials only, which need a secret to authenticate:
cl app:login -o <org-slug> -i <client-id> -s <client-secret> -a <app-alias>
We can now add a deadline by setting the related UTC timestamp at the order level:
cl update order <order-id> -a expires_at=2025-10-23T9:00:00Z
Reload the Checkout, and you’ll see the countdown widget with default messages.
To customize the shopper messaging we can use the expiration_info attribute. Provide an active countdown message, an expired message, and a return URL to guide customers back to shopping.
cl update order <order-id> \
-O expiration_info/return_url=https://www.example.com \
-O expiration_info/active_message="Please complete your order before the timer ends." \
-O expiration_info/expired_message="This checkout has expired. Start a new order to continue."
To verify the expiration behavior, adjust the deadline to a near‑term timestamp to simulate expiry and reload the Checkout:
cl update order <order-id> -a expires_at=<near-future-UTC-timestamp>
Once the timer hits zero, the Checkout shows the expired state, blocks payment, and offers the return URL. The order status reflects expiry and cannot be placed.
Best practices
- Keep deadlines realistic to accommodate address, shipping, taxes, and SCA flows.
- Reserve inventory consistently by pairing timed checkout with allocation rules for high‑demand items.
- Localize messages with market/language‑specific active and expired text.
- Handle retries via a return URL that links to a fresh checkout for minimal friction.
- Monitor conversion and tune the window length based on completion rates.
Recap
Timed checkout adds a clear, enforceable deadline to the Checkout MFE, improving fairness and predictability for high‑demand scenarios. Configure the expiration date to set the window, customize the expiration info for messaging and recovery, and let the Checkout app handle the rest.
FAQs
No. Expired orders cannot be placed; here we have two options, the merchant can update the expiration timestamp with a future date or nullify it. The customer can also start a new checkout for a fresh attempt.
No. The timer governs placement eligibility; price lists and promotions still apply during the valid window.
Choose a window that accommodates redirects and approvals; enforcement occurs on placement, not during external auth steps.
Yes. The Checkout app renders a countdown when and expiration date is set; messages can be overridden by provinding expiration info.