Обновить счёт через singular-resource маршрут
PUT
/api/v1/bank_accounts
const url = 'https://core.example.com/api/v1/bank_accounts';const options = { method: 'PUT', headers: {'session-token': '<session-token>', 'Content-Type': 'application/json'}, body: '{"id":1,"value":"example","currency":"EUR","token":"example","status":"pending","provider":"default","swift_code":"example","uk_sort_code":"example","uk_account_number":"example","approved":true,"details":{"beneficiary_type":"individual_stakeholder","beneficiary_name":"example","beneficiary_first_name":"example","beneficiary_last_name":"example","beneficiary_country":"example","beneficiary_city":"example","beneficiary_street":"example","beneficiary_address":"example","beneficiary_region":"example","beneficiary_postalcode":"example","beneficiary_bank":"example","beneficiary_phone":"example","beneficiary_email":"hello@example.com","beneficiary_account_name":"example","swift_code":"example","corresponding_bank":"example","corresponding_iban":"example","corresponding_swift_code":"example","corresponding_bank_country":"example","corresponding_bank_address":"example","account_number_compass":"example","reference_code":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://core.example.com/api/v1/bank_accounts \ --header 'Content-Type: application/json' \ --header 'session-token: <session-token>' \ --data '{ "id": 1, "value": "example", "currency": "EUR", "token": "example", "status": "pending", "provider": "default", "swift_code": "example", "uk_sort_code": "example", "uk_account_number": "example", "approved": true, "details": { "beneficiary_type": "individual_stakeholder", "beneficiary_name": "example", "beneficiary_first_name": "example", "beneficiary_last_name": "example", "beneficiary_country": "example", "beneficiary_city": "example", "beneficiary_street": "example", "beneficiary_address": "example", "beneficiary_region": "example", "beneficiary_postalcode": "example", "beneficiary_bank": "example", "beneficiary_phone": "example", "beneficiary_email": "hello@example.com", "beneficiary_account_name": "example", "swift_code": "example", "corresponding_bank": "example", "corresponding_iban": "example", "corresponding_swift_code": "example", "corresponding_bank_country": "example", "corresponding_bank_address": "example", "account_number_compass": "example", "reference_code": "example" } }'ID должен присутствовать среди полей запроса. services/banking-api вызывает этот
маршрут только с app-token, однако Core-контроллер требует session-token; это
расхождение отмечено в отчёте.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
id
required
integer
value
string
currency
string
Example
EURtoken
string
status
string
provider
string
swift_code
string
uk_sort_code
string
uk_account_number
string
approved
boolean
details
object
beneficiary_type
string
beneficiary_name
string
beneficiary_first_name
string
beneficiary_last_name
string
beneficiary_country
string
beneficiary_city
string
beneficiary_street
string
beneficiary_address
string
beneficiary_region
string
beneficiary_postalcode
string
beneficiary_bank
string
beneficiary_phone
string
beneficiary_email
string format: email
beneficiary_account_name
string
swift_code
string
corresponding_bank
string
corresponding_iban
string
corresponding_swift_code
string
corresponding_bank_country
string
corresponding_bank_address
string
account_number_compass
string
reference_code
string
key
additional properties
any
id
required
integer
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}