Recurring payments
You can save some of the payment methods (with all the payment details) and use them for recurring payments. In this case, the user will only need to confirm the first payment, and all subsequent debits will be automatic.
 
Specifics
Recurring payments are only enabled by default in the demo store. If you want to enable them in your real store, contact the YooMoney manager.
Recurring payments are supported by all integration scenarios, except for Smart payment.
Payment methods that can be used for recurring payments:
The user can revoke their permission for recurring payments at any time.
 
Procedure
Step 1. Save the payment method by saving the user’s means of payment in your store. You can do that after a successful payment. After the user allows the means of payment to be saved in your store and confirms the debit, YooMoney will save the data used for the payment. The payment’s ID will be used as the saved payment method’s ID.
Step 2. Make an autopayment (recurring payment) by initiating the automatic debit from the means of payment saved in the store.
 
Saving the payment method
If you accept payments using the YooMoney Checkout Widget, refer to the corresponding instruction for saving the payment method.
To save a payment method, create a payment with the following parameters:
cURL
PHP
Python
curl https://api.yookassa.ru/v3/payments \
  -X POST \
  -u <Shop ID>:<Secret Key> \
  -H 'Idempotence-Key: <Idempotence Key>' \
  -H 'Content-Type: application/json' \
  -d '{
        "amount": {
          "value": "2.00",
          "currency": "RUB"
        },
        "payment_method_data": {
          "type": "bank_card"
        },
        "confirmation": {
          "type": "redirect",
          "return_url": "https://www.merchant-website.com/return_url"
        },
        "description": "Order No. 72",
        "save_payment_method": "true"
      }'
To get the ID of the saved payment method:
Step 1. Wait until the user confirms the payment, and its status changes to 
succeeded
(or 
waiting_for_capture
if it’s a two-stage payment). You can check the payment status in a notification sent by YooMoney, or you can send periodic requests for payment information .
Step 2. Make sure the payment method is saved: the 
payment_method.saved
value in the payment object has changed to 
true
.
JSON
{
  "id": "22e18a2f-000f-5000-a000-1db6312b7767",
  "status": "succeeded",
  "paid": true,
  "amount": {
    "value": "2.00",
    "currency": "RUB"
  },
  "authorization_details": {
    "rrn": "10000000000",
    "auth_code": "000000",
    "three_d_secure": {
      "applied": true
    }
  },
  "captured_at": "2018-07-18T17:20:50.825Z",
  "created_at": "2018-07-18T17:18:39.345Z",
  "description": "Order No. 72",
  "metadata": {},
  "payment_method": {
    "type": "bank_card",
    "id": "22e18a2f-000f-5000-a000-1db6312b7767",
    "saved": true,
    "card": {
      "first6": "555555",
      "last4": "4444",
      "expiry_month": "07",
      "expiry_year": "2022",
      "card_type": "MasterCard",
      "issuer_country": "RU",
      "issuer_name": "Sberbank"
    },
    "title": "Bank card *4444"
  },
  "refundable": true,
  "refunded_amount": {
    "value": "0.00",
    "currency": "RUB"
  },
  "recipient": {
    "account_id": "100001",
    "gateway_id": "1000001"
  },
  "test": false
}
Step 3. Save the 
payment_method.id
. You’ll need to use it as the identifier of the saved payment method for subsequent payments.
Done!
Now you can make recurring payments.
 
Processing
Using the saved payment method, you can initiate recurring payments, for example, as a regular charge for a subscription or an instant payment for purchases in your store, without the need to enter payment details.
To make an autopayment, create a payment  with a specified amount, transaction description, and the 
payment_method_id
parameter with the saved payment method ID. Such payments don’t require additional confirmation from the user.
cURL
PHP
Python
curl https://api.yookassa.ru/v3/payments \
  -X POST \
  -u <Shop ID>:<Secret Key> \
  -H 'Idempotence-Key: <Idempotence Key>' \
  -H 'Content-Type: application/json' \
  -d '{
        "amount": {
          "value": "2.00",
          "currency": "RUB"
        },
        "payment_method_id": "<Saved payment method's ID>",
        "description": "Order No. 105"
      }'
After a successful payment, the 
payment_method
object will contain information about the payment details of the saved method used for the payment.
JSON
{
  "id": "255350c9-000f-5000-a000-1f211b3ea0a7",
  "status": "succeeded",
  "paid": true,
  "amount": {
    "value": "2.00",
    "currency": "RUB"
  },
  "authorization_details": {
    "rrn": "10000000000",
    "auth_code": "000000",
    "three_d_secure": {
      "applied": true
    }
  },
  "captured_at": "2018-07-18T17:20:50.825Z",
  "created_at": "2018-07-18T17:18:39.345Z",
  "description": "Order No. 72",
  "metadata": {},
  "payment_method": {
    "type": "bank_card",
    "id": "22e18a2f-000f-5000-a000-1db6312b7767",
    "saved": true,
    "card": {
      "first6": "555555",
      "last4": "4444",
      "expiry_month": "07",
      "expiry_year": "2022",
      "card_type": "MasterCard",
      "issuer_country": "RU",
      "issuer_name": "Sberbank"
    },
    "title": "Bank card *4444"
  },
  "refundable": true,
  "refunded_amount": {
    "value": "0.00",
    "currency": "RUB"
  },
  "recipient": {
    "account_id": "100001",
    "gateway_id": "1000001"
  },
  "test": false
}
If the user revoked their permission for recurring payments from the YooMoney wallet, the payment won’t be processed. The 
cancellation_details
object will contain the reason behind the cancellation,
permission_revoked
.
JSON
{
    "id": "24a40656-000f-5000-9000-134108dd5325",
    "status": "canceled",
    "paid": false,
    "amount": {
        "value": "10.00",
        "currency": "RUB"
    },
    "created_at": "2019-06-25T10:08:22.531Z",
    "metadata": {},
    "payment_method": {
        "type": "yoo_money",
        "id": "249ea698-000f-5000-9000-1200128b882c",
        "saved": true
    },
    "recipient": {
        "account_id": "100001",
        "gateway_id": "1000001"
    },
    "refundable": false,
    "test": false,
    "cancellation_details": {
        "party": "yoo_money",
        "reason": "permission_revoked"
    }
}

Do you have any questions or comments regarding the documentation?

We can set up a call and discuss them: we'll help you solve the problem and you'll help us understand what we need to improve. To do that, share your contact information and select the time.
Yes, I'd like to set up a meeting
 
See also
YooMoney Checkout WidgetPayment processPayment methods