Create Loan

POST /v1/borrowers/{borrower_id}/loans/{loan_id}/create

Create a new loan for a borrower, if the borrower does not exist it will be created

Path parameters

Query parameters

  • When this parameter is set to True, the transaction will be handled as if it had occurred on the date specified in the occurred_on field, rather than the current date and time. This is useful when migrating data from a legacy system or for building test cases.

    Default value is false.

application/json

Body

  • loan object

    Additional properties are allowed.

    Hide loan attributes Show loan attributes object
    • The initial principal amount of the loan

      Minimum value is 0.

    • config_id string Required

      The ID of the loan configuration associated with this loan.

      Minimum length is 1.

    • daily_fee_charge null | number

      The fee charged for each day the loan is outstanding. The fee is accrued daily until reaching the max_charge specified in the loan configuration.

      Minimum value is 0.

    • The effective annual interest rate charged on the overdue balance of the loan, as a percentage. If configured above the usury rate it will adjusted according to the behavior specified in the loan configuration.

      Minimum value is 0.

    • due_dates array[string(date-time)] | null Required

      A list of due dates for the loan, expressed as a datetime object with timezone information. The time can be overridden depending on the loan configuration attribute: due_date_preference, the final due dates will be displayed in the response.

      At least 1 element.

    • guarantee_provider null | string

      The type of installment fee to be charged.

    • Same as installment_fee_charge

      Minimum value is 0.

    • Specifies the total fee amount to be charged throughout the lifetime of the loan. The fee will be split and charged in equal amounts on the due dates of the loan.

      Minimum value is 0.

    • The effective annual interest rate charged throughout the loan, as a percentage. If the interest rate exceeds the usury rate at the time of origination, it will be adjusted according to the usury rules defined in the loan configuration.

      Minimum value is 0.

    • origination_date string(date-time)

      The origination date is the starting date and time for the loan, expressed as a datetime object with timezone information. Interest and fees begin accruing from this point onward. The time part can be overridden depending on the loan configuration attribute: origination_date_preference.

    • owner null | string

      The ID of the owner of the loan.

  • occurred_on string(date-time)

    Represents the date and time at which the lender reported the transaction. This field is expressed as a datetime object with timezone information and is provided for reference purposes only. Please note that the 'occurred on' date is not used in loan management operations and does not affect the processing or status of the transaction. It is provided solely to track when the lender believes the transaction occurred, regardless of when it was actually processed by the loan management system. However if the request comes with the is_migration parameter set to true the occurred_on field will be used to handle the request as if it had happened on that date.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • The initial principal amount of the loan

      Minimum value is 0.

    • config_id string Required

      The ID of the loan configuration associated with this loan.

      Minimum length is 1.

    • daily_fee_charge null | number

      The fee charged for each day the loan is outstanding. The fee is accrued daily until reaching the max_charge specified in the loan configuration.

      Minimum value is 0.

    • The effective annual interest rate charged on the overdue balance of the loan, as a percentage. If configured above the usury rate it will adjusted according to the behavior specified in the loan configuration.

      Minimum value is 0.

    • due_dates array[string(date-time)] | null Required

      A list of due dates for the loan, expressed as a datetime object with timezone information. The time can be overridden depending on the loan configuration attribute: due_date_preference, the final due dates will be displayed in the response.

      At least 1 element.

    • guarantee_provider null | string

      The type of installment fee to be charged.

    • id string

      Identifier for the loan used by the lender.

    • Same as installment_fee_charge

      Minimum value is 0.

    • Specifies the total fee amount to be charged throughout the lifetime of the loan. The fee will be split and charged in equal amounts on the due dates of the loan.

      Minimum value is 0.

    • The effective annual interest rate charged throughout the loan, as a percentage. If the interest rate exceeds the usury rate at the time of origination, it will be adjusted according to the usury rules defined in the loan configuration.

      Minimum value is 0.

    • kordev_id integer

      Identifier for the loan used internally by Kordev. The ID is unique for each borrower but not globally unique.

    • origination_date string(date-time)

      The origination date is the starting date and time for the loan, expressed as a datetime object with timezone information. Interest and fees begin accruing from this point onward. The time part can be overridden depending on the loan configuration attribute: origination_date_preference.

    • owner null | string

      The ID of the owner of the loan.

    • Optional field that will be returned unmodified in each response. Especially useful for keeping track of responses in batch requests.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • code integer

      Application-specific error code.

    • context object

      Application context.

      Additional properties are allowed.

    • error string

      Error message.

    • status string

      Status text.

  • 404 application/json

    Not Found

    Hide response attributes Show response attributes object
    • code integer

      Application-specific error code.

    • context object

      Application context.

      Additional properties are allowed.

    • error string

      Error message.

    • status string

      Status text.

  • 409 application/json

    Conflict

    Hide response attributes Show response attributes object
    • code integer

      Application-specific error code.

    • context object

      Application context.

      Additional properties are allowed.

    • error string

      Error message.

    • status string

      Status text.

  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • code integer

      Application-specific error code.

    • context object

      Application context.

      Additional properties are allowed.

    • error string

      Error message.

    • status string

      Status text.

POST /v1/borrowers/{borrower_id}/loans/{loan_id}/create
curl \
 --request POST 'https://lms.kordev.io/v1/borrowers/{borrower_id}/loans/{loan_id}/create' \
 --header "Content-Type: application/json" \
 --data '{"loan":{"amount_financed":163333.34,"config_id":"string","daily_fee_charge":null,"delinquency_interest_rate":0.3848,"due_dates":["2020-02-01T23:59:59.999999-05:00, 2020-03-01T23:59:59.999999-05:00"],"guarantee_provider":"FGA","installment_fee_2_charge":null,"installment_fee_charge":null,"interest_rate":0.3848,"origination_date":"2020-01-01T00:00:00-05:00","owner":"BANK_1"},"occurred_on":"2020-01-01T10:15:20-05:00","request_id":"string"}'
Request examples
{
  "loan": {
    "amount_financed": 163333.34,
    "config_id": "string",
    "daily_fee_charge": null,
    "delinquency_interest_rate": 0.3848,
    "due_dates": [
      "2020-02-01T23:59:59.999999-05:00, 2020-03-01T23:59:59.999999-05:00"
    ],
    "guarantee_provider": "FGA",
    "installment_fee_2_charge": null,
    "installment_fee_charge": null,
    "interest_rate": 0.3848,
    "origination_date": "2020-01-01T00:00:00-05:00",
    "owner": "BANK_1"
  },
  "occurred_on": "2020-01-01T10:15:20-05:00",
  "request_id": "string"
}
Response examples (200)
{
  "amount_financed": 163333.34,
  "config_id": "string",
  "daily_fee_charge": null,
  "delinquency_interest_rate": 0.3848,
  "due_dates": [
    "2020-02-01T23:59:59.999999-05:00, 2020-03-01T23:59:59.999999-05:00"
  ],
  "guarantee_provider": "FGA",
  "id": "string",
  "installment_fee_2_charge": null,
  "installment_fee_charge": null,
  "interest_rate": 0.3848,
  "kordev_id": 42,
  "origination_date": "2020-01-01T00:00:00-05:00",
  "owner": "BANK_1",
  "request_id": "string"
}
Response examples (400)
{
  "code": 42,
  "context": {},
  "error": "string",
  "status": "string"
}
Response examples (404)
{
  "code": 42,
  "context": {},
  "error": "string",
  "status": "string"
}
Response examples (409)
{
  "code": 42,
  "context": {},
  "error": "string",
  "status": "string"
}
Response examples (500)
{
  "code": 42,
  "context": {},
  "error": "string",
  "status": "string"
}