---
# System prepended metadata

title: Интеграция HoneyMoney

---

# API Интеграция HoneyMoney 

В этом документе вы найдете набор инструкций по интеграции **[HoneyMoney](https://platform.moneyhoney.io/login)** на ваш сайт.

**Пожалуйста, не стесняйтесь обращаться** к [@hyperreal_honeymoney](https://t.me/hyperreal_honeymoney), [@honeymoneylutic](https://t.me/honeymoneylutic) **по любым техническим проблемам и вопросам**.

## Авторизация


> POST **`https://api.moneyhoney.io/api/v1/security/login`**

Body:
```json
{
    "password": "%Your password%",
    "provider": "db",
    "refresh": true,
    "username": "%Your username%"
}
```

Response:
```json
{
    "access_token": "%Access token for authorization headers%",
    "refresh_token": "%Refresh token%"
}
```

## Обновление Access token
> POST **`https://api.moneyhoney.io/api/v1/security/refresh`**

Headers:
```json
    --header 'Authorization: Bearer $refresh_token'
```

Response: 
```json 
{
    "access_token": "%access_token%"
}
```

## Создание транзакции 

> POST **`https://api.moneyhoney.io/api/v1/transaction/manage/new`**

Headers:
```json
    --header 'Authorization: Bearer $access_token'
    --header 'Content-Type: application/json'
```

Body:
```json
{
    "amount": "%Transaction amount%",
    "card": "%Card number, optional field%", 
    "currency": "%Currency code (RUB, USD, ...)%"
}
```

Response example:
```json
{
"message": "Transaction created",
"result": {
    "amount": 100.0,
    "card_id": 2,
    "card_num": 1234567890123456,
    "changed_by_fk": 1,
    "changed_on": "Mon, 1 Jan 2024 00:00:00 GMT",
    "created_by_fk": 1,
    "created_on": "Mon, 1 Jan 2024 00:00:00 GMT",
    "currency_id": 1,
    "currency_rate": 100,
    "id": 1,
    "merchant_id": 1,
    "merchant_payload": null,
    "order_id": null,
    "pay_link" : "https://platform.moneyhoney.io/deposit/1",
    "status_id": 3,
    "username": null
    }
}
```

## Получение актуального статуса транзакции

> GET **`https://api.moneyhoney.io/api/v1/transaction/manage/status?ids=`**

Headers:
```json
    --header 'Authorization: Bearer $access_token'
    --header 'Content-Type: application/json'
```

Example:
```txt
https://api.moneyhoney.io/api/v1/transaction/manage/status?ids=1,2,3
```

Response example:
```json 
{
"message": [
        {
            "id": 1,
            "status": "Success"
        },
        {
            "id": 2,
            "status": "Fail"
        },
        {
            "id": 3,
            "status": "Processing"
        }
    ]
}
```

# Автоматическая обработка апелляций
## Создать апелляцию
> POST **`https://api.moneyhoney.io/api/v1/appellation`**

Request example:
```json
{
  "transactionTime": "2024-01-30T18:58:21.689Z",
  "transactionId": "123",
  "type": "RECALC",
  "img": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAIAAgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9vP8Ai6f/AA1P/wAyB/wpL/hFf+nv/hKv+Eh+1/8AgL/Z/wBk/wC23nf7FFFFAH//2Q==",
  "sum": 123.123,
  "comment": "Test comment"
}
```
Response example:
```json
{
  "transactionId": "123",
  "appellationId": "51d080d1-b07e-4eaa-8c31-5e6532152d0e"
}
```
|Название|Описание|Формат|Обязательно|
|--|--|--|--|
|transactionTime|Время создания транзакции|ISO-8160 time|true|
|transactionId|ID транзакции|string|true|
|type|Тип апелляции|[RECALC, CONFIRM]|true|
|img|Изображение чека/подтверждающего документа, закодированное base64|str|true|
|sum|Сумма апелляции|float|true|
|comment|Комментарий к апелляции|string|true|

## Получить статус апелляций 
> GET **`https://api.moneyhoney.io/api/v1/appellation?ids=`**

Request example:
```txt
https://api.moneyhoney.io/api/v1/appellation?ids=c692d5a9-c671-451c-8ad4-68704f83e99f,f07c7e33-b454-450a-a66d-93ab4f68a33a`
```
Response example:
```json
[
  {
    "id": "51d080d1-b07e-4eaa-8c31-5e6532152d0e",
    "status": "PENDING"
  },
  {
    "id": "51d080d1-b07e-4eaa-8c31-5e6532133333",
    "status": "PENDING"
  }
]
```
### Параметры
- **ids** - список uuid апелляций для проверки, разделённых запятыми

## Отмена апелляции
> POST `http://188.120.228.134:12311/api/v1/appellation/cancel?id=`

Request example:
```
http://188.120.228.134:12311/api/v1/appellation/cancel?id=51d080d1-b07e-4eaa-8c31-5e6532152d0e
```
Response example:
```json
{
  "id": "51d080d1-b07e-4eaa-8c31-5e6532152d0e"
}
```
### Параметры
- **id** - uuid апелляции для отмены


