Links

Instalments Workflow

This feature allows customers to pay for an insurance product that covers them for a period of time (annually) in instalments instead of up-front.
The above diagram illustrates the API calls and webhook events made in order to record the payment of each instalment.

Policy Instalment Options

When a quote request is made for a policy that allows payment to be made in instalments an instalment_plans property will be returned in the API response.
The amount to surface to the customer is reflected in the first_instalment_amount attribute.
{
"quotes": {
"0": {
...,
"instalment_plans": [
{
"name": "1year-monthly",
"label": "1Year-Monthly",
"amount": 308.0,
"first_instalment_amount": 25.67
}
]
}
}
}

Confirming Instalment Plan

The instalment plan can be selected by provide the desired instalment name in the instalment_plan attribute during a booking request.
{
"quotes": [
{
"id": "UUID",
"instalment_plan": "1year-monthly"
}
],
"policyholder": {
...
}
}

Processing a Periodic Payment

Depending on the payment services provider a periodic payment will generate a webhook event. This event should be processed by your platform and the following API calls should be made to the instalments endpoint.

Fetching Payment Plan Details

In order to record an instalment the correct instalment_id needs to be provided. The next scheduled instalment_id can be obtained by performing a GET request against the instalment endpoint.
get
https://api.xcover.com/x/
partners/:partner_id/bookings/:quote_package_id/instalments/
Fetch Instalment Details

Confirming an Instalment Transaction

To confirm the instalment once a payment attempt has been made a request to the following endpoint needs to be made containing the instalment_id from the previous step.
post
https://api.xcover.com/x/
partners/:partner_id/bookings/:quote_package_id/instalments/
Confirm Instalment
Request Payload
{
"quotes": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instalment_id": "286b1dc2-e2f0-40ea-bc39-079ef019b7d0",
"instalment_number": 0,
"payment_attempted_date": "2019-08-24T14:15:22Z",
"payment_status": "PAID",
"payment_failures": {}
}
]
}