> ## 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 payment method update session

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

Creates a link to the Wix page where the workspace owner replaces the payment method that pays for a Wix-billed plan. The link opens a hosted page: open it in a browser, and the owner changes the card there. The page doesn't send them back to Base44 afterwards. You can't change the card through the API. Only the workspace owner can create the link.

Set `open_other_payment_methods_tab` to `true` to open the page on adding a new payment method instead of editing the current one.

This works only for workspaces billed through Wix. For a Stripe-billed workspace, use [Create billing portal session](/api-reference/create-billing-portal-session) with `flow_type` set to `payment_method_update`. Wix billing is still rolling out, so this can return 404 for your account.

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



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/billing/create-update-payment-method-portal-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/create-update-payment-method-portal-session:
    post:
      summary: Create payment method update session
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Creates a link to the Wix page where the workspace owner replaces the
        payment method that pays for a Wix-billed plan. The link opens a hosted
        page: open it in a browser, and the owner changes the card there. The
        page doesn't send them back to Base44 afterwards. You can't change the
        card through the API. Only the workspace owner can create the link.


        Set `open_other_payment_methods_tab` to `true` to open the page on
        adding a new payment method instead of editing the current one.


        This works only for workspaces billed through Wix. For a Stripe-billed
        workspace, use [Create billing portal
        session](/api-reference/create-billing-portal-session) with `flow_type`
        set to `payment_method_update`. Wix billing is still rolling out, so
        this can return 404 for your account.


        The base rate limit is 20 requests per hour per user. See [Rate
        limits](/developers/references/apps-api/get-started/rate-limits) for the
        multiplier your plan gets.
      operationId: >-
        create_update_payment_method_portal_session_api_billing_create_update_payment_method_portal_session_post
      parameters:
        - name: open_other_payment_methods_tab
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              `true` opens the page on adding a new payment method instead of
              editing the current one. Defaults to `false`.
            default: false
            title: Open Other Payment Methods Tab
          description: >-
            `true` opens the page on adding a new payment method instead of
            editing the current one. Defaults to `false`.
          example: true
      responses:
        '200':
          description: A link to the Wix payment method page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingPageUrl'
              example:
                url: >-
                  https://manage.wix.com/account/billing/payment-methods?token=7c1e9f2a4b8d4e6f9a3c5b7d1e2f4a6c
        '400':
          description: >-
            The workspace isn't billed through Wix, has no Wix billing account,
            or has no saved payment method to update.
        '401':
          description: >-
            Missing or invalid credentials. A read-only token gets this response
            too.
        '403':
          description: >-
            You aren't the workspace owner, or a payment dispute is open on the
            workspace.
        '404':
          description: Wix billing isn't available to your account yet.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - type: bool_parsing
                    loc:
                      - query
                      - open_other_payment_methods_tab
                    msg: Input should be a valid boolean, unable to interpret input
                    input: maybe
        '429':
          description: >-
            Rate limit exceeded. The base rate limit is 20 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:
    BillingPageUrl:
      properties:
        url:
          type: string
          title: Url
          description: >-
            Link to a hosted page. Open it in a browser for a person to finish
            there. Some links work only once or expire, so open it right away
            and don't store it.
          example: >-
            https://billing.stripe.com/p/session/live_YWNjdF8xTjNYcm1EcjU2TDg5ZGtL
      type: object
      required:
        - url
      title: BillingPageUrl
      description: A hosted billing page for a person to open.
    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.