Checkout for Scheduled Payments
![]() |
Scheduled payments allow you to collect future payments with variable amounts on specific dates. All payments that belong together are bundled into one Payment Request. Scheduled payments are a type of recurring payment. ![]() Recurring payments (also called repeat payments) are payments that charge the same card or bank account multiple times. The payer agrees to the type of recurring payment and allows their card or bank account information being stored for future payments. This means the future payments can be charged without the payer being present. How are recurring payments collected? Recurring payments can either be collected in two ways:
Which countries and currencies are supported? For up-to-date currency and country coverage details please reach out to your Flywire contact. Example: "Store your card to pay 200 now, 500 next month, and 400 in two months." Who handles future payment creation and emails to your payer? Flywire will create the payments and send communications on your behalf at the appropriate times. |
Configuration Example
The following code sample shows how to configure the Checkout integration to initiate a schedule of payments using a card.
Basic Settings

Specifies the environment for Checkout. Default if not supplied: demo
Possible values:
-
demo (Sandbox)
-
prod (Production environment)

Specifies the portal (also called recipient) that will receive the payment.

A portal (also called recipient) defines who receives the money from payments to Flywire.
You as a client have an account with Flywire
You can have more than one portal, for example one portal for testing purposes and one production portal. Or you could have multiple portals because you want to receive money into different bank accounts or currencies.
The portal code identifies the portal. The portal code has been assigned by Flywire when the portal has been set up.
Format:
Either: 3 letters (ABC)
Or: 5 alphanumeric characters, always starting with a letter (ABC1D)
After-Payment Settings
Specify the returnUrl or an onCompleteCallback handler. See After-Payment Settings for details.
Payer Info and Custom Info
Optionally pre-fill fields and decide which input pages will be shown. See Pre-filling Fields of the Form for details.
Payment Settings
amount decimal
To use scheduled payments the amount here must be set to 0.
The amount for each payment is set in the amount parameter in scheduledPayments.data.instalments.
Payment Schedule Settings
scheduledPayments object

Possible values:
-
scheduled (for card payments)
-
direct_debit_scheduled (for direct debit payments)
data object
instalments array
An array of objects for each payment (installment) that should be scheduled and collected in the future.

You can collect an immediate payment by specifying today’s date as the first item in your instalments array. Keep in mind:
Payments are processed by Flywire at 08:00 (8am) UTC every day.

The payment amount in the billing currency.
The billing currency is the currency in which the recipient of the payment is billing their payer. The billing currency depends on the
The amount is specified as a decimal (1000.25).

The due date on which to process the payment and collect the amount. Must be a future date in format:
YYYY-MM-DD, for example 2025-05-18.
Payments are processed by Flywire at 08:00 (8am) UTC every day.

You can collect an immediate payment by specifying today’s date as the first item in your instalments array. Keep in mind:
Payments are processed by Flywire at 08:00 (8am) UTC every day.

A description of the purpose of the payment.
This description is only visible to you in Dashboard, not to the payer.
var config = {
env: "demo",
recipientCode: "Your Portal Code",
// Specify the returnUrl or an onCompleteCallback handler
returnUrl: "https://httpbin.org/get",
// Other checkout parameters (e.g. pass some payer info and set requestPayerInfo to true)
firstName: "John",
lastName: "Doe",
requestPayerInfo: true,
// The amount must be 0 for scheduled payments
amount: 0,
// The payment schedule
scheduledPayments: {
type: "scheduled",
data: {
instalments: [
{
amount: 100.50,
date: "2021-05-01"
},
{
amount: 899.50,
date: "2021-06-01"
},
],
serviceDescription: "Optional purpose of the payment"
}
}
};
After Payment Completion
Once a the payer has successfully entered their details and the Checkout Experience form is closed, you receive information about the payment either via the returnUrl or the onCompleteCallback handler.

The after-payment settings define how information is sent back to your website.
The payment flow for the Checkout integration is:
-
Customer enters information.
Your customer opens the Checkout Experience form on your website and enters their payment details.
-
Information is sent back to your website.
After the payment is completed, the Checkout Experience window automatically closes after a few seconds.
This triggers the Checkout integration to send back the payment status and details to your website. This can be done in two different ways:
You can either use the returnUrl parameter or the onCompleteCallback parameter, never both.
For security reasons, the token is only returned via onCompleteCallback handler. The returnUrl does not return the token.
This means that when you are tokenizing, you must only use the onCompleteCallback handler.
returnUrl :
While the payer is redirected to the return URL, Flywire attaches query string parameters containing payment information to the set URL. This way, your website can receive and process the payment information without requiring additional API calls.
onCompleteCallback:
The payer stays on the original page. You specify an onCompleteCallback function in the Checkout configuration that handles the parameters containing payment information. The parameters are returned as a JSON args object to the callback handler.
Advantages of using onCompleteCallback
-
Immediate Handling
Since the data is passed directly to your callback, you can handle the payment confirmation on the same page without a redirect.
-
Dynamic Updates
You can dynamically update the page (e.g., show a success message) without leaving the current view, providing a smoother user experience.
-
Flexibility
You can implement custom logic directly in the callback, such as updating the UI or logging information for analytics.
-
-
You use the information for your own systems and the customer.
You can use the returned parameters to update your backend, display information to your payer, or for your internal logging and processing of payments.
Example for response via returnUrl:
(Click to see the return URL in JSON formatting. For a detailed description of the parameters see the response via onCompleteCallback handler below.)
Example for response via onCompleteCallback handler:

The status of the attempted charge. Note that this charge status doesn't mean that funds have successfully been transferred. It gives you information about the communication between Flywire and the external system (for example, the bank or card provider):
Possible values:
success | The communication with the external system was successful, and a charge will happen. The actual transfer of funds can take a few days depending on the system. |
error |
The communication with the external system was successful, but no charge will happen. The external system refused the charge. |
active |
Only for scheduled payments and subscriptions.
The scheduled payment(s) or subscription has successfully been created and is now active. |
pending |
Always returned for bank transfer payments and never returned for online payments.
The payment creation was successful, but since the payer has to make a bank transfer manually, Flywire doesn't know if and when this will happen. |

Is always 0

Either scheduled or direct_debit_scheduled , depending on the value passed in the config.

The ID of the payment request.
This ID has been automatically generated when the Payment Request or subscription was created.
This ID is publicly visible at the end of the Payment Request link, for example:
https://app.flywire.com/rest/payment-request/pay/public/959c09e5-a27b-49e9-8f92-e9e13374cfdd
Format:
959c09e5-a27b-49e9-8f92-e9e13374cfdd
32 hexadecimal characters grouped into 8-4-4-4-12
{
"status": "active",
"paymentMethod": "scheduled",
"amount": 0,
"reference": "82804964-0497-4e07-990a-60076a463a29"
}
Managing Scheduled Payments
