Skip to main content
The Checkout endpoint converts a cart into a Stripe-hosted checkout session. You call this endpoint from your server, receive a URL, and redirect the customer’s browser to that URL to complete payment. This route requires a valid API key.
The checkout URL is single-use and expires after a short period. If a customer abandons checkout and returns to your storefront, generate a new checkout session rather than reusing the old URL.

Create checkout session

Creates a Stripe checkout session for the specified cart and returns a redirect URL.

Body parameters

string
required
The ID of the cart to check out. The cart must belong to the same store as the API key.

Request

Response

string
required
A Stripe-hosted checkout URL. Redirect the customer’s browser to this URL to complete payment. The URL is single-use and expires after a short period.

Redirecting the customer

Call this endpoint from your server-side handler (API route, server action, or loader), then return the URL to the browser for the redirect. Never call it directly from client-side code — your API key must stay on the server. Here is an example server-side handler that creates the session and returns the URL:
Then in your client-side code, redirect using the URL returned from your server:
After the customer completes or cancels payment, Stripe redirects them to the success or cancel URL configured in your Quickshops dashboard.