﻿---
name: bank131-payments-with-hold
description: Use when the user asks about payments with a hold (delayed capture): the two-stage card payment flow (authorization and clearing), enabling holds on the Bank 131 side (contact the manager), the 5-day hold period with automatic release of funds, the no-widget flow with `session/create`/`session/init/payment`, `session/start/payment`, `session/confirm`, `session/cancel`, and the webhooks `ready_to_confirm`, `ready_to_capture`, `action_required`, `payment_finished`, and capturing the full or a smaller amount with `session/capture` and `amount_details`.
---

### How it works

All bank card payments go through two stages: authorization (the Bank checks that the required amount is on the card and blocks it) and clearing (the Bank debits the money). With a regular card payment there is practically no pause between these stages.

With a hold, you decide when to run clearing. The Bank does not debit the money right away but on your command. You can capture the full held amount or less.

### Enabling holds

Holds are enabled on the Bank 131 side. All your payments either always run with a hold or always without it (then the amount is debited automatically right after authorization). To enable holds, contact your manager at Bank 131.

### Hold period

Money is frozen on the card for up to **5 days**. If you do not capture the funds or release them before this deadline, they are released automatically.

If you want the money to be debited rather than released when the hold period ends, contact your manager at Bank 131.

> For MIT payments through YooMoney wallets, only the full capture of the held amount is possible.

### Payment flow with a hold (no widget)

1. Create a payment session separately from the payment (`session/create`) or together with it (`session/init/payment`).
2. If you created the session separately, send `session/start/payment`.
3. Wait for the `ready_to_confirm` webhook — the Bank is ready to process the payment and is waiting for your confirmation.
4. Confirm the payment with `session/confirm` or cancel it with `session/cancel`.
5. If you get the `action_required` webhook, additional actions are needed, for example the user must pass 3D Secure. Redirect the user to the 3D Secure address.
6. Wait for the `ready_to_capture` webhook — the money is frozen on the user's card. You can capture it immediately or later, the full held amount or less — pass the required amount in `amount_details`.
7. Capture the held amount or less with `session/capture`, or cancel the payment with `session/cancel`.
8. Wait for the `payment_finished` webhook with the payment result. The `succeeded` status means the payment succeeded.

### Payment flow with the payment form widget

1. Follow steps 1–5 of the payment form widget flow.
   > If you get the `action_required` webhook, reply with HTTP 200 OK — the user will be redirected for 3D Secure inside the widget.
2. Wait for the `ready_to_capture` webhook — the money is frozen on the user's card. Capture the full held amount or less via `session/capture`, or cancel the payment via `session/cancel`.
3. Wait for the `payment_finished` webhook with the payment result. The `succeeded` status means the payment succeeded.

### Methods and parameters

- `session/capture` — captures the held amount. The `session_id` parameter is required. The optional `amount_details` object holds the amount to capture: it can be less than the held amount but must be greater than 0. If `amount_details` is omitted, the full held amount is captured. The response contains `status` (`ok` or `error`), the optional `session` object, and the optional `error` object.
- `session/confirm` — confirms an operation the Bank is ready to process. Confirmation must be sent within 4 hours (240 minutes) after the operation is created, otherwise the operation finishes with the error `confirm_timeout` and status `canceled`.
- `session/cancel` — cancels an operation. Send it when the Bank is ready to process an operation, for example after the `ready_to_confirm` or `ready_to_capture` webhook.

`amount_details`:

- `amount` — the amount in the minor units of the currency (in kopecks). To send 100 rubles, specify `10000`;
- `currency` — the currency code per ISO 4217, case does not matter. Options: `rub`, `eur`.

### Webhooks

- `ready_to_confirm` — the Bank is ready to process the operation and is waiting for your confirmation or cancellation.
- `ready_to_capture` — the money is frozen; the session has `next_action: capture`. The Bank waits for your command: capture with `session/capture` or cancel with `session/cancel`. If you work with delayed payments, Bank 131 always sends this webhook before capturing.
- `action_required` — additional user actions are needed, for example 3D Secure.
- `payment_finished` — the operation finished. The result is in the `status` field; `succeeded` means the payment succeeded.
