# Спецификация

{% code title="Базовый URL" %}

```url
https://api.crystalpay.io/v3/
```

{% endcode %}

### Формат запросов

* **Метод HTTP**: Все запросы к API должны отправляться с использованием метода **POST**.
* **Формат данных**: Параметры запросов передаются в теле запроса в формате **JSON**. Заголовок Content-Type должен быть установлен на `application/json`.

### Формат ответа

* **Формат данных ответа**: Ответ от сервера всегда возвращается в формате **JSON**.
* **Код успешного ответа**: При успешной обработке запроса сервер возвращает **HTTP код 200** вместе с JSON-ответом, содержащим данные или подтверждение выполнения операции.

{% code title="Пример запроса на curl" %}

```bash
curl -X POST https://api.crystalpay.io/v3/method/list/ \
-H "Content-Type: application/json" \
-d '{
  "auth_login": "example",
  "auth_secret": "example"
}'
```

{% endcode %}

{% code title="Пример успешного ответа" %}

```json
{
  "error": false,
  "errors": []
  ...
}
```

{% endcode %}

> Если запрос был обработан с ошибкой, сервер вернёт 200 HTTP код и JSON с описанием ошибки.

{% code title="Пример ответа с ошибкой" %}

```json
{
  "error": true,
  "errors": [
    "`amount` field is required",
    ...
  ]
}
```

{% endcode %}


---

# 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.crystalpay.io/specifikaciya.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.
