1
0
forked from BRT/arc
arc/docs/api/profile.md
slava afbf3a3afb Add Ozon pay_to_new_number and pay_to_old_number XML assets
Included XML files for the "pay to new number" and "pay to old number" features in the Ozon platform.
2026-03-01 09:30:59 +07:00

128 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Profile API
[← Главная](../index.md)
Управление профилем, банковскими профилями и материалами (картами).
---
## GET `/api/v1/profile/current_profile` 🔒
Получить текущий профиль со всеми банковскими профилями.
**Ответ:**
```json
{
"success": true,
"data": {
"id": "uuid",
"api_key": "string",
"bank_profiles": [
{
"id": "uuid",
"bank_profile_external_id": 1,
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"bank_name": "ozon",
"phone_number": "+7...",
"balance": "15000",
"state": "active",
"currency": 643,
"profile_id": "uuid",
"materials": [ ... ],
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
]
}
}
```
---
## POST `/api/v1/profile/fetch_bank_profiles` 🔒
Получить список всех банковских профилей.
---
## POST `/api/v1/profile/fetch_materials` 🔒
Получить список всех материалов (карт).
---
## Bank Profile
### POST `/api/v1/profile/bank_profile` 🔒
Создать банковский профиль.
**Тело запроса:**
```json
{
"first_name": "Иван",
"last_name": "Иванов",
"middle_name": "Иванович",
"bank_name": "ozon",
"phone_number": "+79001234567",
"balance": "15000",
"state": "active",
"currency": 643
}
```
**Ответ** содержит `id` (UUID) — сохраняется как `bank_profile_id` в таблице `applications`.
### PATCH `/api/v1/profile/bank_profile/{bank_profile_id}` 🔒
Обновить данные банковского профиля (любые поля опциональны).
### PATCH `/api/v1/profile/bank_profile/{bank_profile_id}/{is_enable}` 🔒
Включить (`true`) / отключить (`false`) банковский профиль.
---
## Material (карта)
Material — это карта/счёт внутри банковского профиля.
### POST `/api/v1/profile/material` 🔒
Создать материал.
**Тело запроса:**
```json
{
"bank_profile_id": "uuid",
"card_number": "1234567890123456",
"name": "Основная карта"
}
```
**Ответ** содержит `id` (UUID) и `external_material_id` (int) — сохраняется как `material_id` в таблице `accounts`.
### PATCH `/api/v1/profile/material/{material_id}` 🔒
Обновить номер карты материала.
```json
{ "card_number": "1234567890123456" }
```
### PATCH `/api/v1/profile/material/{material_id}/{is_enable}` 🔒
Включить / отключить материал.
---
## Связь с кодом проекта
| API | Метод в коде |
|-----|-------------|
| `POST /api/v1/profile/bank_profile` | `NetworkService::postBankProfile()` |
| `PATCH /api/v1/profile/bank_profile/{id}` | `NetworkService::patchBankProfile()` |
| `POST /api/v1/profile/material` | `NetworkService::postMaterial()` |