Skip to content

E-shop leasing - II

Documentation version 3.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

URL examples for test and live:

TestLive
Please contact us at integration@inbank.lt for test datahttps://api.mokilizingas.lt/api2/

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:

AttributesRequiredTypeDefinition and Examples
appl_tokenYesStringUnique Leasing application token
order_idYesStringUnique E-shop shopping cart id
appl_phaseYesStringINIT, OPTION, DEAL, FINISH, etc
appl_statusYesStringOK or error code
sha1YesStringGenerated SHA1 from symbols: uuid, appl_token, appl_phase, appl_status
contract_noNoStringIf application in DEAL phase, then contract does not exist
close_reasonNoStringThe 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:

PhaseDescriptionLast Phase
NEWNew applicationNo
INITData inputNo
EVALEvaluatingNo
REJECTEDRejectedYes
OPTIONOptionsNo
PROPOSALProposalNo
DEALDealNo
FINISHFinishYes
CANCELCancelYes
CLOSECloseYes



List of contract closure reasons:

CodeDescription
UNFINANCEABLEClient is unfinanceable
KACClosed by our communication center
EXPIREDApplication has expired

Calculator integration

Link for Mokilizingas | Inbank calculator integration:

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

Link for Mokilizingas | Inbank custom calculator integration through API:

Servers
Demo environment
https://api.mokilizingas.lt/apitest/
Live environment
https://api.mokilizingas.lt/api2/

Getting product information

Request

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".

Security
apiKeyAuth
Path
uuidstringrequired

Eshop unique identifier.

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

Responses

Get product information

Bodyapplication/json
tariffsArray of objects(tariffs)

List of tariffs (products).

tariff_dataArray of objects(tariffData)

List of tariffs data.

error_codestring

Error code:

  • AUTHENTICATION_FAILURE
  • WRONG_RETURN_URL
  • WRONG_ORDER_ID
error_messagestring

Error description:

  • API key incorrect
  • Return url entered is incorrect
  • Order id entered is incorrect
errorsArray of arrays

System errors back trace list.

Response
application/json
{ "tariffs": [ { … }, { … } ], "error_code": "", "error_message": "", "errors": [] }

E-shop contract creation

Request

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.

Security
apiKeyAuth
Bodyapplication/jsonrequired
uuidstringrequired

Eshop unique identifier.

tariff_codestring

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

termnumber

Contract term.

return_urlstringrequired

Return URL.

alert_urlstringrequired

Alert URL.

order_idstringrequired

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

order_amountnumberrequired

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_currencystring

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_infostring

Order information.

testingstring

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

first_namestring

Customer first name.

last_namestring

Customer last name.

client_phonestring

Customer phone number.

client_emailstring

Customer email address.

client_addressstring

Customer address.

pers_codestring

Customer personal code.

doc_typestring

Identity document types:

  • PP - Passport
  • AK - Identity card
Enum"PP""AK"
doc_nostring

Customer document number.

vendor_phonestring

Vendor/E-shop phone number.

vendor_emailstring

E-shop info e-mail.

vendor_namestring

Vendor/E-shop name.

vendor_imgstring

Internet link to E-shop logo image

order_jsonobjectrequired

Shopping cart expressed in JSON array.

order_json.​namestring

For example: Lygintuvas

order_json.​categorystring

For example: B

order_json.​pricestring

For example: 113.56

order_json.​quantitynumber

For example: 1

Responses

Creates a new contract

Bodyapplication/json
appl_tokenstring

Unique application token.

error_codestring

Error code:

  • AUTHENTICATION_FAILURE
  • WRONG_RETURN_URL
  • WRONG_ORDER_ID
error_messagestring

Error description:

  • API key incorrect
  • Return url entered is incorrect
  • Order id entered is incorrect
redirect_urlstring

Redirect URL.

errorsArray of arrays

System errors back trace list.

Response
application/json
{ "appl_token": "F0C551ECCAA8AF5882754D8BF81C1A0A9EE3FE92", "error_code": "", "error_message": "", "redirect_url": "example.com", "errors": [] }

Getting redirection URL to E-shop

Request

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.

Security
apiKeyAuth
Path
uuidstringrequired

Eshop unique identifier.

Example: c3945e9e-426f-8859-8b60-3b9e9a46d101
appl-tokenstringrequired

Unique Leasing application token.

Example: 0E7F74967CA051F45E14AE2B0E6EB1B70A3292EE

Responses

Redirect to e-Leasing+

Bodyapplication/json
redirect_urlstring

Redirect URL.

errorsArray of arrays

System errors back trace list.

Response
application/json
{ "redirect_url": "example.com", "errors": [] }

E-shop to e-Leasing+ forwarding

Request

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).

Security
apiKeyAuth
Path
appl-tokenstringrequired

Unique Leasing application token.

Example: 0E7F74967CA051F45E14AE2B0E6EB1B70A3292EE

Responses

Redirect to e-Leasing+

Response
No content

Check the status of the leasing agreement

Request

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.

Security
apiKeyAuth
Bodyapplication/jsonrequired
appl_tokenstringrequired

Unique Leasing application token.

Example: "0E7F74967CA051F45E14AE2B0E6EB1B70A3292EE"
order_idstringrequired

Unique E-shop shopping cart id.

Example: "5E13I266GV"
uuidstringrequired

Eshop unique identifier.

Example: "c3945e9e-426f-8859-8b60-3b9e9a46d101"

Responses

Contract status

Bodyapplication/json
resultstringrequired

Status code:

  • ERROR
  • INIT_AUTH
  • POST_RECEIVED
  • WAITING_FOR_PERMISSION
  • PERMISSION_SIGNED
  • VALIDATING_INFO
  • WAITING_FOR_SIF_CONFIRM
  • WAITING_FOR_DEAL_SIGN
  • NEED_HELP
  • NO_LOAN_POSSIBLE
  • CLIENT_CANCELED
  • SIGNED_DEAL
  • SIGNED_DEAL_NO_ADVANCE
  • SIGNED_DEAL_YOUR_ADVANCE
  • SIGNED_DEAL_OFFLINE
result_msgstringrequired

In case of error, status code is ERROR and the definition explains the error. In case the advance payment is needed from the client - the amount is shown in the field advance. Further additional information may be displayed in the result_info field. Status code description:

  • ERROR - Error
  • INIT_AUTH - Session between e-shop ant web service created
  • POST_RECEIVED - Client start work
  • WAITING_FOR_PERMISSION - Client does not have a permission
  • PERMISSION_SIGNED - Permission signed
  • VALIDATING_INFO - Permission signed, client may continue shopping process
  • WAITING_FOR_SIF_CONFIRM - Waiting for SIF confirmation
  • WAITING_FOR_DEAL_SIGN - Credit chosen, waiting for contract confirmation
  • NEED_HELP - Customers need help
  • NO_LOAN_POSSIBLE - Credit cannot be given to client
  • CLIENT_CANCELED - Client canceled order
  • SIGNED_DEAL - Contract completed
  • SIGNED_DEAL_NO_ADVANCE - Contract completed without advance
  • SIGNED_DEAL_YOUR_ADVANCE - Contract completed and advance must pay to e-shop
  • SIGNED_DEAL_OFFLINE - Contract completed in Inbank accounting system
result_infostringrequired

Additional information.

advancenumberrequired

Advance payment required from the client.

currencystringrequired

Currency code by ISO-4217. For example: LTL, EUR, USD.

contract_nostring

Contract number. If application is in deal phase, then contract does not exist.

appl_tokenstringrequired

Unique Leasing application token.

order_idstringrequired

Unique E-shop shopping cart id.

errorsArray of arrays

List of critical errors.

Response
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": [] }