> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Checkout Session

> Unified endpoint for creating checkout sessions for all types of billing requirements.



## OpenAPI

````yaml post /checkouts
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.105.0
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /checkouts:
    post:
      tags:
        - Checkout Sessions
      operationId: create_session
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCheckoutSessionRequest'
        required: true
      responses:
        '200':
          description: Checkout session successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSessionResponse'
        '422':
          description: Invalid Request Object or Parameters
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });


            const checkoutSessionResponse = await
            client.checkoutSessions.create({
              product_cart: [{ product_id: 'product_id', quantity: 0 }],
            });


            console.log(checkoutSessionResponse.session_id);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            checkout_session_response = client.checkout_sessions.create(
                product_cart=[{
                    "product_id": "product_id",
                    "quantity": 0,
                }],
            )
            print(checkout_session_response.session_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tcheckoutSessionResponse, err := client.CheckoutSessions.New(context.TODO(), dodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F(\"product_id\"),\n\t\t\t\tQuantity:  dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", checkoutSessionResponse.SessionID)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest;

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse;

            import com.dodopayments.api.models.checkoutsessions.ProductItemReq;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    CheckoutSessionRequest params = CheckoutSessionRequest.builder()
                        .addProductCart(ProductItemReq.builder()
                            .productId("product_id")
                            .quantity(0)
                            .build())
                        .build();
                    CheckoutSessionResponse checkoutSessionResponse = client.checkoutSessions().create(params);
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse

            import com.dodopayments.api.models.checkoutsessions.ProductItemReq


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val params: CheckoutSessionRequest = CheckoutSessionRequest.builder()
                    .addProductCart(ProductItemReq.builder()
                        .productId("product_id")
                        .quantity(0)
                        .build())
                    .build()
                val checkoutSessionResponse: CheckoutSessionResponse = client.checkoutSessions().create(params)
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )


            checkout_session_response =
            dodo_payments.checkout_sessions.create(product_cart: [{product_id:
            "product_id", quantity: 0}])


            puts(checkout_session_response)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;
            use Dodopayments\Misc\CountryCode;
            use Dodopayments\Misc\Currency;
            use Dodopayments\Payments\PaymentMethodTypes;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $checkoutSessionResponse = $client->checkoutSessions->create(
                productCart: [
                  [
                    'productID' => 'product_id',
                    'quantity' => 0,
                    'addons' => [['addonID' => 'addon_id', 'quantity' => 0]],
                    'amount' => 0,
                    'creditEntitlements' => [
                      [
                        'creditEntitlementID' => 'credit_entitlement_id',
                        'creditsAmount' => 'credits_amount',
                      ],
                    ],
                  ],
                ],
                allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],
                billingAddress: [
                  'country' => CountryCode::AF,
                  'city' => 'city',
                  'state' => 'state',
                  'street' => 'street',
                  'zipcode' => 'zipcode',
                ],
                billingCurrency: Currency::AED,
                cancelURL: 'cancel_url',
                confirm: true,
                customFields: [
                  [
                    'fieldType' => 'text',
                    'key' => 'key',
                    'label' => 'label',
                    'options' => ['string'],
                    'placeholder' => 'placeholder',
                    'required' => true,
                  ],
                ],
                customer: ['customerID' => 'customer_id'],
                customerBusinessName: 'customer_business_name',
                customization: [
                  'forceLanguage' => 'force_language',
                  'showOnDemandTag' => true,
                  'showOrderDetails' => true,
                  'theme' => 'dark',
                  'themeConfig' => [
                    'dark' => [
                      'bgPrimary' => 'bg_primary',
                      'bgSecondary' => 'bg_secondary',
                      'borderPrimary' => 'border_primary',
                      'borderSecondary' => 'border_secondary',
                      'buttonPrimary' => 'button_primary',
                      'buttonPrimaryHover' => 'button_primary_hover',
                      'buttonSecondary' => 'button_secondary',
                      'buttonSecondaryHover' => 'button_secondary_hover',
                      'buttonTextPrimary' => 'button_text_primary',
                      'buttonTextSecondary' => 'button_text_secondary',
                      'inputFocusBorder' => 'input_focus_border',
                      'textError' => 'text_error',
                      'textPlaceholder' => 'text_placeholder',
                      'textPrimary' => 'text_primary',
                      'textSecondary' => 'text_secondary',
                      'textSuccess' => 'text_success',
                    ],
                    'fontPrimaryURL' => 'font_primary_url',
                    'fontSecondaryURL' => 'font_secondary_url',
                    'fontSize' => 'xs',
                    'fontWeight' => 'normal',
                    'light' => [
                      'bgPrimary' => 'bg_primary',
                      'bgSecondary' => 'bg_secondary',
                      'borderPrimary' => 'border_primary',
                      'borderSecondary' => 'border_secondary',
                      'buttonPrimary' => 'button_primary',
                      'buttonPrimaryHover' => 'button_primary_hover',
                      'buttonSecondary' => 'button_secondary',
                      'buttonSecondaryHover' => 'button_secondary_hover',
                      'buttonTextPrimary' => 'button_text_primary',
                      'buttonTextSecondary' => 'button_text_secondary',
                      'inputFocusBorder' => 'input_focus_border',
                      'textError' => 'text_error',
                      'textPlaceholder' => 'text_placeholder',
                      'textPrimary' => 'text_primary',
                      'textSecondary' => 'text_secondary',
                      'textSuccess' => 'text_success',
                    ],
                    'payButtonText' => 'pay_button_text',
                    'radius' => 'radius',
                  ],
                ],
                discountCode: 'discount_code',
                discountCodes: ['string'],
                featureFlags: [
                  'allowCurrencySelection' => true,
                  'allowCustomerEditingBusinessName' => true,
                  'allowCustomerEditingCity' => true,
                  'allowCustomerEditingCountry' => true,
                  'allowCustomerEditingEmail' => true,
                  'allowCustomerEditingName' => true,
                  'allowCustomerEditingState' => true,
                  'allowCustomerEditingStreet' => true,
                  'allowCustomerEditingTaxID' => true,
                  'allowCustomerEditingZipcode' => true,
                  'allowDiscountCode' => true,
                  'allowPhoneNumberCollection' => true,
                  'allowTaxID' => true,
                  'alwaysCreateNewCustomer' => true,
                  'redirectImmediately' => true,
                  'requirePhoneNumber' => true,
                ],
                force3DS: true,
                mandateMinAmountInrPaise: 0,
                metadata: ['foo' => 'string'],
                minimalAddress: true,
                paymentMethodID: 'payment_method_id',
                productCollectionID: 'product_collection_id',
                returnURL: 'return_url',
                shortLink: true,
                showSavedPaymentMethods: true,
                subscriptionData: [
                  'onDemand' => [
                    'mandateOnly' => true,
                    'adaptiveCurrencyFeesInclusive' => true,
                    'productCurrency' => Currency::AED,
                    'productDescription' => 'product_description',
                    'productPrice' => 0,
                  ],
                  'trialPeriodDays' => 0,
                ],
                taxID: 'tax_id',
              );

              var_dump($checkoutSessionResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using DodoPayments.Client;

            using DodoPayments.Client.Models.CheckoutSessions;


            DodoPaymentsClient client = new();


            CheckoutSessionCreateParams parameters = new()

            {
                ProductCart =
                [
                    new()
                    {
                        ProductID = "product_id",
                        Quantity = 0,
                        Addons =
                        [
                            new()
                            {
                                AddonID = "addon_id",
                                Quantity = 0,
                            },
                        ],
                        Amount = 0,
                        CreditEntitlements =
                        [
                            new()
                            {
                                CreditEntitlementID = "credit_entitlement_id",
                                CreditsAmount = "credits_amount",
                            },
                        ],
                    },
                ],
            };


            var checkoutSessionResponse = await
            client.CheckoutSessions.Create(parameters);


            Console.WriteLine(checkoutSessionResponse);
components:
  schemas:
    CreateCheckoutSessionRequest:
      type: object
      required:
        - product_cart
      properties:
        allowed_payment_method_types:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/PaymentMethodTypes'
          description: >-
            Customers will never see payment methods that are not in this list.

            However, adding a method here does not guarantee customers will see
            it.

            Availability still depends on other factors (e.g., customer
            location, merchant settings).


            Disclaimar: Always provide 'credit' and 'debit' as a fallback.

            If all payment methods are unavailable, checkout session will fail.
          uniqueItems: true
        billing_address:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CheckoutSessionBillingAddress'
              description: Billing address information for the session
        billing_currency:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Currency'
              description: This field is ingored if adaptive pricing is disabled
        cancel_url:
          type:
            - string
            - 'null'
          description: >-
            The URL to redirect the customer if they cancel or go back from the
            checkout.

            If not provided, the back button will not be displayed.
        confirm:
          type: boolean
          description: >-
            If confirm is true, all the details will be finalized. If required
            data is missing, an API error is thrown.
        custom_fields:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CustomFields'
              description: >-
                Custom fields to collect from customer during checkout (max 5
                fields)
        customer:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CustomerRequest'
              description: Customer details for the session
        customer_business_name:
          type:
            - string
            - 'null'
          description: >-
            Optional business / legal name associated with the tax id. When
            provided

            together with a valid tax id for a B2B purchase, this name is
            rendered

            on the invoice instead of the customer's personal name.
        customization:
          $ref: '#/components/schemas/CheckoutSessionCustomization'
          description: Customization for the checkout session page
        discount_code:
          type:
            - string
            - 'null'
          description: >-
            DEPRECATED: Use discount_codes instead. Cannot be used together with
            discount_codes.
          deprecated: true
          x-stainless-deprecation-message: Use `discount_id` instead.
        discount_codes:
          type:
            - array
            - 'null'
          items:
            type: string
          description: |-
            Stacked discount codes to apply, in order. Max 20.
            Cannot be used together with discount_code.
        feature_flags:
          $ref: '#/components/schemas/CheckoutSessionFlags'
        force_3ds:
          type:
            - boolean
            - 'null'
          description: Override merchant default 3DS behaviour for this session
        mandate_min_amount_inr_paise:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Override the merchant-level mandate floor (in INR paise) for INR

            e-mandates on Indian-card recurring payments. The mandate amount
            sent to

            the processor is `max(this_floor, actual_billing_amount)`, so this
            is

            effectively the customer-facing authorization ceiling whenever
            billing is

            lower. When unset, the merchant setting applies; when that's also
            unset,

            the system default of ₹15,000 applies.
        metadata:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Metadata'
              description: >-
                Additional metadata associated with the payment. Defaults to
                empty if not provided.
        minimal_address:
          type: boolean
          description: >-
            If true, only zipcode is required when confirm is true; other
            address fields remain optional
        payment_method_id:
          type:
            - string
            - 'null'
          description: |-
            Optional payment method ID to use for this checkout session.
            Only allowed when `confirm` is true.
            If provided, existing customer id must also be provided.
        product_cart:
          type: array
          items:
            $ref: '#/components/schemas/ProductItemReq'
        product_collection_id:
          type:
            - string
            - 'null'
          description: Product collection ID for collection-based checkout flow
        return_url:
          type:
            - string
            - 'null'
          description: The url to redirect after payment failure or success.
        short_link:
          type: boolean
          description: |-
            If true, returns a shortened checkout URL.
            Defaults to false if not specified.
        show_saved_payment_methods:
          type: boolean
          description: >-
            Display saved payment methods of a returning customer False by
            default
        subscription_data:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SubscriptionData'
        tax_id:
          type:
            - string
            - 'null'
          description: >-
            Tax ID for the customer (e.g. VAT number). Requires billing_address
            with country.
    CreateSessionResponse:
      type: object
      required:
        - session_id
      properties:
        checkout_url:
          type:
            - string
            - 'null'
          description: Checkout url (None when payment_method_id is provided)
        client_secret:
          type:
            - string
            - 'null'
          description: >-
            Client secret used to load the Dodo Payments checkout SDK. Returned
            when

            `confirm: true` was passed and a PaymentIntent was created at

            session-creation time. `None` otherwise.
        payment_id:
          type:
            - string
            - 'null'
          description: >-
            Underlying payment id when `confirm: true` was passed and a
            PaymentIntent

            was created at session-creation time. `None` otherwise.
        publishable_key:
          type:
            - string
            - 'null'
          description: |-
            Publishable key for the Dodo Payments checkout SDK. Returned when
            `confirm: true` was passed and a PaymentIntent was created at
            session-creation time. `None` otherwise.
        session_id:
          type: string
          description: The ID of the created checkout session
    PaymentMethodTypes:
      type: string
      description: |-
        All supported payment method types.

        Used for disabled-payment-methods filtering and validation.
      enum:
        - ach
        - affirm
        - afterpay_clearpay
        - alfamart
        - ali_pay
        - ali_pay_hk
        - alma
        - amazon_pay
        - apple_pay
        - atome
        - bacs
        - bancontact_card
        - becs
        - benefit
        - bizum
        - blik
        - boleto
        - bca_bank_transfer
        - bni_va
        - bri_va
        - card_redirect
        - cimb_va
        - classic
        - credit
        - crypto_currency
        - cashapp
        - dana
        - danamon_va
        - debit
        - duit_now
        - efecty
        - eft
        - eps
        - fps
        - evoucher
        - giropay
        - givex
        - google_pay
        - go_pay
        - gcash
        - ideal
        - interac
        - indomaret
        - klarna
        - kakao_pay
        - local_bank_redirect
        - mandiri_va
        - knet
        - mb_way
        - mobile_pay
        - momo
        - momo_atm
        - multibanco
        - online_banking_thailand
        - online_banking_czech_republic
        - online_banking_finland
        - online_banking_fpx
        - online_banking_poland
        - online_banking_slovakia
        - oxxo
        - pago_efectivo
        - permata_bank_transfer
        - open_banking_uk
        - pay_bright
        - paypal
        - paze
        - pix
        - pay_safe_card
        - przelewy24
        - prompt_pay
        - pse
        - red_compra
        - red_pagos
        - samsung_pay
        - sepa
        - sepa_bank_transfer
        - sofort
        - sunbit
        - swish
        - touch_n_go
        - trustly
        - twint
        - upi_collect
        - upi_intent
        - vipps
        - viet_qr
        - venmo
        - walley
        - we_chat_pay
        - seven_eleven
        - lawson
        - mini_stop
        - family_mart
        - seicomart
        - pay_easy
        - local_bank_transfer
        - mifinity
        - open_banking_pis
        - direct_carrier_billing
        - instant_bank_transfer
        - billie
        - zip
        - revolut_pay
        - naver_pay
        - payco
    CheckoutSessionBillingAddress:
      type: object
      title: Checkout Session Billing Address
      required:
        - country
      properties:
        city:
          type:
            - string
            - 'null'
          description: City name
        country:
          $ref: '#/components/schemas/CountryCodeAlpha2'
          description: Two-letter ISO country code (ISO 3166-1 alpha-2)
        state:
          type:
            - string
            - 'null'
          description: State or province name
        street:
          type:
            - string
            - 'null'
          description: >-
            Street address including house number and unit/apartment if
            applicable
        zipcode:
          type:
            - string
            - 'null'
          description: Postal code or ZIP code
    Currency:
      type: string
      enum:
        - AED
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BWP
        - BYN
        - BZD
        - CAD
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SEK
        - SGD
        - SHP
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STN
        - SVC
        - SZL
        - THB
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
    CustomFields:
      type: array
      items:
        $ref: '#/components/schemas/CustomField'
      description: Wrapper for custom fields with validation
    CustomerRequest:
      oneOf:
        - $ref: '#/components/schemas/AttachExistingCustomer'
        - $ref: '#/components/schemas/NewCustomer'
      title: Customer Request
    CheckoutSessionCustomization:
      type: object
      title: Checkout Session Customization
      properties:
        force_language:
          type:
            - string
            - 'null'
          description: >-
            Force the checkout interface to render in a specific language (e.g.
            `en`, `es`)
        show_on_demand_tag:
          type: boolean
          description: |-
            Show on demand tag

            Default is true
        show_order_details:
          type: boolean
          description: |-
            Show order details by default

            Default is true
        theme:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ThemeMode'
              description: >-
                Theme of the page (determines which mode - light/dark/system -
                to use)


                If not provided, uses the business-configured theme from
                business_themes table.
        theme_config:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ThemeConfig'
              description: >-
                Optional custom theme configuration with colors for light and
                dark modes
    CheckoutSessionFlags:
      type: object
      title: Checkout Session Flags
      properties:
        allow_currency_selection:
          type: boolean
          description: |-
            if customer is allowed to change currency, set it to true

            Default is true
        allow_customer_editing_business_name:
          type: boolean
          description: >-
            If true, the customer can supply or edit the business name
            associated

            with the tax id during checkout. Works independently of

            `allow_customer_editing_tax_id` — either flag (or `allow_tax_id`) is

            sufficient to let the customer override the session's business name.

            Typically set together with `allow_customer_editing_tax_id`.


            Default is false
        allow_customer_editing_city:
          type: boolean
        allow_customer_editing_country:
          type: boolean
        allow_customer_editing_email:
          type: boolean
        allow_customer_editing_name:
          type: boolean
        allow_customer_editing_state:
          type: boolean
        allow_customer_editing_street:
          type: boolean
        allow_customer_editing_tax_id:
          type: boolean
        allow_customer_editing_zipcode:
          type: boolean
        allow_discount_code:
          type: boolean
          description: |-
            If the customer is allowed to apply discount code, set it to true.

            Default is true
        allow_phone_number_collection:
          type: boolean
          description: |-
            If phone number is collected from customer, set it to rue

            Default is true
        allow_tax_id:
          type: boolean
          description: |-
            If the customer is allowed to add tax id, set it to true

            Default is true
        always_create_new_customer:
          type: boolean
          description: >-
            Set to true if a new customer object should be created.

            By default email is used to find an existing customer to attach the
            session to


            Default is false
        redirect_immediately:
          type: boolean
          description: |-
            If true, redirects the customer immediately after payment completion

            Default is false
        require_phone_number:
          type: boolean
          description: >-
            If true, the customer must provide a phone number to complete
            checkout.

            Requires `allow_phone_number_collection` to also be true.


            Default is false
    Metadata:
      type: object
      additionalProperties:
        type: string
      propertyNames:
        type: string
    ProductItemReq:
      type: object
      title: Product Item Request
      required:
        - product_id
        - quantity
      properties:
        addons:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/AttachAddonReq'
          description: only valid if product is a subscription
        amount:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Amount the customer pays if pay_what_you_want is enabled. If
            disabled then amount will be ignored

            Represented in the lowest denomination of the currency (e.g., cents
            for USD).

            For example, to charge $1.00, pass `100`.

            Only applicable for one time payments


            If amount is not set for pay_what_you_want product,

            customer is allowed to select the amount.
        credit_entitlements:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/CreditEntitlementOverride'
          description: >-
            Per-checkout-session overrides for credit entitlements already
            attached

            to this product. Each entry overrides the `credits_amount` granted
            by the

            referenced credit entitlement when this checkout session is
            fulfilled.

            The credit_entitlement_id must already be attached to the product.
        product_id:
          type: string
          description: unique id of the product
        quantity:
          type: integer
          format: int32
          minimum: 0
    SubscriptionData:
      type: object
      title: Subscription Data
      properties:
        on_demand:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OnDemandSubscriptionReq'
        trial_period_days:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Optional trial period in days If specified, this value overrides the
            trial period set in the product's price Must be between 0 and 10000
            days
    CountryCodeAlpha2:
      type: string
      description: ISO country code alpha2 variant
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MK
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SZ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - UM
        - US
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
    CustomField:
      type: object
      description: Definition of a custom field for checkout
      required:
        - key
        - label
        - field_type
      properties:
        field_type:
          $ref: '#/components/schemas/CustomFieldType'
          description: Type of field determining validation rules
        key:
          type: string
          description: Unique identifier for this field (used as key in responses)
        label:
          type: string
          description: Display label shown to customer
        options:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Options for dropdown type (required for dropdown, ignored for
            others)
        placeholder:
          type:
            - string
            - 'null'
          description: Placeholder text for the input
        required:
          type: boolean
          description: Whether this field is required
    AttachExistingCustomer:
      type: object
      title: Attach Existing Customer
      required:
        - customer_id
      properties:
        customer_id:
          type: string
    NewCustomer:
      type: object
      title: New Customer
      required:
        - email
      properties:
        email:
          type: string
          description: Email is required for creating a new customer
        name:
          type:
            - string
            - 'null'
          description: >-
            Optional full name of the customer. If provided during session
            creation,

            it is persisted and becomes immutable for the session. If omitted
            here,

            it can be provided later via the confirm API.
        phone_number:
          type:
            - string
            - 'null'
    ThemeMode:
      type: string
      enum:
        - dark
        - light
        - system
    ThemeConfig:
      type: object
      description: Custom theme configuration with colors for light and dark modes.
      properties:
        dark:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ThemeModeConfig'
              description: Dark mode color configuration
        font_primary_url:
          type:
            - string
            - 'null'
          description: URL for the primary font. Must be a valid https:// URL.
        font_secondary_url:
          type:
            - string
            - 'null'
          description: URL for the secondary font. Must be a valid https:// URL.
        font_size:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FontSize'
              description: Font size for the checkout UI
        font_weight:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FontWeight'
              description: Font weight for the checkout UI
        light:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ThemeModeConfig'
              description: Light mode color configuration
        pay_button_text:
          type:
            - string
            - 'null'
          description: >-
            Custom text for the pay button (e.g., "Complete Purchase",
            "Subscribe Now"). Max 100 characters.
        radius:
          type:
            - string
            - 'null'
          description: >-
            Border radius for UI elements. Must be a number followed by px, rem,
            or em (e.g., "4px", "0.5rem", "1em")
    AttachAddonReq:
      type: object
      title: Attach Addon Request
      required:
        - addon_id
        - quantity
      properties:
        addon_id:
          type: string
        quantity:
          type: integer
          format: int32
          minimum: 0
    CreditEntitlementOverride:
      type: object
      description: >-
        Per-checkout-session override for a single credit entitlement attached
        to a product.
      required:
        - credit_entitlement_id
        - credits_amount
      properties:
        credit_entitlement_id:
          type: string
          description: >-
            ID of the credit entitlement to override. Must already be attached
            to the product.
        credits_amount:
          type: string
          description: >-
            Number of credits to grant for this checkout session, overriding the

            product-level `credits_amount` set on the credit entitlement
            mapping.

            Must be greater than zero.
    OnDemandSubscriptionReq:
      type: object
      title: On Demand Subscription Request
      required:
        - mandate_only
      properties:
        adaptive_currency_fees_inclusive:
          type:
            - boolean
            - 'null'
          description: >-
            Whether adaptive currency fees should be included in the
            product_price (true) or added on top (false).

            This field is ignored if adaptive pricing is not enabled for the
            business.
        mandate_only:
          type: boolean
          description: >-
            If set as True, does not perform any charge and only authorizes
            payment method details for future use.
        product_currency:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Currency'
              description: >-
                Optional currency of the product price. If not specified,
                defaults to the currency of the product.
        product_description:
          type:
            - string
            - 'null'
          description: >-
            Optional product description override for billing and line items.

            If not specified, the stored description of the product will be
            used.
        product_price:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Product price for the initial charge to customer

            If not specified the stored price of the product will be used

            Represented in the lowest denomination of the currency (e.g., cents
            for USD).

            For example, to charge $1.00, pass `100`.
    CustomFieldType:
      type: string
      description: Custom field type for checkout forms
      enum:
        - text
        - number
        - email
        - url
        - date
        - dropdown
        - boolean
    ThemeModeConfig:
      type: object
      description: |-
        Color configuration for a single theme mode (light or dark).

        All color fields accept standard CSS color formats:
        - Hex: `#fff`, `#ffffff`, `#ffffffff` (with or without # prefix)
        - RGB/RGBA: `rgb(255, 255, 255)`, `rgba(255, 255, 255, 0.5)`
        - HSL/HSLA: `hsl(120, 100%, 50%)`, `hsla(120, 100%, 50%, 0.5)`
        - Named colors: `red`, `blue`, `transparent`, etc.
        - Advanced: `hwb()`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color()`
      properties:
        bg_primary:
          type:
            - string
            - 'null'
          description: |-
            Background primary color

            Examples: `"#ffffff"`, `"rgb(255, 255, 255)"`, `"white"`
        bg_secondary:
          type:
            - string
            - 'null'
          description: Background secondary color
        border_primary:
          type:
            - string
            - 'null'
          description: Border primary color
        border_secondary:
          type:
            - string
            - 'null'
          description: Border secondary color
        button_primary:
          type:
            - string
            - 'null'
          description: Primary button background color
        button_primary_hover:
          type:
            - string
            - 'null'
          description: Primary button hover color
        button_secondary:
          type:
            - string
            - 'null'
          description: Secondary button background color
        button_secondary_hover:
          type:
            - string
            - 'null'
          description: Secondary button hover color
        button_text_primary:
          type:
            - string
            - 'null'
          description: Primary button text color
        button_text_secondary:
          type:
            - string
            - 'null'
          description: Secondary button text color
        input_focus_border:
          type:
            - string
            - 'null'
          description: Input focus border color
        text_error:
          type:
            - string
            - 'null'
          description: Text error color
        text_placeholder:
          type:
            - string
            - 'null'
          description: Text placeholder color
        text_primary:
          type:
            - string
            - 'null'
          description: Text primary color
        text_secondary:
          type:
            - string
            - 'null'
          description: Text secondary color
        text_success:
          type:
            - string
            - 'null'
          description: Text success color
    FontSize:
      type: string
      description: Font size options for checkout UI
      enum:
        - xs
        - sm
        - md
        - lg
        - xl
        - 2xl
    FontWeight:
      type: string
      description: Font weight options for checkout UI
      enum:
        - normal
        - medium
        - bold
        - extraBold
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````