# Последние покупки

## Получение настроек

<mark style="color:blue;">`GET`</mark> `https://easydonate.ru/api/v3/plugin/EasyDonate.LastPayments/getSettings`

Запрос вернет настройки плагина.

#### Headers

| Name                                       | Type   | Description              |
| ------------------------------------------ | ------ | ------------------------ |
| Shop-Key<mark style="color:red;">\*</mark> | string | Уникальный ключ магазина |

{% tabs %}
{% tab title="200: OK Запрос успешно обработан" %}

```
{
   "success": true,
   "response": {
      "enabled": true,
      "items": 6,
      "limit": 8,
      "autoplay": false,
      "show_date": false
   }
}
```

{% endtab %}

{% tab title="400: Bad Request Ошибка" %}

```
{
   "success": false,
   "error_code": 5,
   "response": "Плагин неактивен."
}
```

{% endtab %}
{% endtabs %}

## Получение последних платежей

<mark style="color:blue;">`GET`</mark> `https://easydonate.ru/api/v3/plugin/EasyDonate.LastPayments/getPayments`

Запрос вернет список N последних платежей согласно настройкам.

#### Headers

| Name                                       | Type   | Description              |
| ------------------------------------------ | ------ | ------------------------ |
| Shop-Key<mark style="color:red;">\*</mark> | string | Уникальный ключ магазина |

{% tabs %}
{% tab title="200: OK Запрос успешно обработан" %}

```
{
   "success": true,
   "response": [
      {
         "id": 530400,
         "customer": "Player123",
         "email": null,
         "shop_id": 100,
         "server": {
            "id": 100,
            "name": "Выживание",
            "ip": "127.0.0.1",
            "port": "25565",
            "rcon_ip": "127.0.0.1",
            "rcon_port": "25566",
            "rcon_password": "password"
         },
         "cost": 41.65,
         "income": 38.94275,
         "payment_type": "card",
         "sent_commands": [
            {
               "command": "lp user Player123 parent add premium",
               "response": ""
            },
            {
               "command": "bc &7Игрок &ePlayer123 &7купил привилегию &8[&3&lPremium&8]&7. Спасибо за поддержку!",
               "response": ""
            }
         ],
         "created_at": "2021-09-24 20:54:02",
         "updated_at": "2021-09-24 20:55:23",
         "products": [
            {
               "id": 11725,
               "name": "Premium",
               "description": null,
               "count": 1,
               "price": 49,
               "commands": [
                  "lp user {user} parent add premium",
                  "bc &7Игрок &e{user} &7купил привилегию &8[&3&Premium&8]&7. Спасибо за поддержку!"
               ],
               "image": "https://cp.easydonate.ru/storage/app/uploads/public/606/099/48e/60609948ed89b973308790.png",
               "sales": {
                  "massSale": {
                     "value": 7.35,
                     "description": "Массовая акция \"\\{Осенние скидки!}\"",
                     "target": {
                        "id": 163,
                        "name": "Осенние скидки!",
                        "sale": 15,
                        "shop_id": 100,
                        "start_at": "2021-09-22 20:40:00",
                        "expires_at": "2021-09-25 23:59:00",
                        "created_at": "2021-08-25 13:22:48",
                        "updated_at": "2021-09-22 20:39:02"
                     }
                  }
               }
            }
         ]
      }
   ]
}
```

{% endtab %}

{% tab title="400: Bad Request Ошибка" %}

```
{
   "success": false,
   "error_code": 5,
   "response": "Плагин неактивен."
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.easydonate.ru/plugin/easydonate.lastpayments.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.
