# Loans

Create loans from credit offers, track contract signing, disbursement, and installment payments.
See the [Simulation & Contracting](/guides/credit-workflow) guide for the complete flow.


## Simulate a loan

 - [POST /credit-offers/{credit_offer_id}/simulations](https://docs.dinie.com/en-us/apis/openapi/loans/createsimulation.md): POST /credit-offers/{credit_offer_id}/simulations

Simulate loan terms for a credit offer

## Create a loan

 - [POST /loans](https://docs.dinie.com/en-us/apis/openapi/loans/createloan.md): POST /loans

Accept a credit offer and create a loan

## Get a loan

 - [GET /loans/{loan_id}](https://docs.dinie.com/en-us/apis/openapi/loans/getloan.md): GET /loans/{loan_id}

Get a loan

## List transactions

 - [GET /loans/{loan_id}/transactions](https://docs.dinie.com/en-us/apis/openapi/loans/listtransactions.md): GET /loans/{loan_id}/transactions

List a loan's transactions

## Loan created

 - [POST loan.created](https://docs.dinie.com/en-us/apis/openapi/loans/onloancreated.md): Fires when the loan is created via POST /loans from an accepted offer.
CCB contract is generated synchronously. Includes the loan, offer, and customer IDs,
requested amount, number of installments, and signing_url for contract signing.
The loan starts with awaiting_signatures status. Present the signing link to the customer.

## Signature received

 - [POST loan.signature_received](https://docs.dinie.com/en-us/apis/openapi/loans/onloansignaturereceived.md): Fires each time an individual signer completes their signature on the CCB contract.
Includes signer identity (name, CPF), signature timestamp, and progress count
(signatures_received / signatures_required). Use it to track signing progress
and notify the customer about remaining signatures.

## Loan processing

 - [POST loan.processing](https://docs.dinie.com/en-us/apis/openapi/loans/onloanprocessing.md): Fires when all required signatures are collected and disbursement is in progress.
The loan transitions to processing status. Use it to inform the customer that
the funds are being transferred.

## Loan active

 - [POST loan.active](https://docs.dinie.com/en-us/apis/openapi/loans/onloanactive.md): Fires when the disbursement is confirmed and the loan enters the repayment phase.
Includes the requested amount (requested_amount) and the principal amount received (principal_amount).
Use it to confirm to the customer that the funds have been credited and present the installment schedule.

## Loan payment received

 - [POST loan.payment_received](https://docs.dinie.com/en-us/apis/openapi/loans/onloanpaymentreceived.md): Fires when an installment payment is recorded for the loan. Includes the amount
paid, payment date, and corresponding installment number. Use it to update the
outstanding balance in your system and notify the customer about the payment confirmation.

## Loan finished

 - [POST loan.finished](https://docs.dinie.com/en-us/apis/openapi/loans/onloanfinished.md): Fires when all loan installments are paid off and the contract is closed.
Includes the loan ID and finished status. Use it to mark the loan as
completed in your system and check if new credit offers are available.

## Loan cancelled

 - [POST loan.cancelled](https://docs.dinie.com/en-us/apis/openapi/loans/onloancancelled.md): Fires when the loan is cancelled before disbursement is completed. Includes the loan ID
and cancelled status. Use it to update the status in your system and
inform the customer. The original credit offer may still be available for a new request.

## Loan error

 - [POST loan.error](https://docs.dinie.com/en-us/apis/openapi/loans/onloanerror.md): Fires when an unrecoverable error occurs in the loan, such as a disbursement failure
or contract generation error. Includes the error code and message in the error field.
Use it to alert your team, log the issue, and inform the customer about the situation.

