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

# Retry failed payment

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

Retries the overdue invoice on your workspace's subscription after a renewal payment fails and the subscription is past due. Only the workspace owner can retry.

<Warning>This charges the saved payment method right away, with no confirmation step.</Warning>

If the subscription is already active again, nothing is charged and `success` is `true`. If the bank asks the payer to confirm the payment, `success` is `false`: send them to `payment_action_url`. A declined card returns 400. Update the card with [Create billing portal session](/api-reference/create-billing-portal-session) and `flow_type` set to `payment_method_update`, then retry.

This works for subscriptions billed through Stripe. It doesn't pay an overdue invoice on a workspace billed through Wix.

The base rate limit is 5 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/retry-payment
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/retry-payment:
    post:
      summary: Retry failed payment
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Retries the overdue invoice on your workspace's subscription after a
        renewal payment fails and the subscription is past due. Only the
        workspace owner can retry.


        <Warning>This charges the saved payment method right away, with no
        confirmation step.</Warning>


        If the subscription is already active again, nothing is charged and
        `success` is `true`. If the bank asks the payer to confirm the payment,
        `success` is `false`: send them to `payment_action_url`. A declined card
        returns 400. Update the card with [Create billing portal
        session](/api-reference/create-billing-portal-session) and `flow_type`
        set to `payment_method_update`, then retry.


        This works for subscriptions billed through Stripe. It doesn't pay an
        overdue invoice on a workspace billed through Wix.


        The base rate limit is 5 requests per hour per user. See [Rate
        limits](/developers/references/apps-api/get-started/rate-limits) for the
        multiplier your plan gets.
      operationId: retry_payment_api_billing_retry_payment_post
      responses:
        '200':
          description: The invoice is paid, or the payer has to confirm the payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRetryResult'
              example:
                success: false
                payment_action_url: >-
                  https://invoice.stripe.com/i/acct_1N3XrmDr56L89dkK/live_YWNjdF8xTjNYcm1EcjU2TDg5ZGtL
        '400':
          description: >-
            The workspace has no active subscription, it isn't past due, there's
            no open invoice, or the card was declined.
        '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.
        '429':
          description: >-
            Rate limit exceeded. The base rate limit is 5 requests per hour per
            user. See [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    PaymentRetryResult:
      properties:
        success:
          type: boolean
          title: Success
          description: >-
            `true` when the invoice is paid, or was already. `false` when the
            payer has to confirm the payment.
          example: true
        payment_action_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Action Url
          description: >-
            Stripe page where the payer confirms the payment when `success` is
            `false`. Otherwise `null`.
          example: >-
            https://invoice.stripe.com/i/acct_1N3XrmDr56L89dkK/live_YWNjdF8xTjNYcm1EcjU2TDg5ZGtL
      type: object
      required:
        - success
        - payment_action_url
      title: PaymentRetryResult
      description: The outcome of retrying an overdue payment.
    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.
    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
  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.