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

# Update revenue recovery settings

> Changes payment retries, failed charge notifications and the monthly report; only the passed fields change.



## OpenAPI

````yaml PATCH /api/v1/bot/{bot}/subscriptions/revenue-recovery
openapi: 3.1.0
info:
  title: Zenedu API v1
  description: >-
    API for managing Telegram bots, subscribers, products, funnels, offers, and
    orders on the Zenedu platform. API v1 returns JSON by default; the Accept:
    application/json header is optional. File downloads return the file content,
    and 204 responses have no body. Errors returned by the application use JSON
    even when Accept is omitted.
  version: 1.0.0
servers:
  - url: https://app.zenedu.io
security:
  - bearerAuth: []
tags:
  - name: User
    description: Current user profile
  - name: Bots
    description: Bot management
  - name: Subscribers
    description: Subscriber management
  - name: Orders
    description: Order management
  - name: Products
    description: Product management
  - name: Funnels
    description: Funnel management
  - name: Offers
    description: Offer management
  - name: Links
    description: Link generation
  - name: Files
    description: File downloads
  - name: Zapier
    description: Zapier webhook management
  - name: Webhooks
    description: Account webhook subscriptions
  - name: Payment systems
    description: Account payment methods
  - name: Bot settings
    description: 'Bot configuration: email, branding, integrations, legal documents'
  - name: Commands
    description: Bot menu commands
  - name: Custom fields
    description: Subscriber custom fields
  - name: Tags
    description: Subscriber tags of the bot
  - name: Folders
    description: Folders for products, funnels, channels and groups
  - name: Slugs
    description: Public link slugs
  - name: Funnel links
    description: Subscription links of a funnel
  - name: Coupons
    description: Coupon management
  - name: Subscriptions
    description: Recurring subscription management
  - name: Tasks
    description: Student task review
  - name: Broadcasts
    description: Broadcast messages
  - name: Automations
    description: Event-based automations
  - name: Affiliate
    description: Affiliate program management
  - name: Shop
    description: Bot shop draft and publication
  - name: Channels
    description: Telegram channels connected to the bot
  - name: Groups
    description: Telegram groups connected to the bot
  - name: Mini-app
    description: Telegram mini app configuration
  - name: Web
    description: Web app configuration
  - name: Telegram files
    description: Telegram file attachments for steps and broadcasts
paths:
  /api/v1/bot/{bot}/subscriptions/revenue-recovery:
    patch:
      tags:
        - Subscriptions
      summary: Update revenue recovery settings
      description: >-
        Changes only the passed fields: payment retries, failed charge
        notifications per stage and the monthly report. The flexible schedule
        and own texts and buttons need the Pro plan (422 with code
        `pro_required` otherwise). Already planned retries keep their schedule:
        new values apply to charges that fail from now on. Reminders before a
        charge are changed with PUT …/revenue-recovery/reminders. Returns the
        full settings.
      operationId: updateRevenueRecovery
      parameters:
        - name: bot
          in: path
          required: true
          description: Bot ID
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RevenueRecoverySettingsInput'
      responses:
        '200':
          description: Revenue recovery settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/RevenueRecoverySettings'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden — lacks access to this bot or to the Subscriptions section
            (manage orders)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error or the Pro plan is required (code `pro_required`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RevenueRecoverySettingsInput:
      type: object
      description: Only the passed fields change.
      properties:
        retries_enabled:
          type: boolean
          description: >-
            Repeat a failed scheduled charge by the schedule; off = the
            subscription is cancelled right after the failed charge
        schedule:
          type: string
          enum:
            - standard
            - flexible
          description: '`flexible` needs the Pro plan'
        attempts:
          type: integer
          minimum: 1
          maximum: 10
          description: >-
            Flexible schedule: number of attempts, at most one per day; pass
            together with `period_days` and not more than `period_days`
        period_days:
          type: integer
          minimum: 3
          maximum: 30
          description: >-
            Flexible schedule: recovery period in days after the failed
            scheduled charge; pass together with `attempts`
        failed_charge_enabled:
          type: object
          description: Switch per stage; any plan
          properties:
            first:
              type: boolean
            intermediate:
              type: boolean
            last:
              type: boolean
              description: Off = the subscriber gets the standard cancellation message
        failed_charge_texts:
          type: object
          description: >-
            Own text per stage, Telegram HTML with placeholders `{{name}}`,
            `{{offer}}`, `{{price}}`, `{{next_attempt_date}}`; blank = the
            default text (Pro)
          properties:
            first:
              type: string
              nullable: true
              maxLength: 4000
            intermediate:
              type: string
              nullable: true
              maxLength: 4000
            last:
              type: string
              nullable: true
              maxLength: 4000
        failed_charge_buttons:
          type: object
          description: >-
            Text of the «Pay with another card» button under the first and
            intermediate notifications; blank = the default text (Pro)
          properties:
            first:
              type: string
              nullable: true
              maxLength: 64
            intermediate:
              type: string
              nullable: true
              maxLength: 64
        monthly_report_enabled:
          type: boolean
    RevenueRecoverySettings:
      type: object
      properties:
        is_pro:
          type: boolean
          description: >-
            Whether the Pro-only values (flexible schedule, extra reminders, own
            texts) are in effect
        retries:
          type: object
          properties:
            enabled:
              type: boolean
            schedule:
              type: string
              enum:
                - standard
                - flexible
              description: >-
                `standard`: up to 5 retries within 10 days, shortened for short
                subscriptions. `flexible`: own `attempts` and `period_days`
                (Pro).
            attempts:
              type: integer
              description: Stored attempts of the flexible schedule
            period_days:
              type: integer
              description: Stored recovery period of the flexible schedule, days
            retry_days:
              type: array
              items:
                type: integer
              description: >-
                Days after a failed scheduled charge on which retries are
                planned for long subscriptions; empty while retries are off
        upcoming_reminders:
          type: object
          properties:
            enabled:
              type: boolean
            reminders:
              type: array
              items:
                type: object
                properties:
                  days:
                    type: integer
                    description: Days before the scheduled charge
                  text:
                    type: string
                    description: Text of the reminder, Telegram HTML
              description: Reminders in effect
            saved_reminders:
              type: array
              items:
                type: object
                properties:
                  days:
                    type: integer
                    description: Days before the scheduled charge
                  text:
                    type: string
                    description: Text of the reminder, Telegram HTML
              description: Saved reminders, kept while reminders are off
            locked_reminder_days:
              type: array
              items:
                type: integer
              description: Days of reminders saved on Pro that the Basic plan does not send
        failed_charge_notification:
          type: object
          description: >-
            Notifications after a failed charge by stage: `first` — the
            scheduled charge failed and retries are planned, `intermediate` — a
            retry failed and retries remain, `last` — the last retry failed and
            the subscription is cancelled
          properties:
            first:
              type: object
              properties:
                enabled:
                  type: boolean
                text:
                  type: string
                  description: Effective text of the notification, Telegram HTML
                button:
                  type: string
                  description: Text of the «Pay with another card» button
            intermediate:
              type: object
              properties:
                enabled:
                  type: boolean
                text:
                  type: string
                  description: Effective text of the notification, Telegram HTML
                button:
                  type: string
                  description: Text of the «Pay with another card» button
            last:
              type: object
              properties:
                enabled:
                  type: boolean
                text:
                  type: string
                  description: Effective text of the notification, Telegram HTML
        monthly_report:
          type: object
          properties:
            enabled:
              type: boolean
              description: >-
                On the 1st the owner gets a message in the Zenedu bot with the
                recovered payments of the last month
        limits:
          type: object
          properties:
            reminders_max:
              type: integer
              description: 1 on Basic, 3 on Pro
            reminder_days_min:
              type: integer
            reminder_days_max:
              type: integer
            attempts_min:
              type: integer
            attempts_max:
              type: integer
            period_days_min:
              type: integer
            period_days_max:
              type: integer
            standard_attempts:
              type: integer
            standard_period_days:
              type: integer
            text_max_length:
              type: integer
            button_max_length:
              type: integer
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation errors keyed by field name
        code:
          type: string
          description: >-
            Machine-readable code of a business error: unauthorized, not_found,
            conflict, limit_exceeded, quota_exceeded, pro_required. Absent on
            validation errors.
        current_plan:
          type:
            - string
            - 'null'
          description: >-
            Only with code pro_required: the current plan as the dashboard names
            it (Pro, Basic, Trial), null without an active subscription.
        upgrade_url:
          type: string
          description: >-
            Only with code pro_required: the dashboard page where the plan can
            be upgraded.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from the Zenedu dashboard

````

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