Your Car Loan Embedded

C# RESTful Service Documentation

To make the integration of the RESTful finance calulation service as simple as possible we have also created a C# class which consumes the service that you can simply drop into your existing C# project. This class is called Nycle (N for .Net, ycle for YourCarLoanEmbedded)

Here you will find the neccessary files and documentation needed to integrate this class into your project.

Download

The neccessary files and tests can be downloaded in ZIP format below. The tests have been provided as futher examples of how to use the YcleCalculation class.

Version 0.2.0 - 21/05/2008

Including In Project

Once you have downloaded the required files simply extract them and reference Nycle.dll as part of your current project.

Initialising The Object

Once the DLL is referenced in your project you will simply need to add it to the page references.
using Nycle;
You will then need to initialise the object as shown in the code block below. The DealerName in this example will be supplied to you by ourselves and simply needs to be supplied as a string.
Nycle nycle = new Nycle("DealerName");

Calling The Service

The Nycle class has 4 overloaded methods that can be used to call the REST service, each are detailed below.

Each is overloaded with the rateType and rate parameters which are optional as if not supplied they will default to £0 Commission. If you wish to supply these values then you will need to supply the rateType parameter as a RateType enum value as shown below.
Nycle.RateType.APR
Nycle.RateType.Commission
Nycle.RateType.CustomerRate

Calculate

The Calculate function has the following parameters and will perform a basic HP (Hire Purchase) calculation returning the calculation response XML as an System.Xml.XmlDocument.
Calculate( decimal cashPrice, DateTime regDate )

Calculate( decimal cashPrice, DateTime regDate, RateType rateType, decimal rate )
Calculate(24500, new DateTime((2012,2,8));
Calculate(24500, new DateTime((2012,2,8), Nycle.RateType.Apr, 9.6m);
Calculate(24500, new DateTime((2012,2,8), Nycle.RateType.Commission, 100);
Calculate(24500, new DateTime((2012,2,8), Nycle.RateType.CustomerRate, 11.6m);
Parameter Description And Formatting

Calculate With Finance Options

The CalculateWithFinanceOptions function has the following parameters and will perform a HP (Hire Purchase) calculation using the supplied finance options returning the calculation response XML as an System.Xml.XmlDocument.
CalculateWithFinanceOptions( decimal cashPrice, DateTime regDate, decimal deposit, int term )

CalculateWithFinanceOptions( decimal cashPrice, DateTime regDate, decimal deposit, int term, RateType rateType, decimal rate )
CalculateWithFinanceOptions(24500, new DateTime((2012,2,8), 2400, 36);
CalculateWithFinanceOptions(24500, new DateTime((2012,2,8), 1400, 54, Nycle.RateType.Apr, 9.6m);
CalculateWithFinanceOptions(24500, new DateTime((2012,2,8), 1800, 24, Nycle.RateType.Commission, 100);
CalculateWithFinanceOptions(24500, new DateTime((2012,2,8), 2400, 36, Nycle.RateType.CustomerRate, ¬ 11.6m);
Parameter Description And Formatting

Calculate With RV

The CalculateWithRV function has the following parameters and will perform a basic HP (Hire Purchase) and RV (Residual Value) based calculation returning the calculation response XML as an System.Xml.XmlDocument. The capCode parameter in this method can be supplied as the vehicle's 14-20 digit CapCode or the numeric CapId.
CalculateWithRV( decimal cashPrice, DateTime regDate, int currentMileage, string capCode )

CalculateWithRV( decimal cashPrice, DateTime regDate, int currentMileage, string capCode, RateType rateType, decimal rate )
CalculateWithRV(24500, new DateTime((2012,2,8), 14500, "FOKA13ZC73HPIM");
CalculateWithRV(24500, new DateTime((2012,2,8), 4500, "FOKA13ZC73HPIM", Nycle.RateType.Apr, 9.6m);
CalculateWithRV(24500, new DateTime((2012,2,8), 24500, 35165, Nycle.RateType.Commission, 100);
CalculateWithRV(24500, new DateTime((2012,2,8), 14500, 35165, Nycle.RateType.CustomerRate, 11.6m);
Parameter Description And Formatting

Calculate With RV And Finance Options

The CalculateWithRVAndFinanceOptions function has the following parameters and will perform a HP (Hire Purchase) and RV (Residual Value) based calculation using the supplied finance options returning the calculation response XML as an System.Xml.XmlDocument.
CalculateWithRVAndFinanceOptions( decimal cashPrice, DateTime regDate, int currentMileage, string capCode, decimal deposit, int annualMileage, int term )

CalculateWithRVAndFinanceOptions( decimal cashPrice, DateTime regDate, int currentMileage, string capCode, decimal deposit, int annualMileage, int term, RateType rateType, decimal rate )
CalculateWithRVAndFinanceOptions(24500, new DateTime((2012,2,8), 14500, "FOKA13ZC73HPIM", 1500, 1400036);

CalculateWithRVAndFinanceOptions(24500, new DateTime((2012,2,8), 4500, "FOKA13ZC73HPIM", 2500, 1400036, Nycle.RateType.Apr, 9.6m);

CalculateWithRVAndFinanceOptions(24500, new DateTime((2012,2,8), 24500, 35165, 1500, 14000, 42, ¬ Nycle.RateType.Commission, 100);

CalculateWithRVAndFinanceOptions(24500, new DateTime((2012,2,8), 14500, 35165, 500, 24000, 36, ¬ Nycle.RateType.CustomerRate, 11.6m);
Parameter Description And Formatting

Parameter Description And Formatting

Cash Price

This needs to be the Purchase Price of the vehicle expressed as a valid numeric value between 1000 and 1000000 (exclusive) with no currency signs or commas ( £ or , )
5999.00 or 5999 (i.e. £5,999.00)

Registration Date

This needs to be the Registration Date of the vehicle supplied as a DateTime object.
new DateTime(2008, 12, 25); (i.e. Christmas 2008)

Current Mileage

This needs to be the Current Mileage of the vehicle and expressed as a valid numeric value between 0 and 1000000 (exclusive)

Cap Code

This needs to be either the vehicle's 14-20 digit CapCode or valid numeric CapId between 1000 and 1000000 (exclusive)
FOKA13ZC73HPIM
35165

Deposit

This needs to be the Deposit the customer has available to put down expressed as a valid numeric value between 0 and 1000000 (exclusive) with no currency signs or commas( £ or , )
1250.00 or 1250 (i.e. £1,250.00)

Annual Mileage

This needs to be the Mileage the customer states they antisipate covering Per Annum expressed as a valid numeric value between 6000 and 30000 rounded to the nearest thousand

Term Length

This needs to be the length of time the customer wishes to take out finance over expressed as a valid numeric value, in months, between 24 and 60 inclusive.

Rate Type

This needs to be a RateType enum value as found as part of the Nycle class. If supplied it needs to be one of the following values, however this is an optional parameter. If not supplied the default type will be used of Commission.
Nycle.RateType.APR
Nycle.RateType.Commission
Nycle.RateType.CustomerRate

Rate

This is optional. If not supplied the default of 0 will be used. If supplied this value will need to reflect either a commission or percentage depending on the selected option above. The value needs to be a valid numeric value with currency signs, commas and percentage signs (£ or , or %) removed.
100 (i.e. commission of £100)
7.9m (i.e. 7.9% or £7.90 dependant on rate type)