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

# Create plan checkout

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Creates a checkout page where the payer buys a paid plan for your workspace. Nothing is charged until they pay on that page.

Pass the price ID of the plan, from `price_ids` in [List plans](/api-reference/list-plans), then open `url` in a browser and let the payer complete the purchase. The page is on Stripe or Wix, depending on how the workspace is billed. Only the workspace owner can start a checkout.

If the workspace already pays for a plan, move it with [Change plan](/api-reference/change-plan) or [Change Wix plan](/api-reference/change-wix-plan) instead. Checkout refuses it with 409 when the plan is billed through Stripe and 400 when it's billed through Wix. A workspace billed through the App Store, Google Play or an external contract can't check out here either.

Set `checkout_return_path` to send the payer back to a page on Base44 after checkout. Without it, they land on the billing page.

Each call creates a new checkout page, including a retry after a lost response. Send the payer only one.

The base rate limit is 8 requests per hour per user. See [Rate limits](/developers/references/apps-api/get-started/rate-limits) for the multiplier your plan gets.

<Warning>Send only `checkout_return_path` in the body. Other request fields aren't supported and their behavior can change.</Warning>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/billing/create-checkout-session/{price_id}
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/billing/create-checkout-session/{price_id}:
    post:
      summary: Create plan checkout
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Creates a checkout page where the payer buys a paid plan for your
        workspace. Nothing is charged until they pay on that page.


        Pass the price ID of the plan, from `price_ids` in [List
        plans](/api-reference/list-plans), then open `url` in a browser and let
        the payer complete the purchase. The page is on Stripe or Wix, depending
        on how the workspace is billed. Only the workspace owner can start a
        checkout.


        If the workspace already pays for a plan, move it with [Change
        plan](/api-reference/change-plan) or [Change Wix
        plan](/api-reference/change-wix-plan) instead. Checkout refuses it with
        409 when the plan is billed through Stripe and 400 when it's billed
        through Wix. A workspace billed through the App Store, Google Play or an
        external contract can't check out here either.


        Set `checkout_return_path` to send the payer back to a page on Base44
        after checkout. Without it, they land on the billing page.


        Each call creates a new checkout page, including a retry after a lost
        response. Send the payer only one.


        The base rate limit is 8 requests per hour per user. See [Rate
        limits](/developers/references/apps-api/get-started/rate-limits) for the
        multiplier your plan gets.


        <Warning>Send only `checkout_return_path` in the body. Other request
        fields aren't supported and their behavior can change.</Warning>
      operationId: >-
        create_checkout_session_api_billing_create_checkout_session__price_id__post
      parameters:
        - name: price_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              Price ID of the plan to buy, from `price_ids` in [List
              plans](/api-reference/list-plans).
            title: Price Id
          description: >-
            Price ID of the plan to buy, from `price_ids` in [List
            plans](/api-reference/list-plans).
          example: price_1QxYzAbCdEfGhIjK
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCheckoutSessionRequest'
      responses:
        '200':
          description: The checkout page to send the payer to.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanCheckoutSession'
              example:
                session_id: cs_live_a1B2c3D4e5F6g7H8i9J0
                url: https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5F6g7H8i9J0
        '400':
          description: >-
            `price_id` isn't a plan you can buy here (`invalid_price_id` on
            Stripe), the workspace already pays for a plan through Wix, or it's
            billed through the App Store.
        '401':
          description: >-
            Missing or invalid credentials. A read-only token gets this response
            too.
        '403':
          description: >-
            You aren't the workspace owner, a payment dispute is open on the
            workspace, or the plan is only available as a downgrade.
        '409':
          description: >-
            The workspace already pays for a plan through Stripe, is billed
            through Google Play, Apple or an external contract, or is still on a
            free migration trial.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - type: string_too_long
                    loc:
                      - body
                      - checkout_return_path
                    msg: String should have at most 2048 characters
                    input: /apps?ref=...
                    ctx:
                      max_length: 2048
        '429':
          description: >-
            Rate limit exceeded. The base rate limit is 8 requests per hour per
            user. See [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    CreateCheckoutSessionRequest:
      properties:
        checkout_return_path:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          title: Checkout Return Path
          description: >-
            Path on Base44 to send the payer back to after checkout, such as
            `/apps`. It must start with a single `/`. Any other value is
            ignored, and the payer lands on the billing page.
          example: /apps
      type: object
      title: CreateCheckoutSessionRequest
      description: Request model for checkout session creation.
    PlanCheckoutSession:
      properties:
        session_id:
          type: string
          title: Session Id
          description: >-
            ID of the Stripe Checkout session. An empty string when the
            workspace checks out through Wix.
          example: cs_live_a1B2c3D4e5F6g7H8i9J0
        url:
          type: string
          title: Url
          description: >-
            Checkout page for this purchase. Open it in a browser so the payer
            can review and pay. On Wix the link itself opens the checkout, so
            don't log or share it.
          example: https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5F6g7H8i9J0
      type: object
      required:
        - session_id
        - url
      title: PlanCheckoutSession
      description: A checkout for a plan.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.