# Application loading

&#x20;For a single query to the system you can load up to 50 applications.

**method:** POST

**url:** <https://ninjalender.online/client/loan/load&#x20>;

**Headers:**

| header key     | header content    |
| -------------- | ----------------- |
| Content-Type:  | application/json; |
| Authorization: | Bearer AToken;    |

\
&#x20;Where AToken is the token that was received during authorization.&#x20;

**Request body:**

| Key    | Type        | Required | Description        |
| ------ | ----------- | -------- | ------------------ |
| params | JSON.object | +        | Request parameters |

&#x20;**params:**

| Key            | Type        | Required | Description                                                                                                                                                                    |
| -------------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| amount         | number      | +        | application amount                                                                                                                                                             |
| price\_min     | number      | +        | minimal price of application                                                                                                                                                   |
| price          | number      | +        | price                                                                                                                                                                          |
| term           | string      | +        | term of loan (in seconds)                                                                                                                                                      |
| template       | int         | +        | Loan template from the templates that owned by the organization                                                                                                                |
| requisites     | JSON.object | +        | Requisites of the application. keys are copied from the template body. As a value, an object is transmitted with the value key in which the value of the attribute is written. |
| refuse\_reason | int         | +        | Refuse reason                                                                                                                                                                  |
| purpose        | int         | +        | Loan purpose                                                                                                                                                                   |
| refuse\_date   | DateTime    | -        | Refuse date in format (Y-m-d h:i:s) converted to UTC+0 timozone for the correct calculation of the freshness of the application                                                |

Example of filing application requisites by "Customer Loan Basic" template

| Key                               | Type   | Variants | Required | Description | Visible    |
| --------------------------------- | ------ | -------- | -------- | ----------- | ---------- |
| borrower\_personal\_code          | string |          | +        |             | only owner |
| borrower\_first\_name             | string |          | +        |             | only owner |
| borrower\_last\_name              | string |          | +        |             | only owner |
| borrower\_phone                   | string |          | +        |             | only owner |
| borrower\_email                   | string |          | +        |             | only owner |
| borrower\_address                 | string |          | +        |             | only owner |
| borrower\_monthly\_income\_amount | string |          | +        |             |            |
| borrower\_monthly\_income\_source | string |          | +        |             |            |

| Key     | Type       | Description   |
| ------- | ---------- | ------------- |
| code    | int        | Response code |
| message | string     | Message       |
| data    | JSON.array | Response data |
| data.id | int        | id of loan    |

&#x20;**Request example:**

```
{
  "data": [
    {
      "params": {
        "amount": 1000,
        "price_min": 120,
        "price": 160,
        "term": 86400,
        "template": 26,
        "refuse_reason": 12,
        "requisites": {
          "borrower_personal_code": {
            "value": "some_borrower_personal_code"
          },
          "borrower_first_name": {
            "value": "some_borrower_first_name"
          },
          "borrower_last_name": {
            "value": "some_borrower_last_name"
          },
          "borrower_phone": {
            "value": "some_borrower_phone"
          },
          "borrower_email": {
            "value": "some_borrower_email"
          },
          "borrower_address": {
            "value": "some_borrower_address"
          },
          "borrower_monthly_income_amount": {
            "value": "some_borrower_monthly_income_amount"
          },
          "borrower_monthly_income_source": {
            "value": "some_borrower_monthly_income_source"
          }
        }
      }
    },
    {
      "params": {
        "amount": 1100,
        "price_min": 110,
        "price": 130,
        "term": 86400,
        "template": 26,
        "refuse_reason": 13,
        "requisites": {
          "borrower_personal_code": {
            "value": "some_borrower_personal_code"
          },
          "borrower_first_name": {
            "value": "some_borrower_first_name"
          },
          "borrower_last_name": {
            "value": "some_borrower_last_name"
          },
          "borrower_phone": {
            "value": "some_borrower_phone"
          },
          "borrower_email": {
            "value": "some_borrower_email"
          },
          "borrower_address": {
            "value": "some_borrower_address"
          },
          "borrower_monthly_income_amount": {
            "value": "some_borrower_monthly_income_amount"
          },
          "borrower_monthly_income_source": {
            "value": "some_borrower_monthly_income_source"
          }
        }
      }
    },
    {
      "params": {
        "amount": 1200,
        "price_min": 100,
        "price": 150,
        "term": 86400,
        "template": 26,
        "refuse_reason": 12,
        "requisites": {
          "borrower_personal_code": {
            "value": "some_borrower_personal_code"
          },
          "borrower_first_name": {
            "value": "some_borrower_first_name"
          },
          "borrower_last_name": {
            "value": "some_borrower_last_name"
          },
          "borrower_phone": {
            "value": "some_borrower_phone"
          },
          "borrower_email": {
            "value": "some_borrower_email"
          },
          "borrower_address": {
            "value": "some_borrower_address"
          },
          "borrower_monthly_income_amount": {
            "value": "some_borrower_monthly_income_amount"
          },
          "borrower_monthly_income_source": {
            "value": "some_borrower_monthly_income_source"
          }
        }
      }
    }
  ]
}
```

&#x20;**Response example:**

```
[
  {
    "code": 0,
    "message": "ok",
    "data": {
      "id": "1279"
    }
  },
  {
    "code": 0,
    "message": "ok",
    "data": {
      "id": "1280"
    }
  },
  {
    "code": 0,
    "message": "ok",
    "data": {
      "id": "1281"
    }
  }
]
```

&#x20;**List of errors:**

| Key      | Message                                            |
| -------- | -------------------------------------------------- |
| -99      | System error! Try again later or contact us        |
| -98      | Expired token                                      |
| -2000001 | Invalid token                                      |
| -2040701 | data is required                                   |
| -2040702 | Cant load more than 50 loans in one request        |
| -2040801 | Params is required                                 |
| -2040802 | Refuse reason not found                            |
| -2040803 | refuse reason must not be blank                    |
| -2040804 | loan purpose must not be blank                     |
| -2040805 | loan purpose not found                             |
| -2040806 | Template must not be blank                         |
| -2040807 | Template not found                                 |
| -2040808 | Cant use inactive template                         |
| -2040809 | Cant use not moderated template                    |
| -2040810 | Cant use global template                           |
| -2040811 | Cant use template of other organization            |
| -2040812 | Refuse date expected date                          |
| -2040813 | requisite needed                                   |
| -2040814 | requisite must not be blank                        |
| -2040815 | requisite not valid. Expected date in format Y-m-d |
| -2040816 | requisite not valid. Expected number               |
| -2040817 | requisite not valid. Expected one of               |
| -2040818 | requisite not valid. Expected boolean              |
| -2040819 | Requisites not presented in template               |
| -2040820 | Need "value" param in requisite                    |
| -2040821 | mime type is unsupported                           |
| -2040822 | max file size exceeded                             |
| -2040823 | Amount must be >0                                  |
| -2040824 | Amount must be a number                            |
| -2040825 | Price min must be >0                               |
| -2040826 | Price min must be a number                         |
| -2040827 | Price min must be <= price                         |
| -2040828 | Price must be >0                                   |
| -2040829 | Price must be a number                             |
| -2040830 | Term must be >0                                    |
| -2040831 | Term must be in seconds                            |
| -2040832 | Amount must not be blank                           |
| -2040833 | Price min must not be blank                        |
| -2040834 | Price must not be blank                            |
| -2040835 | Term must not be blank                             |
| -2040836 | Cant change stage. AUCTION in progress             |
| -2040837 | Loan is not unique                                 |
| -2040838 | Loan is not fresh                                  |
| -2040839 | Cant change stage                                  |
| -2040840 | refuse\_reason must be numeric                     |
| -2040841 | purpose must be numeric                            |
| -2040842 | template must be numeric                           |
