Skip to content

Create an exchange between accounts

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

Sent by the banking client but not permitted by Core strong params and therefore ignored

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

Successful response

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

Authorization, validation, or business-rule error

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
}