> ## 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 top-up checkout

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

Creates a Stripe Checkout page where the card owner reviews and pays for top-up credits for your workspace. Nothing is charged until they pay on that page.

Open `url` in a browser and let the card owner complete the payment. Stripe then returns them to the Base44 billing page, and the credits are added to the workspace shortly after the payment goes through. Get the amounts and prices from [List top-up packs](/api-reference/list-top-up-packs). Send at least one of `message_credits` (a multiple of 50, up to 400) or `integration_credits` (a multiple of 1,000, up to 8,000). Prices are in the workspace's billing currency, US dollars or Israeli shekels, and shekel prices have VAT added at checkout.

Only the workspace owner can buy top-ups, and the workspace needs a paid plan other than Enterprise that isn't past due. A workspace with an open payment dispute can't buy top-ups, and neither can one whose plan is paid through the App Store or Google Play. Checkout isn't available on a workspace billed through Wix. Where Base44 has turned on Wix top-ups, those workspaces buy with [Buy top-up with saved card](/api-reference/buy-top-up-with-saved-card) instead.

This endpoint is limited to 8 requests an hour per user, and requests it rejects count toward the limit. Some workspaces have a different limit. A read-only token is refused, and workspace API keys aren't accepted.

<Note>Top-ups are only available to accounts Base44 has enrolled in top-up credits. Other accounts get a 403.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/billing/topup/create-checkout-session
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/topup/create-checkout-session:
    post:
      summary: Create top-up 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 Stripe Checkout page where the card owner reviews and pays for
        top-up credits for your workspace. Nothing is charged until they pay on
        that page.


        Open `url` in a browser and let the card owner complete the payment.
        Stripe then returns them to the Base44 billing page, and the credits are
        added to the workspace shortly after the payment goes through. Get the
        amounts and prices from [List top-up
        packs](/api-reference/list-top-up-packs). Send at least one of
        `message_credits` (a multiple of 50, up to 400) or `integration_credits`
        (a multiple of 1,000, up to 8,000). Prices are in the workspace's
        billing currency, US dollars or Israeli shekels, and shekel prices have
        VAT added at checkout.


        Only the workspace owner can buy top-ups, and the workspace needs a paid
        plan other than Enterprise that isn't past due. A workspace with an open
        payment dispute can't buy top-ups, and neither can one whose plan is
        paid through the App Store or Google Play. Checkout isn't available on a
        workspace billed through Wix. Where Base44 has turned on Wix top-ups,
        those workspaces buy with [Buy top-up with saved
        card](/api-reference/buy-top-up-with-saved-card) instead.


        This endpoint is limited to 8 requests an hour per user, and requests it
        rejects count toward the limit. Some workspaces have a different limit.
        A read-only token is refused, and workspace API keys aren't accepted.


        <Note>Top-ups are only available to accounts Base44 has enrolled in
        top-up credits. Other accounts get a 403.</Note>
      operationId: >-
        create_topup_checkout_session_api_billing_topup_create_checkout_session_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTopupCheckoutRequest'
        required: true
      responses:
        '200':
          description: The checkout page to send the card owner to.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpCheckoutSession'
              example:
                session_id: cs_live_a1B2c3D4e5F6g7H8i9J0
                url: https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5F6g7H8i9J0
        '400':
          description: >-
            An amount isn't a multiple of its pack size, is negative or over the
            cap, or both are 0. Also returned when the workspace has no active
            paid plan (free, Enterprise, or past due), when its billing doesn't
            support top-ups, or when it's billed through Wix.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            Your account isn't enrolled in top-up credits, you aren't the
            workspace owner, a payment dispute is open on the workspace, or your
            token is read-only.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - type: int_parsing
                    loc:
                      - body
                      - message_credits
                    msg: >-
                      Input should be a valid integer, unable to parse string as
                      an integer
                    input: fifty
        '429':
          description: Rate limit exceeded (8 requests an hour).
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    CreateTopupCheckoutRequest:
      properties:
        message_credits:
          type: integer
          title: Message Credits
          description: 'Message credits to buy: a multiple of 50, up to 400. Defaults to 0.'
          default: 0
          example: 100
        integration_credits:
          type: integer
          title: Integration Credits
          description: >-
            Integration credits to buy: a multiple of 1,000, up to 8,000.
            Defaults to 0.
          default: 0
          example: 1000
      type: object
      title: CreateTopupCheckoutRequest
      description: Request model for top-up credit purchase.
    TopUpCheckoutSession:
      properties:
        session_id:
          type: string
          title: Session Id
          description: ID of the Stripe Checkout session.
          example: cs_live_a1B2c3D4e5F6g7H8i9J0
        url:
          type: string
          title: Url
          description: >-
            Stripe Checkout page for this purchase. Open it in a browser so the
            card owner can review and pay.
          example: https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5F6g7H8i9J0
      type: object
      required:
        - session_id
        - url
      title: TopUpCheckoutSession
    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.