LeaseModule API & Widget · version 1.18.10
Car dealer guide

A lease calculator on your own website

As a dealership, you can choose between two routes: a quick iframe integration or your own REST API integration. For most websites, the iframe option is the recommended choice.

← Choose another guide

Choose your integration method

As a dealership, you have two options: place LeaseModule quickly on your website with an iframe, or build your own interface using the REST API. For most websites, the iframe option is the fastest and safest route.

01

Iframe option

Use the ready-made calculator on vehicle detail pages, stock cards or a general finance page. Your website loads the calculator securely via LeaseModule.

BEST FOR: MOST WEBSITES
02

REST API / custom integration

Use the API if you want to build a fully custom frontend or application flow. Calculations and applications then run server-side through your own environment.

BEST FOR: CUSTOM BUILDS
i
Important As a directly connected dealership, you work without a dealer ID. You only use your integration ID and, for vehicle or monthly-payment views, the vehicle data from your own website.

Overview

One LeaseModule integration supports three implementation methods.

01

Vehicle calculator

Complete business and consumer calculator for a specific vehicle.

Best for: Vehicle detail pages
02

Vehicle monthly payment

Compact monthly amount on a vehicle card or next to the selling price.

Best for: Vehicle listings
03

Standalone calculator

General calculator in which visitors enter the vehicle details themselves.

Best for: Finance pages

What does your website developer do?

Give your integration ID and website address to your developer. They install the calculator in the inventory template and populate the data for each vehicle. Use the standalone calculator on a general finance page.

Before launch, check a VAT vehicle and a margin vehicle, mobile layout, recalculation after changing term and down payment, and receipt of an agreed test application by your provider.

Access and unique ID

LeaseModule activates the connection and provides at least one unique integration ID. This ID links the website to the correct dealer settings.

Integration ID Public

Used by the JavaScript widget. It may be visible in HTML and only works on approved domains.

API secret Secret

Only for direct server integrations. Never include it in HTML, JavaScript, a URL or a public repository.

Approved domain

The widget only loads on domains registered by LeaseModule for the integration.

!
ImportantAn integration ID identifies the customer and is not a secret password. An API secret is confidential and must only be used server-side.

Quick start with iframe

The iframe does not use the JavaScript widget snippets further down this guide. You receive an integration ID by email and place an iframe on your site.

  1. Use the integration ID from your lease provider email. Confirm your website is registered as an allowed domain.
  2. Choose the correct variant: vehicle calculator on a detail page, monthly price display on a listing card, or standalone calculator on a finance page.
  3. Place the full iframe code including automatic height adjustment from the separate dealer iframe guide. For vehicle and monthly views, fill in the vehicle data dynamically.
i
No dealer ID needed A directly connected dealership uses its own integration ID. Only portals also use a separate dealer ID per customer.
Open complete iframe guide →

Alternative: existing JavaScript widget

The HTML examples below using leasemodule-calculator and leasemodule.js belong to a separate JavaScript widget method. This is not iframe code. For iframe integration, use the examples in the iframe guide.

Vehicle calculator – JavaScript widget

The calculator uses the vehicle details and displays the products enabled for this dealer.

HTML
<div
  class="leasemodule-calculator"
  data-type="vehicle"
  data-integration-id="YOUR-INTEGRATION-ID"
  data-reference="45142389"
  data-aanschafprijs="31950"
  data-voertuigsoort="Personenauto"
  data-merk="Audi"
  data-model="Q5"
  data-brandstof="Hybride benzine"
  data-bouwjaar="2019"
  data-kenteken="N635ZB"
  data-btwmarge="marge"
  data-dealerwebsite="https://www.abcautos.nl/"
  data-dealernaam="ABC Auto's"
  data-voertuigurl="https://www.abcautos.nl/occasions-kopen/45142389-audi-q5-45-tfsi-quattro-pro-line/">
</div>

<script src="https://leasemodule.nl/api/widget/v1/leasemodule.js?v=1.17.27" async></script>
i
RecommendedInclude leasemodule.js only once per page, even when displaying multiple monthly payments.

Vehicle monthly payment – JavaScript widget

Use this compact option on a vehicle card or next to the selling price. A click can open the complete calculator.

HTML
<div
  class="leasemodule-monthly-price"
  data-integration-id="YOUR-INTEGRATION-ID"
  data-reference="45142389"
  data-aanschafprijs="31950"
  data-voertuigsoort="Personenauto"
  data-merk="Audi"
  data-model="Q5"
  data-brandstof="Hybride benzine"
  data-bouwjaar="2019"
  data-kenteken="N635ZB"
  data-btwmarge="marge"
  data-dealerwebsite="https://www.abcautos.nl/"
  data-dealernaam="ABC Auto's"
  data-voertuigurl="https://www.abcautos.nl/occasions-kopen/45142389-audi-q5-45-tfsi-quattro-pro-line/">
</div>

<script src="https://leasemodule.nl/api/widget/v1/leasemodule.js?v=1.17.27" async></script>
i
Batch APIDisplaying many vehicles on one page? Use the batch endpoint for server integrations and cache the result. Do not start a separate API request for every vehicle.

Standalone calculator – JavaScript widget

No vehicle data is required in the HTML for the standalone calculator. Visitors enter it themselves. Dealer settings are loaded through the integration ID.

HTML
<div
  class="leasemodule-calculator"
  data-type="standalone"
  data-integration-id="YOUR-INTEGRATION-ID">
</div>

<script src="https://leasemodule.nl/api/widget/v1/leasemodule.js?v=1.17.27" async></script>

WordPress plugin

A base plugin is available for WordPress websites. It allows calculators to be added with shortcodes, without manually adding HTML or JavaScript.

LeaseModule Calculator voor WordPressVersion 1.18.10 · ZIP
Download WordPress plugin ↓

Install in WordPress

  1. Download the ZIP file using the button above.
  2. In WordPress, open Plugins → Add New Plugin → Upload Plugin.
  3. Select leasemodule-wordpress.zip, install it and activate the plugin.
  4. Open Settings → LeaseModule and enter the supplied integration ID and API key.
  5. Save the settings and click Test connection.

Settings

The integration ID identifies the LeaseModule customer. The API key is stored server-side in WordPress only and is never added to the public page or widget.

✓
SecurityFor updates, replace the existing plugin through WordPress. The stored integration ID and API key are retained.

Available shortcodes

Vehicle calculator

WordPress shortcode
[leasemodule_calculator
  aanschafprijs="31950"
  voertuigsoort="Personenauto"
  merk="Audi"
  model="Q5"
  brandstof="Benzine"
  bouwjaar="2021"
  kenteken="AB123C"
  btwmarge="btw"
  dealerwebsite="https://www.abcautos.nl/"
  dealernaam="ABC Auto's"
  voertuigurl="https://www.abcautos.nl/occasions-kopen/45142389-audi-q5-45-tfsi-quattro-pro-line/"]

Vehicle monthly payment

WordPress shortcode
[leasemodule_monthly_price
  aanschafprijs="31950"
  voertuigsoort="Personenauto"
  merk="Audi"
  model="Q5"
  brandstof="Benzine"
  bouwjaar="2021"
  btwmarge="btw"
  dealerwebsite="https://www.abcautos.nl/"
  dealernaam="ABC Auto's"
  voertuigurl="https://www.abcautos.nl/occasions-kopen/45142389-audi-q5-45-tfsi-quattro-pro-line/"]

Standalone calculator

WordPress shortcode
[leasemodule_calculator type="standalone"]
i
The shortcodes can also be used in an Elementor Shortcode widget or the standard WordPress Shortcode block.

Fields and values

FieldTypeExampleDescription
aanschafprijs
Required
number31950Positive amount in euros without a currency symbol or thousands separator. For business finance the supplied price is already excluding VAT; for consumer finance a passenger car includes VAT and 21% VAT is added to a VAT commercial vehicle.
doel
Optional
stringAutoFor the standalone consumer calculator: Auto, Motor, Truck, Motorhome, Caravan or Boat.
voertuigsoort
Required
stringPersonenautoUse one of the defined vehicle type values.
merk
Required
stringAudiVehicle make.
model
Required
stringQ5Vehicle model.
brandstof
Required
stringHybride benzineUse one of the defined fuel values.
bouwjaar
Required
integer2019Four-digit year of manufacture.
kenteken
Optional
stringN635ZBRegistration number; preferably remove spaces and hyphens in advance.
btwmarge
Required
stringmargeFixed value: btw or marge.
dealerwebsite
Required
urlhttps://www.abcautos.nl/Full HTTPS URL of the dealer website.
voertuigurl
Required
urlhttps://www.abcautos.nl/occasions-kopen/45142389-audi-q5-45-tfsi-quattro-pro-line/Full HTTPS URL of the detail page containing the selected vehicle.
dealernaam
Optional
stringABC Auto'sDealer name. Centrally configured details remain authoritative.
dealerplaats
Optional
stringAmsterdamDealer location.
dealeremail
Optional
emailinfo@abcautos.nlPreferably linked centrally to the integration ID and not included in public HTML.
reference
Optional
string45142389Unique vehicle reference in the dealer’s system.

Allowed fixed values

FieldAllowed fixed values
voertuigsoortPersonenauto, Bedrijfswagen, Bromfiets, Motorfiets, Vrachtwagen, Camper, Caravan, Brommobiel
btwmargebtw, marge
brandstofBenzine, CNG, Diesel, Elektrisch, Hybride, Hybride aardgas, Hybride benzine, LPG, LPG-G3, Overig, Waterstof
For developers: REST API and custom application form

REST API

The REST API is designed for server-to-server integrations and offers complete design freedom. Always use HTTPS and store the API secret exclusively on the server.

Base URL

URL
https://leasemodule.nl/api/v1

Authentication headers

HTTP
Authorization: Bearer YOUR-API-SECRET
X-LeaseModule-Integration: YOUR-INTEGRATION-ID
Content-Type: application/json
Accept: application/json
EndpointPurpose
POST/calculationsFinal calculation for one vehicle.
POST/monthly-pricesCompact monthly payment for one vehicle.
POST/monthly-prices/batchMonthly payments for multiple vehicles in one request.
POST/applicationsSubmit a finance application.
GET/widget/configRetrieve widget settings and available products.
GET/healthCheck API availability.

POST /v1/calculations — Example request

JSON
{
  "aanschafprijs": 31950,
  "voertuigsoort": "Personenauto",
  "merk": "Audi",
  "model": "Q5",
  "brandstof": "Hybride benzine",
  "bouwjaar": 2019,
  "kenteken": "N635ZB",
  "btwmarge": "marge",
  "dealerwebsite": "https://www.abcautos.nl/",
  "dealernaam": "ABC Auto's",
  "voertuigurl": "https://www.abcautos.nl/occasions-kopen/45142389-audi-q5-45-tfsi-quattro-pro-line/",
  "reference": "45142389",
  "business": {
    "term": 72,
    "down_payment": 0,
    "final_payment": 0
  },
  "consumer": {
    "term": 72,
    "down_payment": 0
  }
}

Example response

JSON
{
  "success": true,
  "request_id": "req_01K2A4G7M8",
  "calculation_id": "calc_8fd329",
  "currency": "EUR",
  "business": {
    "available": true,
    "monthly_amount": 523,
    "term": 72
  },
  "consumer": {
    "available": true,
    "monthly_amount": 574,
    "term": 72
  },
  "valid_until": "2026-07-17T23:59:59+02:00"
}

Applications

Always use the calculation_id from the latest calculation when submitting. LeaseModule returns a unique application number that can be used to locate the application.

i
Consumer form wizardThe consumer application in the standard widget uses three screens: personal and housing details, income details (including conditional partner details), and a review screen. Previous and Next validate only visible required fields.
!
ImportantNever place personal data in URL parameters, data attributes or browser logs. Submit applications only using a secure POST request.
POST /v1/applications · JSON
{
  "calculation_id": "calc_8fd329",
  "product": "business",
  "vehicle_reference": "45142389",
  "applicant": {
    "first_name": "Jan",
    "last_name": "Jansen",
    "email": "jan@example.com",
    "phone": "+31612345678"
  },
  "company": {
    "name": "Example Mobility B.V.",
    "kvk": "12345678"
  },
  "voertuigurl": "https://www.abcautos.nl/occasions-kopen/45142389-audi-q5-45-tfsi-quattro-pro-line/"
}

Security

Checklist for a reliable implementation

  • Use HTTPS for the website, widget and API.
  • Store the API secret outside the web root, for example in an environment variable.
  • Have every production and test domain registered by LeaseModule in advance.
  • Validate vehicle fields server-side and do not rely solely on browser input.
  • Cache vehicle listing results briefly, but never cache personal data or application requests.
  • Use the central honeypot, timing, rate-limit and duplicate checks on application forms.
  • Log request IDs and error codes, but not complete personal data or API secrets.

Troubleshooting

If something goes wrong, check the following items first.

ProblemPossible cause and solution
Widget is not visibleCheck the integration ID, registered domain, browser console and whether leasemodule.js is being blocked.
No monthly payment availableCheck selling price, year, vehicle type and VAT/Margin. The vehicle may fall outside the configured acceptance criteria.
401 UnauthorizedThe Authorization header is missing or the API secret is invalid. Only renew keys through LeaseModule.
403 ForbiddenThe domain or product has not been enabled for this integration ID.
422 Validation errorA required field is missing or contains an unsupported value. Review the errors array in the response.
429 Too Many RequestsToo many requests are being sent. Use caching, the batch endpoint and respect Retry-After.
✓
DebugWhen contacting LeaseModule, always include the request_id from the API response. Never share the API secret.

Support

Need help? Contact LeaseModule and include the integration ID, relevant domain, page URL, time and request ID.