Checkout for Subscriptions

image

Subscription payments allow you to collect future payments with a fixed amount on regular intervals.For subscriptions, you cannot create or edit installments yourself - they are automatically generated by Flywire based on the rules that have been defined for the subscription.

In Dashboard, you can find subscriptions under "Payment Requests".

Subscription payments are a type of recurring payment.

Example:

"Store your card to pay 200 on the first of each month for one year."

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 subscription of payments using a card.

 

Basic Settings

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

You can take an initial payment (for example a deposit) f you use an amount greater than 0. If no initial payment is required use 0.

Subscription Settings

scheduledPayments object

data object

Object containing the settings for the subscription.

cadence object

Contains the intervals at which payments are collected.

Example: For collecting a payment every 2 weeks set occurance to 2 and timeUnit to weeks.

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,

  //Initial payment such as deposit if any, otherwise 0
  amount: 20,

  //The Subscription Schedule
  scheduledPayments: {
    type: "subscription",
    data: {
      amount: 80,
      startDate: "2023-03-30",
      endDate: "2023-05-10",
      cadence: {
        occurrence: 1,
        timeUnit: "weeks",
      },
      serviceDescription: "Weekly Subscription"
    }
  }
};

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.

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.)

https://postman-echo.com/get?reference=d1fda11c-44f5-463a-a75b-9c97c2c1f46a&status=active&amount=1200.11&amountCurrency=USD&
payerAmount=1069&payerAmountCurrency=EUR&payment_method=subscription

Example for response via onCompleteCallback handler:

{
  "status": "active",
  "amount": 1200.11,
  "paymentMethod": "subscription"
  "reference": "d475906f-17ff-45f7-812e-52f9a06f21ae",						
  "amountCurrency": "USD",
  "payerAmount": 1069,
  "payerAmountCurrency": "EUR",
}

Managing Subscription Payments

If you are using the imageFlywire API: via the Subscriptions resource
If you are using no integrations: via imageClient Dashboard (as a Payment Request)