Skip to main content

Ladu20 andmesideliides (L20_API)

API structure

Ladu20 API is REST based, queries are processed via CURL POST requests.

API base URL: henceforth BASEURL, will be provided by KMA.
API key: henceforth APIKEY, will be provided by KMA
Request data is posted in CURLOPT_POSTFIELDS as JSON.

HTTP header Content-Type needs to be set to application/json

PHP sample request
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://baseurl/product',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"id":"21161"}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'x-api-key: APIKEY'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Getting data from Ladu20

API requests serve data from Ladu20 by predefined filterable POST requests. Filter parameters are defined per request

Customer data

URL: apiurl/customer

Filter parameters
PARAMETER NAMETYPEDESCRIPTION
last_updatestringformat: 2023-10-11T00:00:00
oldbit 
idstringcustomer id
pageint1-n, default 1
rowcountint1-300, default 300
Response
FIELD NAMETYPEDESCRIPTION
customer_codeint 
main_customer_codeintpayer customer code
receiving_customer_codeint 
last_updatedateformat: 2023-10-11T00:00:00, created date
namestring 
reg_codestring 
vat_in_useint 
vat_nostring 
is_private_personboolean 
customerbooleancustomer status
supplierbooleancustomer status
producerbooleancustomer status
transporterbooleancustomer status
ownerstring 
infostring 
phonestring 
address1stringstreet
address2stringcity
address3stringcounty
postcodestring 
countrystring 
languagestring 
emailstring 
currencydecimal 
bankstringbank name
bankaccountstring 
ref_nointreference no
glncodeint 
latintlatitude
longintlongitude
credit_limitdecimal 
debt_min_amountdecimal 
debt_fromintdebt from days
owner_customerstring