Skip to main content

CIT recurring payments

CIT (Customer Initialized Transaction) recurring payments allow to accept payments and debit money using a token with additional 3D Secure verification of the customer.

For CIT recurring payments, it is recommended to use the project identifier eligible for 3D Secure.

How to create a CIT recurring payment

  1. Initialize a CIT recurring payment session using the session/init/payment method, with the initiator:client value in the recurrent object and a URL value within the return_url setting to redirect the customer back after the payment complete.
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/init/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "token_value",
"initiator": "client"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"return_url": "https://131.ru"
}
}'
  1. Wait for an action_required webhook from Bank 131 that contains the customer redirect data.
Webhook example
curl -X POST \
https://partner.ru \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "action_required",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"acquiring_payments": [
{
"id": "pm_131",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user@131.ru"
},
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "token_value",
"initiator": "client"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"amounts": {
"fee": {
"merchant_fee": {
"amount": 10,
"currency": "RUB"
}
}
},
"customer_interaction": {
"type": "redirect",
"redirect": {
"url": "https://bank131.ru?foo=bar",
"base_url": "https://bank131.ru",
"method": "GET",
"qs": {
"foo": "bar"
},
"params": {
"paReq": "sdfew^//asdhbv",
"MD": "abc75daefnn"
}
}
}
}
]
}
}'
  1. Redirect the customer to the URL passed as customer_interaction.redirect.url. Note that the redirect method can be GET or POST.
  2. Wait for a payment_finished webhook from Bank 131. The webhook contains the recurring payment status information.
Webhook example
{
"type": "payment_finished",
"session": {
"id": "ps_3230",
"status": "accepted",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"acquiring_payments": [
{
"id": "pm_2705",
"status": "succeeded",
"created_at": "2018-05-27T02:03:00.000000Z",
"finished_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "token_value",
"initiator": "client"
}
},
"recurrent": {
"token": "feda2b2106a2e8747bbdc4c9f53c7f5f6ab845ffa1b7cc68ca839720af99b3d1",
"created_at": "2020-07-14T13:17:11+03:00",
"finished_at": "2020-07-31T16:05:42+03:00",
"is_active": true
},
"amount_details": {
"amount": 10000,
"currency": "rub"
}
}
]
}
}
  1. Note that after completion of 3D Secure verification, the customer returns to the URL that was passed as return_url. According to the method used, POST or GET, you might be required to convert the POST format to GET to avoid possible format processing issues.

CIT recurring payment scheme