Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

4466 articles

Session Object


The Session object The Session object is a view of the Checkout Session API object and represents your customer's session on your checkout page. Because data can change over the lifecycle of a session, avoid storing a reference to the Session object. Instead, call getSession to retrieve the current value, or listen to the change event to subscribe to updates. - id The ID of the Checkout Session. - billingAddress Billing details of the Customer. - name Full name. - address Address. - country Two-letter country code (ISO 3166-1 alpha-2). - line1 Address line 1 (e.g., street, PO Box, or company name). - line2 Address line 2 (e.g., apartment, suite, unit, or building). - city City, district, suburb, town, or village. - postal_code ZIP or postal code. - state State, county, province, or region. - businessName The business name as configured in the Business Public Details settings of your Stripe account. - canConfirm Whether the Checkout Session has collected enough data to confirm. Use this field to indicate to your customer if they can proceed, such as disabling the pay button. - currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - currencyOptions The currency options available on the Checkout Session when using Adaptive Pricing. - amount A formatted string representing the total amount in the source currency, including currency symbols. - minorUnitsAmount An integer representing the total amount in the source currency in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - currency Three-letter ISO currency code, in lowercase. - currencyConversion Currency conversion details. This is only present for the customer currency. - fxRate The exchange rate used to convert source currency amounts to customer currency amounts. - sourceCurrency The creation currency of the Checkout Session before localization. - discountAmounts The aggregate amounts calculated per discount for all line items. - amount A formatted string representing the discount amount, including currency symbols. - minorUnitsAmount An integer representing the discount amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - displayName A user-facing description of the discount. - promotionCode The customer-facing promotion code that was used to apply this discount, if any. - recurring Details of how the discount applies to recurring payments. - type One of forever or repeating. * forever: Applies to all charges from a subscription with this coupon applied. * repeating: Applies to charges in the first durationInMonths months from a subscription with this coupon applied. - durationInMonths If duration is repeating, the number of months the coupon applies. Null otherwise. - percentOff An integer representing the discount amount as a percentage. - email The Customer's email address. - lastPaymentError The error encountered the last time the Checkout Session was confirmed. - message An error message to be displayed to the customer. - lineItems A list of items the customer is purchasing. - id Unique identifier for the object. - subtotal Total before any discounts or exclusive taxes are applied. - amount A formatted string representing the subtotal amount, including currency symbols. - minorUnitsAmount An integer representing the subtotal amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - discount Total discount amount. A positive number reduces the amount to be paid. - amount A formatted string representing the discount amount, including currency symbols. - minorUnitsAmount An integer representing the discount amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - taxExclusive Total amount of exclusive tax (tax that is collected in addition to the subtotal). - amount A formatted string representing the exclusive tax amount, including currency symbols. - minorUnitsAmount An integer representing the exclusive tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - taxInclusive Total amount of inclusive tax (tax that is already included in the subtotal). - amount A formatted string representing the inclusive tax amount, including currency symbols. - minorUnitsAmount An integer representing the inclusive tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - total Total amount for this line item, including discounts and tax. - amount A formatted string representing the total amount, including currency symbols. - minorUnitsAmount An integer representing the total amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - unitAmount The amount representing the cost of a single unit of the item. - amount A formatted string representing the unit amount, including currency symbols. - minorUnitsAmount An integer representing the unit amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - unitAmountDecimal The unit amount of the line item in the smallest currency unit, with sub-cent precision. Use this field instead of unitAmount when dealing with sub-cent pricing (for example, usage-based billing). For sub-cent prices, unitAmount.minorUnitsAmount rounds to 0, so unitAmountDecimal preserves the exact decimal value (for example, 0.005 for a price of 0.00005 USD). - amount A formatted string representing the unit amount with sub-cent precision, including currency symbols. - minorUnitsAmount A number representing the unit amount in the smallest currency unit with sub-cent precision (for example, 0.5 for half a cent). Unlike unitAmount.minorUnitsAmount, this value can be a decimal. - unitLabel A label that represents the unit of this line item. Specify unitLabel in productData.unit_label when creating the Checkout Session or when creating the Product's unit_label field. - description An arbitrary string attached to the object. Often useful for displaying to users. - name The item's name, meant to be displayable to users. - images An array of image URLs for the line item. Specify images on the Product when creating the Checkout Session. - quantity The quantity of products being purchased. - discountAmounts The amount of discount calculated per discount for this line item. - amount A formatted string representing the discount amount, including currency symbols. - minorUnitsAmount An integer representing the discount amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - displayName A user-facing description of the discount. - promotionCode The customer-facing promotion code that was used to apply this discount, if any. - recurring Details of how the discount applies to recurring payments. - type One of forever or repeating. * forever: Applies to all charges from a subscription with this coupon applied. * repeating: Applies to charges in the first durationInMonths months from a subscription with this coupon applied. - durationInMonths If duration is repeating, the number of months the coupon applies. Null otherwise. - percentOff An integer representing the discount amount as a percentage. - taxAmounts The amount of tax calculated per tax rate for this line item. - amount A formatted string representing the tax amount, including currency symbols. - minorUnitsAmount An integer representing the tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - inclusive Whether this tax amount is inclusive or exclusive. - displayName A user-facing description of the tax. - percentage The tax rate percentage. This value is absent for flat-amount tax rates. - recurring The recurring components of a price such as interval and intervalCount. - interval Specifies billing frequency. Either day, week, month, or year. - intervalCount The number of intervals between subscription billings. For example, interval=month and intervalCount=3 bills every 3 months. - usageType One of licensed or metered. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. - adjustableQuantity Configuration for this item's quantity to be adjusted by the customer during checkout. - maximum The maximum quantity the customer can purchase for the Checkout Session. - minimum The minimum quantity the customer can purchase for the Checkout Session. - livemode Has the value true if the object exists in live mode or the value false if the object exists in a sandbox. - minorUnitsAmountDivisor The factor used to convert between minor and major currency units. This value represents the number of minor currency units per one major unit. For example, in USD, where cents are the minor unit, the divisor is 100. In JPY, which has no minor units, the divisor is 1. - nameCollection Names collected from the customer. This value is null if name_collection is not configured on the Checkout Session. - individualName The customer's individual name. - businessName The customer's business name. - phoneNumber The Customer's phone number. - recurring Details about recurring payments set up by the Checkout Session. - interval Specifies billing frequency. Either day, week, month, or year. - intervalCount The number of intervals between subscription billings. For example, interval=month and intervalCount=3 bills every 3 months. - dueNext Details about the next scheduled recurring payment. - subtotal Total before any discounts or exclusive taxes are applied. - amount A formatted string representing the subtotal amount, including currency symbols. - minorUnitsAmount An integer representing the subtotal amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - discount Total discount amount. A positive number reduces the amount to be paid. - amount A formatted string representing the discount amount, including currency symbols. - minorUnitsAmount An integer representing the discount amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - taxExclusive Total amount of exclusive tax (tax that is collected in addition to the subtotal). - amount A formatted string representing the exclusive tax amount, including currency symbols. - minorUnitsAmount An integer representing the exclusive tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - taxInclusive Total amount of inclusive tax (tax that is already included in the subtotal). - amount A formatted string representing the inclusive tax amount, including currency symbols. - minorUnitsAmount An integer representing the inclusive tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - total Total computed amount, including discounts and tax. - amount A formatted string representing the total amount, including currency symbols. - minorUnitsAmount An integer representing the total amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - billingCycleAnchor A future Unix timestamp to anchor the subscription's billing cycle. The anchor is the reference point that aligns future billing cycle dates. If not present, the subscription starts immediately. - trial Details about a free trial, if there is one. - trialEnd Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. - trialPeriodDays Integer representing the number of trial period days before the customer is charged for the first time. - isProrated When true, the amount to be collected today is a prorated amount for a partial billing period, such as when using billing_cycle_anchor. - savedPaymentMethods An array of payment methods attached to the Customer. - id ID of the PaymentMethod object - type The type of the PaymentMethod - billingDetails Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - email Email address. - phone Billing phone number (including extension). - name Full name. - address Address. - country Two-letter country code (ISO 3166-1 alpha-2). - line1 Address line 1 (e.g., street, PO Box, or company name). - line2 Address line 2 (e.g., apartment, suite, unit, or building). - city City, district, suburb, town, or village. - postal_code ZIP or postal code. - state State, county, province, or region. - card If this is a card PaymentMethod, this hash contains the user's card details. - brand The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be american_express, cartes_bancaires, diners_club, discover, eftpos_australia, interac, jcb, mastercard, union_pay, visa, or other and may contain more values in the future. - expMonth Two-digit number representing the card's expiration month. - expYear Four-digit number representing the card's expiration year. - last4 The last four digits of the card. - shipping The selected shipping option, if any. - shippingOption Details of the selected shipping option. - id Unique identifier for the object. - amount A formatted string representing the shipping amount, including currency symbols. - minorUnitsAmount An integer representing the shipping amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - currency Three-letter ISO currency code, in lowercase. - displayName A user-facing description of the shipping option. - deliveryEstimate The estimated range for how long shipping will take. - maximum The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - unit A unit of time. Either business_day, day, hour, week, or month. - value Must be greater than 0. - minimum The lower bound of the estimated range. If empty, represents no lower bound. - unit A unit of time. Either business_day, day, hour, week, or month. - value Must be greater than 0. - taxAmounts The amount of tax calculated per tax rate for shipping costs. - amount A formatted string representing the tax amount, including currency symbols. - minorUnitsAmount An integer representing the tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - inclusive Whether this tax amount is inclusive or exclusive. - displayName A user-facing description of the tax. - percentage The tax rate percentage. This value is absent for flat-amount tax rates. - shippingAddress Shipping address of the Customer. - name Full name. - address Address. - country Two-letter country code (ISO 3166-1 alpha-2). - line1 Address line 1 (e.g., street, PO Box, or company name). - line2 Address line 2 (e.g., apartment, suite, unit, or building). - city City, district, suburb, town, or village. - postal_code ZIP or postal code. - state State, county, province, or region. - shippingOptions The list of shipping options that can be selected. - id Unique identifier for the object. - amount A formatted string representing the shipping amount, including currency symbols. - minorUnitsAmount An integer representing the shipping amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - currency Three-letter ISO currency code, in lowercase. - displayName A user-facing description of the shipping option. - deliveryEstimate The estimated range for how long shipping will take. - maximum The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - unit A unit of time. Either business_day, day, hour, week, or month. - value Must be greater than 0. - minimum The lower bound of the estimated range. If empty, represents no lower bound. - unit A unit of time. Either business_day, day, hour, week, or month. - value Must be greater than 0. - status Status of the Checkout Session. - type One of open, expired, or complete. * open: The Checkout Session is still in progress. * expired: The Checkout Session has expired. No further processing will occur. * complete: The Checkout Session is complete. Payment processing may still be in progress. - paymentStatus One of paid, unpaid, or no_payment_required. Only present when type=complete. * paid: The payment funds are available in your account. * unpaid: The payment funds are not yet available in your account. * no_payment_required: The payment is delayed to a future date, or the Checkout Session is in setup mode and doesn't require a payment at this time. - tax Details about the tax computation status. - status One of ready, requires_shipping_address, or requires_billing_address. * ready: The final tax amount is computed, and the session is ready for confirmation. * requires_shipping_address: A shipping address must be provided to calculate tax. * requires_billing_address: A billing address must be provided to calculate tax. - automaticTax Details about the automatic tax settings of the Checkout Session. - enabled Whether automatic tax is enabled on the Checkout Session. The other fields in this hash are null when automatic tax is disabled. - exempt One of none, exempt, or reverse. This value is null if automatic tax is disabled, or if the Customer hasn't provided enough address information to determine their tax exemption. * none: The Customer isn't exempt from tax. * exempt: The Customer is exempt from tax. * reverse: The Customer is subject to the reverse charge mechanism, so tax is accounted for by the Customer. - addressSource One of billing, shipping, or customer, indicating which address is used to calculate tax. This value is null if automatic tax is disabled. * billing: Tax is calculated from the billing address collected during this Checkout Session. * shipping: Tax is calculated from the shipping address collected during this Checkout Session. * customer: Tax is calculated from the address saved on the Customer. - taxAmounts The aggregate amounts calculated per tax rate for all line items. This value is null if tax has not yet been computed, i.e. the Customer's address has not been collected yet. - amount A formatted string representing the tax amount, including currency symbols. - minorUnitsAmount An integer representing the tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - inclusive Whether this tax amount is inclusive or exclusive. - displayName A user-facing description of the tax. - percentage The tax rate percentage. This value is absent for flat-amount tax rates. - total Tax and discount details for the computed total amount. Use this field to render an amount breakdown to your customer, such as in an order summary. - subtotal The total amount of line items, excluding tax, discounts, and shipping. - amount A formatted string representing the subtotal amount, including currency symbols. - minorUnitsAmount An integer representing the subtotal amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - taxExclusive The sum of all exclusive tax amounts - amount A formatted string representing the exclusive tax amount, including currency symbols. - minorUnitsAmount An integer representing the exclusive tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - taxInclusive The sum of all inclusive tax amounts - amount A formatted string representing the inclusive tax amount, including currency symbols. - minorUnitsAmount An integer representing the inclusive tax amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - shippingRate The sum of all shipping amounts. - amount A formatted string representing the total shipping amount, including currency symbols. - minorUnitsAmount An integer representing the total shipping amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - discount The sum of all the discounts. A positive number reduces the amount to be paid. - amount A formatted string representing the discount amount, including currency symbols. - minorUnitsAmount An integer representing the discount amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - total Total computed amount, including discounts, tax. - amount A formatted string representing the total amount, including currency symbols. - minorUnitsAmount An integer representing the total amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - appliedBalance Total amount of customer credit balance to be applied to the payment. A positive number increases the amount to be paid, and a negative number decreases the amount to be paid. - amount A formatted string representing the applied customer balance amount, including currency symbols. - minorUnitsAmount An integer representing the applied customer balance amount in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - balanceAppliedToNextInvoice When true, no payment will be collected immediately. Instead, the amount due will be added to the Customer's next invoice. This can happen when the amount due today is less than the minimum chargeable amount.

Last verified 2026-09-24

Is this helpful?