stripe_checkout_sessions_create
Create a Checkout Session and get a hosted payment URL for one-time or subscription purchases by passing price IDs and quantities.
Instructions
Create a Checkout Session and get a hosted payment URL. Pass line_items with price IDs and quantities, mode='payment' for one-time or mode='subscription' for recurring.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | The mode of the Checkout Session. Pass 'subscription' if the session includes at least one recurring item, 'payment' for one-time payments, 'setup' to save payment details for later. | |
| uiMode | No | The UI mode of the session. Defaults to 'hosted_page'. | |
| currency | No | Three-letter ISO currency code, in lowercase. Required in 'setup' mode when payment_method_types is not set. | |
| customer | No | ID of an existing Customer, if one exists. | |
| metadata | No | Set of key-value pairs attached to the session. | |
| cancelUrl | No | If set, Checkout displays a back button and sends customers here if they cancel. | |
| expiresAt | No | The Epoch time in seconds at which the session expires. Between 30 minutes and 24 hours after creation; defaults to 24 hours. Seconds, not milliseconds: 1700000000, not 1700000000000. | |
| lineItems | No | A list of items the customer is purchasing. Required for 'payment' and 'subscription' mode. | |
| returnUrl | No | Where to send the customer after they authenticate or cancel. Required if ui_mode is 'embedded_page', 'elements' or 'form' with redirect-based methods. | |
| successUrl | No | The URL to send customers to when payment or setup is complete. Required for the default hosted flow, and not allowed if ui_mode is 'embedded_page', 'elements' or 'form'. | |
| customerEmail | No | Prefills the customer's email. If not provided, customers are asked to enter it. | |
| clientReferenceId | No | A unique string to reference the Checkout Session — a customer ID, a cart ID — used to reconcile the session with your own systems. | |
| allowPromotionCodes | No | Enables user-redeemable promotion codes. |