π‘ 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:
- Testing Environment: https://testing.private.kona.finance/swagger/
- Production Environment: https://private.kona.finance/swagger/
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:
ID | Status | Explanation |
---|---|---|
0 | Not Processed | Loan registered in our platform but still not processed |
1 | Contract Created | Contract created for the loan with its information |
2 | Contract Sent | Signature requests have been sent to all stakeholders |
3 | Signed | Contract has been signed by the required signers (which may not be all) |
4 | Created In Database | After validating signatures, the loan has been registered and is getting ready for being sent to the blockchain. |
5 | Created In Smart Contract | The loan has been registered in the blockchain and is ready for investment. |
6 | Paid In SC | Loan has been invested in the smart contract |
7 | Fiat Payment In Progress | Fiat payment is being processed (to bank account or PIX) |
8 | Fiat Payment Done, Receipt Pending | Fiat payment is done |
9 | Fiat Payment Done, Receipt Sent | Fiat payment is done and the receipt has been sent |
10 | Fiat Payment Done, Receipt Error | Fiat payment is done and the receipt could not be sent. Extra information is provided. |
11 | Closed | Loan was closed, and therefore has not been invested. |
12 | Expired | Loan expired before receiving investment. |
13 | Cancelled | Loan was cancelled. |
14 | Deleted | Loan was deleted. |
99 | Error | An 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.
Updated about 1 month ago