Recurring Payments are an agreement between your business and a customer to process a repeated series of payments.
In SCA-mandated regions, the initial payment must be a Customer-Initiated Transaction (CIT), even if the customer is using a saved payment method. Once this initial transaction is successful, you can then process subsequent recurring payments without the cardholder being present.
This type of payment can be initiated by the Main Account holder using the Ryft Portal for payments directed to their own account. Alternatively, it can be performed using the API for greater flexibility, such as when the payment is being processed on behalf of a Sub-Account.
For more information about Recurring Payments, please refer to this page.
Let's consider a homeowner (Customer) who wants to pay their monthly electricity bill automatically to avoid late fees.
An electricity provider (Main Account) can offer a service to simplify billing and ensure timely payments.
The Customer gives the provider ongoing permission to charge their account (CIT).
At the end of each billing cycle, the provider calculates the exact amount owed based on the customer's energy consumption. The pre-arranged recurring payment system then automatically processes a payment for the precise amount of the bill on the due date.
The following is an example of how to create a Payment Session for a recurring payment using the paymentSessionCreate endpoint.
Request Example:
{
"amount": 3000,
"currency": "GBP",
"customerEmail": "customer@mail.com",
"paymentType": "Recurring",
"rebillingDetail": {
"amountVariance": "Variable",
"numberOfDaysBetweenPayments": 30,
"totalNumberOfPayments": 12,
"currentPaymentNumber": 1,
"expiry": 1776988800
}
}This configuration will result in the initialisation of a payment where the Customer will be charged a variable (rebillingDetail.amountVariance) amount of £30.00 (price.amount).
This charge will occur every 30 days for 12 cycles. The payment session also indicates that this is the first payment in the series (rebillingDetail.currentPaymentNumber). The rebillingDetail.expiry field (optional) indicates the end date of the recurring payment series, which in this case is set to 1776988800 (Unix timestamp).
Provided the request was successful, the API returns a payload containing the details of the payment initialisation, including the clientSecret value, which is required to process the first payment and the Payment Session ID (id field) which is needed for subsequent payments.
Once the initial payment is processed, you will have available a Customer ID and their Payment Method ID used for the initial payment. You can now use these to process subsequent payments without requiring the customer to be present.
To process a subsequent payment, you can choose whether to charge the Customer immediately or to process the payment later using the attempt-payment endpoint.
In either case a new Payment Session must be created with the Customer ID, Payment Method ID and the previous Payment Session ID.
{
"amount": 3400,
"currency": "GBP",
"customerDetails": {
"id": "cus_XXXXXXX", // Customer ID
},
"paymentType": "Recurring",
"previousPayment": {"id": "ps_XXXXXXX"}, // Initial Payment Session ID where the 3DS was completed
"rebillingDetail": {
"amountVariance": "Variable",
"numberOfDaysBetweenPayments": 30,
"totalNumberOfPayments": 12,
"currentPaymentNumber": 2, // This is the second payment in the series
"expiry": 1776988800
},
"attemptPayment": {
"paymentMethod": {
"id": "pmt_123456789" // Payment Method ID
}
}
}With this configuration, the Customer (customerDetails.id) will be charged immediately upon creation of the Payment Session for the new amount of £34.00, as specified in the amount field. This payment will be processed using the Payment Method ID provided in the attemptPayment.paymentMethod.id field.
If you are a marketplace business, you can also set up recurring payments for your Sub-Accounts. The process is similar to the one described above, but you will need to include the Sub-Account ID in the headers of the Payment Session creation request.
Recurring Payments can also be managed through the Ryft Portal. You can view and manage your Payment Sessions, including those for Recurring Payments, directly from the Portal interface.
Recurring payments can be created from the Payments page within the Ryft Portal. Click the Create Payment button and select Recurring as a Payment Type. The aforementioned fields about the payment amount, currency, customer email, and rebilling details need to be provided in the form that appears.
The Collect Payment Details button can be clicked to enter the customer's card details. After entering the card information, the payment can be processed.
Payments created and processed using the Recurring Payment model can be viewed in the Ryft Portal as follows:
- For recurring payments directed to the Main Account holders, they can be found on the Payments page.
- For recurring payments directed to Sub-Accounts, they can be viewed on the Payments page by applying filters: set Account Type to Sub-accounts and enter the relevant Sub-Account ID.
- For Sub-Accounts onboarded using the Hosted flow, they can be viewed on the Payments page, when recurring payments are directed to them.
- Process Recurring payments - see here.