Создать запрос на списание/получение денег
POST
/api/v1/social/money/charge
const url = 'https://core.example.com/api/v1/social/money/charge';const options = { method: 'POST', headers: {'session-token': '<session-token>', 'Content-Type': 'application/json'}, body: '{"charge":{"to_profile_id":1,"to_profile":"example","to_account_id":1,"amount":1,"currency":"example","message":"example","description":"example","charge_for":"example","global":1,"api_payment_token":"example","order_number":"example","source":"example","extra_param":"example","country_code":"example","btc_address":"example","pic_ids":[1]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://core.example.com/api/v1/social/money/charge \ --header 'Content-Type: application/json' \ --header 'session-token: <session-token>' \ --data '{ "charge": { "to_profile_id": 1, "to_profile": "example", "to_account_id": 1, "amount": 1, "currency": "example", "message": "example", "description": "example", "charge_for": "example", "global": 1, "api_payment_token": "example", "order_number": "example", "source": "example", "extra_param": "example", "country_code": "example", "btc_address": "example", "pic_ids": [ 1 ] } }'Authorizations
Заголовок раздела «Authorizations»Parameters
Заголовок раздела « Parameters »Query Parameters
Заголовок раздела «Query Parameters»segregated_account_id
integer
ID business account, к которому имеет доступ текущий пользователь
Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
charge
required
object
to_profile_id
integer
to_profile
string
to_account_id
Передаётся banking-клиентом, но отсутствует в strong params Core и фактически игнорируется
integer
amount
required
number format: double
currency
required
string
message
string
description
string
charge_for
Merchant private key или телефон
string
global
integer
api_payment_token
string
order_number
string
source
string
extra_param
string
country_code
string
btc_address
string
pic_ids
Array<integer>
Examplegenerated
{ "charge": { "to_profile_id": 1, "to_profile": "example", "to_account_id": 1, "amount": 1, "currency": "example", "message": "example", "description": "example", "charge_for": "example", "global": 1, "api_payment_token": "example", "order_number": "example", "source": "example", "extra_param": "example", "country_code": "example", "btc_address": "example", "pic_ids": [ 1 ] }}Responses
Заголовок раздела « Responses »Успешный ответ
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
expiration
string
session
string
key
additional properties
any
object
key
additional properties
any
string
key
additional properties
any
Example
{ "success": false, "status": 403}