# Bet

* The auction must be active.
* Bet amount can not be less than the application price.
* Bet amount cannot be less than or equal to the amount of the maximum bet at the auction.

**method:** POST

**url:** <https://ninjalender.online/client/bet/place&#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;

&#x20;After purchasing the application, its data can be sent to your webhook for the prompt acceptance of the application to work. To activate this feature you need to contact us and provide a webhook\`s url.&#x20;

**Request body:**

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

&#x20;**params:**

| Key         | Type   | Required | Description   |
| ----------- | ------ | -------- | ------------- |
| auction\_id | int    | +        | id of auction |
| amount      | number | +        | bet amount    |

&#x20;**response:**

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

&#x20;**Request example:**

```
{
  "params": {
    "auction_id": 419,
    "amount": 125
  }
}
```

&#x20;**Response example:**

```
[
  {
    "code": 0,
    "message": "ok",
    "data": {
      "id": 6785
    }
  }
]
```

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

| Key      | Message                                               |
| -------- | ----------------------------------------------------- |
| -99      | System error! Try again later or contact us           |
| -98      | Expired token                                         |
| -2000001 | Invalid token                                         |
| -2050101 | Params is required                                    |
| -2050102 | Auction id must not be blank                          |
| -2050103 | Auction not found                                     |
| -2050104 | Bet amount must be an integer                         |
| -2050105 | Amount must be >0                                     |
| -2050106 | Amount must be a number                               |
| -2050107 | Amount must not be blank                              |
| -2050108 | Amount cant be lower than or equal to max Auction bet |
| -2050109 | Amount cant be lower than loan price                  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ninja-lender.gitbook.io/api-en/api-methods/bet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
