> ## 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.

# Configure live Stripe keys

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

Switches the app to live mode using live Stripe keys you already have from the Stripe dashboard, sent directly in the request body, rather than keys Base44 creates for you. Use [Provision live Stripe keys](/api-reference/provision-live-stripe-keys) instead to have Base44 create them automatically once the sandbox's Stripe account is activated.

Stores the keys, backs up the current test credentials, and redeploys backend functions with the updated secrets.

Base44 checks the key prefixes and retrieves the secret key's Stripe account. When that account differs from the sandbox's installed live account, Base44 registers a separately signed webhook for payment analytics before storing the keys. The secret key needs account read and webhook management permissions for this setup. Base44 doesn't verify that the publishable key belongs to the same account or that the account can process payments.

Automatic migration of an existing app-function webhook remains best effort.

If retiring the previous analytics destination fails, the new keys may already be stored. Retry the same configuration to finish the pending setup.

Requires write access to the app. Workspace viewers cannot call this operation.



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/payments/stripe/configure-live-keys
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/payments/stripe/configure-live-keys:
    post:
      summary: Configure live Stripe keys
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Switches the app to live mode using live Stripe keys you already have
        from the Stripe dashboard, sent directly in the request body, rather
        than keys Base44 creates for you. Use [Provision live Stripe
        keys](/api-reference/provision-live-stripe-keys) instead to have Base44
        create them automatically once the sandbox's Stripe account is
        activated.


        Stores the keys, backs up the current test credentials, and redeploys
        backend functions with the updated secrets.


        Base44 checks the key prefixes and retrieves the secret key's Stripe
        account. When that account differs from the sandbox's installed live
        account, Base44 registers a separately signed webhook for payment
        analytics before storing the keys. The secret key needs account read and
        webhook management permissions for this setup. Base44 doesn't verify
        that the publishable key belongs to the same account or that the account
        can process payments.


        Automatic migration of an existing app-function webhook remains best
        effort.


        If retiring the previous analytics destination fails, the new keys may
        already be stored. Retry the same configuration to finish the pending
        setup.


        Requires write access to the app. Workspace viewers cannot call this
        operation.
      operationId: >-
        configure_live_keys_api_apps__app_id__payments_stripe_configure_live_keys_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the Base44 app.
            title: App Id
          description: ID of the Base44 app.
          example: 6820f3a4e7b91d003c45a1f2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigureLiveKeysRequest'
      responses:
        '200':
          description: The operation result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeLiveKeysResult'
        '400':
          description: >-
            A key has an invalid prefix, Stripe rejects the secret key or
            webhook setup, or the key lacks account read or webhook management
            permissions.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            The credential is not permitted or you don't have the required app
            access. A missing app also fails the app access check. Setup and
            catalog operations also return `app_payment_management_not_allowed`
            when the app's workspace restricts payment management.
        '404':
          description: No Stripe sandbox exists or the app is outside the credential grant.
        '409':
          description: >-
            `stripe_tracking_account_mismatch`: Restore the previous account's
            key and retry. `stripe_tracking_setup_in_progress`: Finish
            configuring the pending account, or disconnect Stripe before
            switching accounts.
          content:
            application/json:
              examples:
                stripe_tracking_account_mismatch:
                  summary: stripe_tracking_account_mismatch
                  value:
                    error:
                      code: stripe_tracking_account_mismatch
                      message: >-
                        Restore the previous Stripe account's key before
                        removing its payment tracking.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '422':
          description: >-
            The body is missing, `publishable_key` or `secret_key` is missing,
            or a value doesn't match its field's type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: >-
            `stripe_tracking_setup_unavailable` or
            `stripe_tracking_secret_unavailable`: Stripe or credential
            decryption is temporarily unavailable. Retry later.
          content:
            application/json:
              examples:
                stripe_tracking_setup_unavailable:
                  summary: stripe_tracking_setup_unavailable
                  value:
                    error:
                      code: stripe_tracking_setup_unavailable
                      message: >-
                        Stripe is temporarily unavailable. Try configuring live
                        keys again later.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    ConfigureLiveKeysRequest:
      properties:
        publishable_key:
          type: string
          title: Publishable Key
          description: Live Stripe publishable key beginning with `pk_live_`.
          example: pk_live_example
        secret_key:
          type: string
          title: Secret Key
          description: >-
            Live Stripe secret or restricted key beginning with `sk_live_` or
            `rk_live_`.
          example: sk_live_example
        webhook_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Secret
          description: >-
            Live webhook signing secret beginning with `whsec_`. Defaults to
            `null`, which attempts automatic migration when an existing webhook
            secret is present.
          example: whsec_example
      type: object
      required:
        - publishable_key
        - secret_key
      title: ConfigureLiveKeysRequest
      description: Request to configure live mode API keys.
    StripeLiveKeysResult:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether live keys were stored and the app was switched to live mode.
          example: true
        message:
          type: string
          title: Message
          description: Human-readable configuration result.
          example: >-
            Live mode API keys configured successfully. Test keys have been
            backed up.
        live_keys_configured:
          type: boolean
          title: Live Keys Configured
          description: >-
            Whether the stored completion flag was confirmed. It can be `false`
            even after keys were stored if finalization failed.
          example: true
        webhook_migrated:
          type: boolean
          title: Webhook Migrated
          description: >-
            Whether this call automatically migrated the webhook. It is `false`
            when a webhook secret was supplied directly.
          example: false
      type: object
      required:
        - success
        - message
        - live_keys_configured
        - webhook_migrated
      title: StripeLiveKeysResult
      description: The result of storing live Stripe credentials.
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
    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.