πŸ“‘ Kona Finance API Documentation

Welcome to Kona Finance's API Documentation

Accesing Kona's API

You can access Kona, our Credit as a Service platform, via our REST API to create operations (groups of loans) and monitor their progress as they are invested and disbursed. We offer two environments for development and production purposes:

BRX provides separate infrastructures for both Testing and Production environments. The Testing environment allows developers to conduct their integrations with simulated data, while the Production environment facilitates real financial transactions.

When you're ready to move from Testing to Production, simply update the Host and Access Token variables with the credentials provided for the Production environment to ensure a smooth transition.

Base URL

All API endpoints are relative to the base URL:

https://private.kona.finance/api/

Authentication

All endpoints require authentication using a token. Include your API token in the Authorization header of each request:

Authorization: Bearer YOUR_API_TOKEN

Replace YOUR_API_TOKEN with your actual API token.

Endpoints

Create an Operation


An operation represents a group of loans. You can group loans by any characteristic that is relevant to you (for example loans given to the same merchant or loans given on the same day). You can also create operations with a single loan.

The endpoint to create a new operation is: {BASE_URL}/dinie/operation, and you need to complete three files:

{
  "csv_file": {},
  "ccb_file": {},
  "endorsement_file": {}
}

Retrieve an Operation

You can then retrieve an operation information by calling the endpoint {BASE_URL}/dinie/operation/

The states that a loan can have are:

IDStatusExplanation
0Not ProcessedLoan registered in our platform but still not processed
1Contract CreatedContract created for the loan with its information
2Contract SentSignature requests have been sent to all stakeholders
3SignedContract has been signed by the required signers (which may not be all)
4Created In DatabaseAfter validating signatures, the loan has been registered and is getting ready for being sent to the blockchain.
5Created In Smart ContractThe loan has been registered in the blockchain and is ready for investment.
6Paid In SCLoan has been invested in the smart contract
7Fiat Payment In ProgressFiat payment is being processed (to bank account or PIX)
8Fiat Payment Done, Receipt PendingFiat payment is done
9Fiat Payment Done, Receipt SentFiat payment is done and the receipt has been sent
10Fiat Payment Done, Receipt ErrorFiat payment is done and the receipt could not be sent. Extra information is provided.
11ClosedLoan was closed, and therefore has not been invested.
12ExpiredLoan expired before receiving investment.
13CancelledLoan was cancelled.
14DeletedLoan was deleted.
99ErrorAn error occurred in any part of the workflow. Extra information is provided.

Repayments

Whenever a collateral (fiscal note, receivable, etc) has been repaid, you can inform us via the API so that we can process it accordingly. For this, you can use the endpoint {BASE_URL}/dinie/inform_repayment and include:

  • Item: JSON with all the fields from the collateral item being repaid.
  • Collateral Type: Type of the collateral.
  • Amount: Amount in BRL.
  • Due Date: Maturity date.
  • Receipt: Payment receipt file.