Sale of applications
To send a loan application to the Ninja Lender system, you must do the following:
  1. 1.
    Log in to the system and get a token, which will be used in all subsequent requests.
  2. 2.
    Get the reference “Loan Purpose” and “Refuse Reason”, as the data from these directories is used when loading applications into the system.
  3. 3.
    Get the body of the template on the basis of which the application will be filled with requisites.
  4. 4.
    Create an application and send it in.
Example: We have a loan application where the borrower requests 10,000 for 30 days to buy household appliances, but we can’t give out a loan due to discrepancy with age restrictions.
To begin with, we find the necessary loan purpose (in the example below, this is the purpose with "id": "2")
1
[
2
{
3
"code": 0,
4
"message": "ok",
5
"data": [
6
{
7
"id": 1,
8
"label": "health_care",
9
"title": "Health care"
10
},
11
{
12
"id": 2,
13
"label": "other_purchases",
14
"title": "Other purchases"
15
},
16
{
17
"id": 3,
18
"label": "debt_restructuring",
19
"title": "Debt restructuring"
20
}
21
],
22
"log_key": "750"
23
}
24
]
Copied!
and refuse reason (in the example below, this is the reason with "id": "4")
1
[
2
{
3
"code": 0,
4
"message": "ok",
5
"data": [
6
{
7
"id": 1,
8
"label": "auto_scoring",
9
"title": "Auto scoring"
10
},
11
{
12
"id": 2,
13
"label": "unstable_income",
14
"title": "Unstable income"
15
},
16
{
17
"id": 3,
18
"label": "low_income",
19
"title": "Low Income"
20
},
21
{
22
"id": 4,
23
"label": "age_criteria",
24
"title": "Age criteria"
25
}
26
],
27
"log_key": "750"
28
}
29
]
Copied!
Next we get the body of the template
1
[
2
{
3
"code": 0,
4
"message": "ok",
5
"data": {
6
"body": {
7
"age": {
8
"id": "4",
9
"kind": 2,
10
"type": 0,
11
"label": "age",
12
"required": true,
13
"variants": null,
14
"description": null,
15
"title": "Age"
16
},
17
"income": {
18
"id": "5",
19
"kind": 2,
20
"type": 0,
21
"label": "income",
22
"required": true,
23
"variants": null,
24
"description": null,
25
"title": "Income"
26
},
27
"marital_status": {
28
"id": "14",
29
"kind": 5,
30
"type": 0,
31
"label": "marital_status",
32
"required": false,
33
"variants": [
34
"married",
35
"single",
36
"widowed",
37
"divorced"
38
],
39
"description": null,
40
"title": "Marital status"
41
}
42
43
},
44
"id": 20,
45
"label": "1-8test",
46
"description": null,
47
"title": "1-8test"
48
},
49
"log_key": "757"
50
}
51
]
Copied!
And we proceed to compile JSON to upload the application. To begin, fill in the amount, the minimum amount, the term, the cause of failure, purpose of the loan and what template we use for application
1
{
2
"params": {
3
"amount": "10000",
4
"price_min": "10",
5
"term": "864000",
6
"refuse_reason": 4,
7
"purpose": 2,
8
"template": "4"
9
"requisites": {
10
11
},
12
13
}
14
}
Copied!
Now we need to fill in the details of the application based on the body of the template. Each requisite in the body is described by a JSON object, where the object key is the name (key) of the requisite, and a description of the requisite contained in the value.
Example of requisite from the template body:
Key
Type
Description
id
int
id of requisite
kind
int
Kind of requisite, defines data type for requisite value:
0 – string
1 – text
2 – number
3 – date
4 – boolean
5 – handbook(in the case of this kind, the system will expect, as the value requisite, one of the elements from the variants array)
label
string
requisite name
required
boolean
is requisite required
variants
JSON.array
list of variants for handbook kind requisites
description
string
description of requisite
title
string
requisite title
1
{
2
"params": {
3
"amount": "10000",
4
"price_min": "10",
5
"term": "864000",
6
"refuse_reason": 4,
7
"purpose": 2,
8
"template": "4"
9
"requisites": {
10
"age":"",
11
"income":"",
12
"marital_status":""
13
},
14
15
}
16
}
Copied!
We fill in the requisites according to their types
1
{
2
"params": {
3
"amount": "10000",
4
"price_min": "10",
5
"term": "864000",
6
"refuse_reason": 4,
7
"purpose": 2,
8
"template": "4"
9
"requisites": {
10
"age":"55",
11
"income":"10000",
12
"marital_status":"single"
13
},
14
15
}
16
}
Copied!
Now the JSON of application is ready and it can be uploaded to the system.
Last modified 1yr ago
Copy link