E-shop leasing - II

Documentation version v3.01, 24.10.2022

"AS Inbank filialas" e-Leasing+ online solution implementation and steps of integration into online platform of E-shop are described in this document. E-Leasing+ online solution consists of two cornerstone components: web service and remote web application.

E-shop must program:

  1. Get products list from Leasing+ (Optional if E-shop configured to use only one product).
  2. Creating an application in the e-Leasing+ system.
  3. E-shop to e-Leasing+ system client forwarding.
  4. Return of clients from e-Leasing+ to E-shop
  5. Clients' leasing contract state check

E-shop server application (backend) will contact e-Leasing+ web service and transmit information about Client and his shopping cart in an exchange of a unique e-Leasing+ application token. With the unique token it will forward the Client to the e-Leasing+ system. In case the Client cancels the process or Leasing contract, Client is redirected to the E-shop along with the information of the leasing contract status.

Data exchange between the E-shop and e-Leasing+ system is encoded in UTF-8 format.

E-Leasing + implementation and integration steps are shown in the the following chapters.

URLs

E-Leasing+ web service

E-Leasing+ web service (WS) performs two main functions: Leasing application creation and final contract status check. WS client part must be implemented at the server level of E-shop (server side). The data exchange between E-shop and the WS must be through the secure socket layer (SSL). All API endpoints require authorization API key which must be provided in header with name ix-api-key.

E-shop notification of any changes in contract completion

In case of an important change during the process of contract completion, E-shop is informed to alert_url using POST method. Once the E-shop has the information, it must check the current status of contract. Status code indicates Leasing contract status.


Input parameters:

Attributes Required Type Definition and Examples
appl_token Yes String Unique Leasing application token
order_id Yes String Unique E-shop shopping cart id
appl_phase Yes String INIT, OPTION, DEAL, FINISH, etc
appl_status Yes String OK or error code
sha1 Yes String Generated SHA1 from symbols: uuid, appl_token, appl_phase, appl_status
contract_no No String If application in DEAL phase, then contract does not exist
close_reason No String The reason why an application was closed (e.g. phase = CLOSED)

Application token parameter identifies e-Leasing+ application. Order id is unique E-shop order_id. uuid is unique e-shop id assigned by Inbank.

No output parameters exist.


List of application phases:

Phase Description Last Phase
NEW New application No
INIT Data input No
EVAL Evaluating No
REJECTED Rejected Yes
OPTION Options No
PROPOSAL Proposal No
DEAL Deal No
FINISH Finish Yes
CANCEL Cancel Yes
CLOSE Close Yes



List of contract closure reasons:

Code Description
UNFINANCEABLE Client is unfinanceable
KAC Closed by our communication center
EXPIRED Application has expired

Calculator integration

Link for Mokilizingas | Inbank calculator integration:

https://skaiciuokles.inbank.lt/doc/calculator

Link for Mokilizingas | Inbank MOKI3,5,10 calculator integration:

https://skaiciuokles.inbank.lt/doc/moki_calculator

Link for Mokilizingas | Inbank custom calculator integration through API:

https://skaiciuokles.inbank.lt/doc/api

Getting product information

GET /eshop/:uuid/v2/tariff

This method is used to get all products information (pricing) from e-Leasing+ which are assigned to specific partner e-shop.

If e-shop have assigned only one tariff this endpoint may not be used.

To get all information about assigned tariffs/products to e-shop need provide e-shop uuid, this value is provided by "AS Inbank filialas".

SecurityapiKeyAuth
Request
path Parameters
uuid
required
string

Eshop unique identifier.

Example: c3945e9e-426f-8859-8b60-3b9e9a46d101
Responses
200

Get product information

401

Unauthorized

404

Not Found

get/eshop/{uuid}/v2/tariff
Request samples
Response samples
application/json
{
  • "tariffs": [
    ],
  • "error_code": "",
  • "error_message": "",
  • "errors": [ ]
}

E-shop contract creation

POST /eshop/v2/create

This method is used to create contract and primal data exchange between E-shop and e-Leasing+ online platform. Data exchange is in the safe background mode (Server To Server).

API key is provided by "AS Inbank filialas" once the contract is signed. Return_url is used to return user to E-shop webpage. Order_id parameter defines unique shopping cart id. Alert_Url is used to inform Eshop about major changes in the process. If the term attribute will be provided, the contract will be evaluated for that specific term without possibility to change it later in the process. The price attribute in shopping cart list order_json must be filled by price per unit.

Error code attribute defines the result of the user authentication. If this value is empty - authentication was successful; otherwise error code will be filled, and the error definition will provide further information about the error. In case of successful authentication, appl_token parameter is filled with unique value; otherwise it is empty. appl_token attribute value is required for the further steps, this parameter is a unique identifier that is valid for only a certain period of time.

SecurityapiKeyAuth
Request
Request Body schema: application/json
required
uuid
required
string

Eshop unique identifier.

tariff_code
string

If e-shop have assigned 2 or more tariffs/products this parameter is mandatory, otherwise - optional. Use product information endpoint to get the list.

term
number

Contract term.

return_url
required
string

Return URL.

alert_url
required
string

Alert URL.

order_id
required
string

E-shop shopping cart unique ID, must include character [A-Z].

order_amount
required
number

Decimal may be divided by dot or comma. Separation of thousands may not be used. Sum must exceed 0 EUR and equal to the order basket "order_json".

order_currency
string

Currency code by ISO-4217. For example: LTL, EUR, USD. If field is not set, then our system default currency till 2014-12-31 is LTL, after 2014-12-31 is EUR.

order_info
string

Order information.

testing
string

If testing is set to Y, then testing will take place (no real deals will be made).

first_name
string

Customer first name.

last_name
string

Customer last name.

client_phone
string

Customer phone number.

client_email
string

Customer email address.

client_address
string

Customer address.

pers_code
string

Customer personal code.

doc_type
string

Identity document types:

  • PP - Passport
  • AK - Identity card
Enum: "PP" "AK"
doc_no
string

Customer document number.

vendor_phone
string

Vendor/E-shop phone number.

vendor_email
string

E-shop info e-mail.

vendor_name
string

Vendor/E-shop name.

vendor_img
string

Internet link to E-shop logo image

required
object

Shopping cart expressed in JSON array.

Responses
200

Creates a new contract

401

Unauthorized

404

Not Found

422

Unprocessable Entity

post/eshop/v2/create
Request samples
application/json
{
  • "return_url": "example.com",
  • "alert_url": "example.com",
  • "order_id": "A123",
  • "order_amount": 900,
  • "uuid": "c3945e9e-426f-8859-8b60-3b9e9a46d101",
  • "tariff_code": "T_TG_0_2375",
  • "term": 12,
  • "order_currency": "EUR",
  • "order_info": "Eshop basket name",
  • "testing": "Y",
  • "first_name": "John",
  • "last_name": "Smith",
  • "pers_code": "39108190000",
  • "client_phone": "7013534",
  • "client_email": "john.smith@test.test",
  • "client_address": "Niine 11",
  • "doc_type": "AK",
  • "doc_no": "LS4L310D93",
  • "vendor_phone": "7237450",
  • "vendor_email": "vendor@eshop.test",
  • "vendor_name": "Test shop",
  • "order_json": [
    ]
}
Response samples
application/json
{
  • "appl_token": "F0C551ECCAA8AF5882754D8BF81C1A0A9EE3FE92",
  • "error_code": "",
  • "error_message": "",
  • "redirect_url": "example.com",
  • "errors": [ ]
}

Getting redirection URL to E-shop

GET /eshop/:uuid/:appl-token/v2/redirect/url

This endpoint returns a URL that is used to redirect the client to the correct e-Leasing+ system step.

SecurityapiKeyAuth
Request
path Parameters
uuid
required
string

Eshop unique identifier.

Example: c3945e9e-426f-8859-8b60-3b9e9a46d101
appl-token
required
string

Unique Leasing application token.

Example: 0E7F74967CA051F45E14AE2B0E6EB1B70A3292EE
Responses
200

Redirect to e-Leasing+

401

Unauthorized

404

Not Found

422

Unprocessable Entity

get/eshop/{uuid}/{appl-token}/v2/redirect/url
Request samples
Response samples
application/json
{
  • "redirect_url": "example.com",
  • "errors": [ ]
}

E-shop to e-Leasing+ forwarding

GET /eshop/:appl-token/v2/redirect

Client from the E-shop is redirected to the e-Leasing+ system during this process.

This communication happens at the level of Clients web browser. Therefore, the most important information regarding the E-shop shopping cart is provided during the process of application creation (during the background "Server To Server" process).

e-Leasing+ to E-shop forwarding

Client is forwarded/returned from the e-Leasing+ system to the E-shop during this process. HTML form is composed containing appl_token and order_id as parameters for the forwarding. Application token will be used to identify shopping cart in Leasing+ and order id and uuid will be used for validation. GET method forwards Client along with the parameters to the E-shop return_url address (see chapter). E-shop must check the status of contract at this step - endpoint ...eshop/v2/check (see chapter).

SecurityapiKeyAuth
Request
path Parameters
appl-token
required
string

Unique Leasing application token.

Example: 0E7F74967CA051F45E14AE2B0E6EB1B70A3292EE
Responses
200

Redirect to e-Leasing+

401

Unauthorized

404

Not Found

422

Unprocessable Entity

get/eshop/{appl-token}/v2/redirect
Request samples
Response samples
application/json
{
  • "message": "unauthorized"
}

Check the status of the leasing agreement

POST /eshop/v2/check

This method is used to check the leasing contract status. E-shop uses this method to find out what is the status of the Leasing contract.

Unique appl_token with e-shop order_id and uuid must be provided to check agreement status. Parameters must be the same which were used to create an application.

SecurityapiKeyAuth
Request
Request Body schema: application/json
required
appl_token
required
string

Unique Leasing application token.

order_id
required
string

Unique E-shop shopping cart id.

uuid
required
string

Eshop unique identifier.

Responses
200

Contract status

401

Unauthorized

404

Not Found

post/eshop/v2/check
Request samples
application/json
{
  • "appl_token": "0E7F74967CA051F45E14AE2B0E6EB1B70A3292EE",
  • "order_id": "5E13I266GV",
  • "uuid": "c3945e9e-426f-8859-8b60-3b9e9a46d101"
}
Response samples
application/json
{
  • "appl_token": "0E7F74967CA051F45E14AE2B0E6EB1B70A3292EE",
  • "result": "SIGNED_DEAL",
  • "result_info": "Contract completed",
  • "result_msg": "Contract completed",
  • "order_id": "5E13I266GV",
  • "advance": 999,
  • "currency": "EUR",
  • "contract_no": "TBK90126FDPA",
  • "errors": [ ]
}