﻿---
name: bank131-payments-with-yoomoney
description: Use when the user asks about accepting payments through YooMoney wallets: one-time, recurring (MIT), and hold payments, the payment flow with `session/init/payment`, `payment_details` with `type: wallet` and `wallet.type: yoomoney` (the `yoomoney` object is passed empty), the webhooks `ready_to_confirm`, `action_required` (redirect via `customer_interaction.redirect.url`), `ready_to_capture`, and `payment_finished`, wallet-level payment limits, and recurring payments with `payment_options.recurrent` and the `recurrent.token` in `payment_details`.
---

### How it works

You can accept payments through YooMoney wallets, including one-time payments, recurring payments, and payments with a hold. Refunds for YooMoney wallet payments are made in the standard way.

All parameters are passed in plain text; you do not need a widget.

### One-time payment flow

1. Send `session/init/payment`. Optionally pass the URL to return the payer to after the payment in `payment_options.return_url`.
   The payment size limits depend on the level of the YooMoney wallet.
2. Wait for the `ready_to_confirm` webhook — the Bank is ready to process the payment and is waiting for your confirmation.
3. Confirm the payment with `session/confirm` or cancel it with `session/cancel`.
4. Wait for the `action_required` webhook and redirect the user by the link in `customer_interaction.redirect.url`. After the `action_required` webhook you have 20 minutes to confirm the payment.
5. If holds are enabled, wait for the `ready_to_capture` webhook and then capture with `session/capture` or cancel with `session/cancel`.
6. Wait for the `payment_finished` webhook. The payment result comes in the `status` field of the `acquiring_payments`/`payment_list` array. The `succeeded` status means the payment succeeded; `failed` means it failed due to an error.

### Recurring payments (MIT)

Recurring CIT payments through YooMoney wallets are not supported.

To make recurring MIT payments through YooMoney wallets:

1. Get a recurring token by passing `recurrent=true` in `payment_options`. If the payment succeeds, the token is returned in `recurrent.token` in the `payment_finished` webhook.
2. For subsequent payments, pass the recurring token in `payment_details`.

### Objects

`payment_details` for a YooMoney wallet payment:

- `type` — `wallet`;
- `wallet.type` — `yoomoney`;
- `wallet.yoomoney` — passed empty (`{}`) for payments.

`payment_details` for a recurring payment:

- `type` — `recurrent`;
- `recurrent.token` — the recurring token.

`wallet` (used for payouts to a YooMoney wallet):

- `type` — `yoomoney`;
- `yoomoney.account` — the YooMoney wallet number, 11–20 digits, for example `4100175017397`;
- `yoomoney.description` — the payout purpose, up to 128 characters.

`payment_options`:

- `return_url` — the URL to redirect the user to after the payment. Required for payments without a payment widget. Do not use `localhost` or `127.0.0.1` values — requests with them are not processed;
- `recurrent` — whether the payment is made with a saved token.

`recurrent`:

- `token` — the token;
- `initiator` — the recurring payment type: `merchant` for a MIT payment (default) or `client` for a CIT payment.
