Skip to main content

Create loan

POST /api/v1/Loans/create-loan

Description

This endpoint is used to create a new loan.

Tags: Loans

URL:
/api/v{version}/Loans/create-loan

ApiKey:
No API key required

Content-Type:
application/json

Request Body:
CreateLoanCommand object

Query Parameters:
version: string, required
Accept-Language: header, optional, change the default response message language from English (en) to French (fr) or English (en)

Response:
Success, returns the ID of the newly created loan.

Error Codes:
400: Bad Request
404: Resource not found
500: Internal server error

Example:

bashCopy codePOST /api/v1/Loans/create-loan
Content-Type: application/json
{
"customerId": "abcd-1234-efgh-5678",
"amount": 5000,
"term": 12,
"interestRate": 0.08,
"currency": "USD",
"startDate": "2023-02-17"
}

Response:

{
"id": "abc-123"
}

/api/v1/Loans/create-loan

Headers

Content-TypeValue
Accept-Language

Headers

Content-TypeValue
Content-Typeapplication/json

Headers

Content-TypeValue
Accepttext/plain

Body (raw)

{
"ownerId": `<uuid>`,
"productId": `<integer>`,
"accountNumber": `<string>`,
"principal": `<double>`,
"createStandingInstructionAtDisbursement": `<boolean>`,
"loanDetails": {
"productTypeList": `<string>`,
"productTypeOther": `<string>`,
"transactionType": `<string>`,
"productList": `<string>`,
"productOther": `<string>`,
"productUnits": `<string>`,
"productQuantity": `<string>`,
"productUnitPurchasePrice": `<string>`,
"productUnitSellingPrice": `<string>`,
"logisticsCostperTruck": `<string>`,
"logisticsNumberofTrucks": `<string>`,
"otherCostsAmount": `<string>`,
"otherCostsDescription": `<string>`,
"supplierAddress": `<string>`,
"paymentTenorindays": `<string>`,
"offtakerName": `<string>`,
"offtakerAddress": `<string>`,
"bankAccountName": `<string>`,
"bankAccountNumber": `<string>`,
"bankName": `<string>`,
"dateFormat": `<string>`,
"locale": `<string>`
}
}

Response: 200

{
"succeeded": `<boolean>`,
"message": `<string>`,
"errors": [
`<string>`,
`<string>`
],
"data": `<integer>`
}

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request POST \ 
--url /api/v1/Loans/create-loan \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!