POST
stripe_checkout_sessions_create.py
from charter.packs import stripe
result = await stripe.checkout_sessions_create.ainvoke({"mode": ...})
Body
| Field | Type | Description |
|---|---|---|
mode * | CheckoutMode | 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. |
lineItems | LineItem[] | A list of items the customer is purchasing. Required for ‘payment’ and ‘subscription’ mode. |
successUrl | string | 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’. |
cancelUrl | string | If set, Checkout displays a back button and sends customers here if they cancel. |
customer | string | ID of an existing Customer, if one exists. |
customerEmail | string | Prefills the customer’s email. If not provided, customers are asked to enter it. max length 800 |
clientReferenceId | string | A unique string to reference the Checkout Session — a customer ID, a cart ID — used to reconcile the session with your own systems. max length 200 |
currency | string | Three-letter ISO currency code, in lowercase. Required in ‘setup’ mode when payment_method_types is not set. |
expiresAt | integer | 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. |
allowPromotionCodes | boolean | Enables user-redeemable promotion codes. |
uiMode | UiMode | The UI mode of the session. Defaults to ‘hosted_page’. |
returnUrl | string | Where to send the customer after they authenticate or cancel. Required if ui_mode is ‘embedded_page’, ‘elements’ or ‘form’ with redirect-based methods. |
metadata | map of string | Set of key-value pairs attached to the session. |