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

# Обновить способ оплаты

> Частично обновляет способ оплаты

Частично обновляет способ оплаты: меняются только переданные поля.

* `type` изменить нельзя, он игнорируется.
* `settings` объединяются с сохранёнными по ключам, поэтому можно поменять один ключ, не передавая данные доступа заново. `manualTextRequisites` заменяется целым списком.
* `public_name: null` или пустая строка сбрасывает название для подписчиков на название типа.

<Warning>
  Для `stripe` вебхук регистрируется заново только при смене `secret_key`. Если Stripe отклоняет новый ключ, ничего не сохраняется и возвращается `422` с ошибкой в `settings.secret_key`.
</Warning>


## OpenAPI

````yaml PATCH /api/v1/payment-systems/{paymentSystem}
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.
  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: 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/payment-systems/{paymentSystem}:
    patch:
      tags:
        - Payment systems
      summary: Update payment method
      description: >-
        Partially updates a payment method. Sent settings are merged over the
        stored ones, so a single key can be changed without resending
        credentials. For `stripe`, the webhook is registered again only when
        `secret_key` changes; if Stripe rejects the new key, nothing is saved
        and 422 is returned with the error under `settings.secret_key`.
      operationId: updatePaymentSystem
      parameters:
        - name: paymentSystem
          in: path
          required: true
          description: Payment method ID
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentSystemUpdateInput'
      responses:
        '200':
          description: Payment method updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PaymentSystem'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Payment method not found in this account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Validation error: empty setting, unfilled requisites, bot message
            too long, duplicate `name`, or Stripe connection error
            (`settings.secret_key`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PaymentSystemUpdateInput:
      type: object
      description: >-
        Partial update: only sent fields change. `type` cannot be changed and is
        ignored.
      properties:
        name:
          type: string
          maxLength: 255
          description: Internal name, unique within the account (case-insensitive)
        public_name:
          type: string
          nullable: true
          maxLength: 255
          description: >-
            Name shown to subscribers; empty or `null` resets it to the type
            name
        settings:
          allOf:
            - $ref: '#/components/schemas/PaymentSystemSettingsInput'
          description: >-
            Merged over the stored settings by key: omitted keys keep their
            values.
    PaymentSystem:
      type: object
      properties:
        id:
          type: integer
          description: Payment method ID
        name:
          type: string
          description: Internal name, unique within the account
        public_name:
          type: string
          nullable: true
          description: Name shown to subscribers; `null` means the type name is shown
        type:
          type: string
          description: >-
            Payment method type, see [List payment method
            types](/api-reference/payment-systems/types)
        type_name:
          type: string
          description: Human-readable type name
        supports_subscription:
          type: boolean
          description: Whether the type supports recurring payments
        sort:
          type: integer
          description: Position in the account list
        settings:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Full settings for `manually` (texts and requisites) and
            `telegramstars` (`bot_only`); `null` for other types. An empty set
            is returned as an empty array `[]`.
        credentials_set:
          type: boolean
          nullable: true
          description: >-
            For automatic types: whether every credential is filled. Credentials
            themselves are never returned. `null` for `manually` and
            `telegramstars`.
        created_at:
          type: string
          format: date-time
          nullable: true
          description: Creation timestamp
    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
    PaymentSystemSettingsInput:
      type: object
      additionalProperties: true
      description: >-
        Settings for the payment method type. Allowed keys depend on `type` —
        see [List payment method types](/api-reference/payment-systems/types).
        Unknown keys are dropped, text values are trimmed, and every credential
        key of the type is required.


        | Type | Keys |

        |---|---|

        | `wayforpay` | `domain`, `seller_id`, `seller_secret` |

        | `fondy` | `merchant_id`, `secret_key` |

        | `monobank` | `api_token` |

        | `paypal` | `client_id`, `client_secret`, `webhook_id` |

        | `stripe` | `secret_key` |

        | `mollie` | `api_key` |

        | `nowpayments` | `api_key`, `ipn_secret_key` |

        | `whitepay` | `api_key`, `slug`, `webhook_token` |

        | `liqpay` | `public_key`, `private_key` |

        | `telegramstars` | `bot_only` (boolean, defaults to `true` on create) |

        | `manually` | `manualIcon`, `manualTextIntro`, `manualTextIntroShop`,
        `manualTextRequisites`, `manualTextPaymentProof`,
        `manualTextPaymentDone`, `manualTextButton`, `manualAppWaitingHeading`,
        `manualAppWaitingText`, `manualAppWaitingButton` |


        For `manually`, every text key except `manualIcon` and
        `manualTextIntroShop` is required, and `manualTextRequisites` must
        contain at least one row with both `name` and `value` filled. The
        resulting bot message must fit into 4000 characters.
      properties:
        manualTextRequisites:
          type: array
          items:
            $ref: '#/components/schemas/ManualPaymentRequisite'
          description: Only for `manually`. Replaces the whole list on update.
        bot_only:
          type: boolean
          description: 'Only for `telegramstars`: show the method only in the bot'
    ManualPaymentRequisite:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          description: Requisite label, e.g. `IBAN`
        value:
          type: string
          description: Requisite value the subscriber copies
  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.