DEVELOPER GUIDE
How to integrate

API Only Initiation

7min

API invocation method

Request URI

The request URI consists of the following parts:

{URI-scheme}://{Host}/{resource-path}?{query-string}

Parameter description in URI:

Parameter

Description

URI-scheme

All APIs use HTTPS protocol, only support https.

Host

Different environments have different host:

  • Sandbox environment: api-testing.klavi.ai
  • Production environment: api.klavi.ai

resource-path

Resource path, i.e. API access path. APIs with different functions have different resource paths. For example:The resource-path of the product API is payment/customer/v1/auth. The resource-path of the

query-string

Query parameters are optional. Not every API has query parameters. Query parameters need to be preceded by a "?", The form is parameter_name=parameter_value. For example, ?limit=10, which means no more than 10 pieces of data can be queried.

CAUTION

Different environments have different host, only after the successful integration test in the sandbox environment can it be integrated in the production environment.

  • Sandbox environment: api-testing.klavi.ai/payment/customer/v1/auth
  • Production environment: api.klavi.ai/payment/customer/v1/auth

The credentials of the production environment is different from the sandbox environment, please reach out to us at [email protected].

Request method

Supported HTTP request methods: POST and GET.

  • For GET method, only content type: application/x-www-form-url encoded protocol format is supported
  • For POST method, only content type: application/JSON is supported at present

Character encoding

UTF-8 coding.

Start integrating Klavi payment

Before request the Klavi payment API, you must first obtain a JWT bearer token by request the auth, once you have a JWT bearer token you can submit requests on protected APIs like participants and payments.

Curl request example:

Curl


Response example:

JSON


Now that you have an access token, you can display the list of account providers participating in Open Finance to users. After the user selects his account holding institution, all you need to do is save the id for later use on the payments API.

Curl request example:

Curl


Response example:

JSON


Refer:  List participants

Now that you have a JWT access token and the participantId that the end-user selected, it's time to show the checkout and to get the user confirmation on the payment transaction. Once confirmed, you need to send the payload of the payment to be enqueued and then processed. The example below displays the minimum payload information required:

Curl


Response example:

JSON


Congratulations, you have now sent the payload of the payment initiation! Now you can check the payment initiation status through the endpoint /payments/:id/status. It only returns information to direct your next steps. Polling should be done in a few seconds intervals. A happy path should display the responses below, in this exact order:

Curl


Response 1:

JSON


Response 2:

JSON


If there is any problem in the integration, we will provide support in the way you think is most appropriate, not limited to Slack, Teams or email, please reach out to us at [email protected].