Purchase

The Purchase endpoint enables the RentalCover.com server to book a quoted policy based on the parameters provided.

A previously generated quote must be created before a purchase can be made, the reference for this quote is passed in the AgentReference field.

Currency Code is not supported in Purchase request. If Currency code is used, it will be ignored.

The purchase request sent after modification is different to the purchase request sent after Quote. If an auto re-bill feature is enabled for a partner, the following fields are optional during the Purchase Request: CardHolder, CardNumber, CardExpiry, CardSecurityCode.

Endpoint: /insurances/purchase

Method: POST

Optional Endpoint:/insurances/purchase/<reference:[A-Z0-9\-]+>

Optional Endpoint is to be used if AgentReference is your reference, in this case the Policy reference is passed within the URL.

curl -i -X POST \
-H "X_API_KEY: [my-api-key]" \
-H "Content-Type: application/json" \
-d '{"AgentReference":"AB12-345C-INS","PolicyCode":"RC001","FromDate":"2014-12-17 00:00:00","ToDate":"2014-12-19 00:00:00", "CustomerAge":21, "DestinationCountry":"AU", "FirstName":"Jack", "LastName":"Smith","Address1":"21 This Street","City":"Sydney","Email":"[email protected]","Country":"AU","CardHolder":"TEST TEST","CardNumber":"4111111111111111","CardExpiry":"1216","CardSecurityCode":"111"}' \
https://api-staging.rentalcover.com/insurances/purchase

Request Parameters

AgentReference string required

The Reference field passed in the response from the Quote endpoint

PartnerReference string

Important for good customer experience. Your booking reference will appear in our systems to help with customer service inquiries wherever insurance reference number is not known

DestinationCountry string [ISO 3166(2)] required

Customer destination country code

FromDate date required

Policy start date

ToDate date required

Policy end date

PolicyCode string required

The Policy.Code field passed in the quote response

FirstName string required

Customer first name

LastName string required

Customer last name

Email string required

Customer email

Country string [ISO 3166(2)] required

Customer country code

Address1 string required

Customer address. IF UNKNOWN: Include a default address, e.g. c/- Travel Jigsaw (50 character limit)

City string required

Customer city. IF UNKNOWN: Include a default

PostalCode string required

Customer postcode or zip code. IF UNKNOWN: Include a default

XPayCustomerTokenstring after Quote Request and XPay tokenization

CardHolder string required after Quote Request

Credit card name

CardNumber string [0-9] required after Quote Request

Credit card number

CardExpiry string [mmyy] required after Quote Request

Credit card expiry date

CardSecurityCode string required after Quote Request

Credit card CVV

Address2 string

Customer street address line 2 (50 character limit)

Region string

Phone string

Customer phone (mobile preferred, ; format: +61413333333)

OtherEmail string

Secondary email

LanguageCode string [2]

default is en Preferred language code.

CoverAmount float

The required amount of cover

PolicyPrice float

Price of partner policy (if partner sets price). If < RC policy then partner price will be used.

Discount float

The amount of discount required, if available

PartnerCardFees float

Partner credit card fee

AutoRebill boolean

For customers who have already booked with us , AutoRebill = true will charge their credit card and you do not need to pass us the credit card details like CardHolder,CardNumber,CardExpiry,CardSecurityCode.

PartnerCollectingPayment boolean

Indicates whether the partner is collecting the payment. If PartnerCollectingPayment = true, you do not need to pass us the credit card details like CardHolder,CardNumber,CardExpiry,CardSecurityCode.

Response Attributes

Note that response properties with the text Formatted appended are formatted with the relevant currency code and symbol.

BookingId integer

Internal ID of booking (primary key)

Reference string

Unique booking reference for each policy booked. Customers will receive this reference in confirmation emails. Also used in purchase and cancel requests.

Status string

FromDate datetime

Start date/time of booking

ToDate datetime

End date/time of booking

TotalAmount float

Total amount customer is to pay for the policy (already includes discounts and markups)

InsuranceCoverAmount float

Amount of cover the policy includes

SupplierReference string

Supplier’s policy reference once purchased

Expired boolean

Flag whether the policy has expired

CoveredDays integer

Number of days the customer is covered for

Discount float

Amount of discount that has been applied to the TotalAmount

DestinationCountry string

Full name of destination country of travel

DestinationCountryObject.Code string

ISO 3166 two character Destination country code

DestinationCountryObject.Name string

Full name of destination country of travel

DestinationCountryObject.PhoneCode string

Destination country phone prefix

Currency string

Three character currency of the booking

TotalAmountFormatted string

Total amount customer must pay for the policy (already includes discounts and markups). Includes currency formatting.

InsuranceCoverAmountFormatted string

Amount of cover the policy includes

DiscountFormatted string

Amount of discount that has been applied to the TotalAmount

DailyAmountFormatted string

TotalAmount / No. Days

TotalAmountOutstanding float

Amount outstanding to complete purchase of policy. Will either be the same value as TotalAmount if no modification has been made.

TotalAmountOutstandingFormatted string

Formatted version of total amount outstanding.

TotalAmountRefunded float

Amount refunded after a modification that reduced the price.

TotalAmountRefundedFormatted string

Formatted version of total amount refunded

Disclaimer string

Policy disclaimer

Policy.GapCoverAmount float

Amount of gap cover that the policy includes

Policy.Name string

Name of the policy

Policy.Type string

Type of the policy

Policy.Code string

Policy code

Policy.Excess string

Amount of excess

Policy.Inclusions string

Policy inclusions

Policy.Description string

Policy description

Policy.SellingPoints string

Policy selling points / benefits

Policy.RoadsideAssistanceBlob string

Roadside assistance text. Can be used by support staff, CRM, or within email templates

Policy.GapCoverAmountFormatted string

Amount of gap cover that the policy includes

Policy.ExcessFormatted string

Amount of excess

Policy.PdsUrl string

URL to the policy PDS PDF

Policy.SupplierName string

Name of the policy supplier

Policy.ModifyUrl string

URL that allows the policy to be modified (if not using API endpoint)

Policy.CancelUrl string

URL that allows the policy to be cancelled (if not using API endpoint)

Customer.FirstName string

First name of customer

Customer.LastName string

Last name of customer

Customer.Email string

Email address of customer

Customer.Age string

Age of customer

Customer.Country string

Customer country code

Customer.Coupons object

0:n coupons, not returned if no coupons available.

Customer.Coupons.[coupon_code] string

Coupon code

Customer.Coupons.[coupon_code].Title string

Coupon title

Customer.Coupons.[coupon_code].Value integer

Value of coupon

Customer.Coupons.[coupon_code].ValueType string

Fixed or percentage

Customer.Coupons.[coupon_code].AmountRemaining float

Amount remaining on coupon [null]

Customer.Coupons.[coupon_code].EffectiveFrom date

Date that coupon is effective from

Customer.Coupons.[coupon_code].EffectiveTo date

Date that coupon is effective to

Customer.Coupons.[coupon_code].Ters string

Coupon terms and conditions

QuoteUrl string

Quote URL of the policy. Used in confirmation emails to customer. Renders the payment page. Not returned in v2 of API

Commission.TotalCommission string

Total commission for the partner

Commission.TotalCommissionFormatted string

Total commission for the partner, including currency formatting.

SettlementCurrencyObject.SettlementCurrency string

Three character settlement currency of the booking.

SettlementCurrencyObject. SettlementAmount float

Total amount customer must pay for the policy, in the settlement currency rate (already includes discounts and markups)

SettlementCurrencyObject. SettlementAmountFormatted string

Formatted version of the Settlement Amount.

SettlementCurrencyObject. Commission.SettlementCommission float

Total commission for the partner, in the settlement currency rate

SettlementCurrencyObject. Commission.SettlementCommissionFormatted string

Formatted version of the SettlementCommission

Last updated