Unscheduled Payments allow merchants to charge customers on an ad-hoc basis without the need for the customer to be present. This is particularly useful for businesses that need to process payments at irregular intervals or for one-off purchases.
Similar to Recurring Payments, Unscheduled Payments require an initial payment to be processed with the customer present (CIT). This initial payment captures and securely stores the customer's payment details for future use. Subsequent payments can then be processed without the customer being present (MIT).
For more information about Unscheduled Payments, please refer to this page.
Let's consider a scenario where a ride-sharing service wants to charge customers for rides taken without requiring them to be present for each payment. The service can use Unscheduled Payments to achieve this.
A Customer uses the ride-sharing app to book rides. The ride-sharing service (Main Account) processes an initial payment when the customer first uses the service, capturing their payment details securely.
Whenever the customer books a ride, the ride-sharing service calculates the fare based on the distance and time of the ride. The service then processes an Unscheduled Payment for the exact amount of the fare using the stored payment details.
The following is an example of how to create a Payment Session for an unscheduled payment using the paymentSessionCreate endpoint.
Request Example:
{
"amount": 750, // First use of the service, so a payment is required
"currency": "GBP",
"customerEmail": "customer@mail.com",
"paymentType": "Unscheduled", // Indicate this is an Unscheduled payment
}This configuration will result in the initialisation of a payment where the Customer will be charged a fixed amount of £7.50 (amount). The payment type is set to Unscheduled, indicating that this payment is part of an unscheduled payment process. This initial payment will require the customer to be present to complete the transaction and securely store their payment details.
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": 500,
"currency": "GBP",
"customerDetails": {
"id": "cus_XXXXXXXXXXXXXXXX" // Customer ID
},
"paymentType": "Unscheduled",
"previousPayment": {"id": "ps_XXXXXXXXXXXXX"}, // Initial Payment Session ID where the 3DS was completed
"attemptPayment": {
"paymentMethod": {
"id": "pmt_XXXXXXXXXXXXXXXX" // Payment Method ID
}
}
}With this configuration, the Customer (customerDetails.id) will be charged immediately upon creation of the Payment Session for the amount of £5.00 (amount). 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 unscheduled 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.
Unscheduled Payments can also be managed through the Ryft Portal. You can view and manage your Payment Sessions, including those for Unscheduled Payments, directly from the Portal interface.
Unscheduled payments can be created from the Payments page within the Ryft Portal. Click the Create Payment button and select Unscheduled as a Payment Type. The aforementioned fields about the payment amount, currency and customer email 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 Unscheduled Payment model can be viewed in the Ryft Portal as follows:
- For unscheduled payments directed to the Main Account holders, they can be found on the Payments page.
- For unscheduled 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 unscheduled payments are directed to them.
- Process Unscheduled payments - see here.