Перейти к содержимому

Создать обмен между счетами

POST
/api/v1/exchange_requests
curl --request POST \
--url https://core.example.com/api/v1/exchange_requests \
--header 'Content-Type: application/json' \
--header 'session-token: <session-token>' \
--data '{ "exchange": { "amount": 1, "currency": "example", "target_currency": "example", "from_account_id": 1, "to_account_id": 1, "description": "example", "otc": true } }'
Media typeapplication/json
object
exchange
required
object
amount
required
number format: double
currency
string
target_currency
string
from_account_id
required
integer
to_account_id
required
integer
description
string
otc

Передаётся banking-клиентом, но не разрешён strong params Core и фактически игнорируется

boolean
Examplegenerated
{
"exchange": {
"amount": 1,
"currency": "example",
"target_currency": "example",
"from_account_id": 1,
"to_account_id": 1,
"description": "example",
"otc": true
}
}

Успешный ответ

Media typeapplication/json
object
success
required
boolean
status
required
integer
key
additional properties
any
Example
{
"success": true,
"status": 200
}

Ошибка авторизации, валидации или бизнес-правила

Media typeapplication/json
object
success
required
boolean
status
required
integer
errors
required
One of:
Array<object>
object
code
string
kind
string
nullable
expiration
string
nullable
session
string
nullable
key
additional properties
any
key
additional properties
any
Example
{
"success": false,
"status": 403
}