Create Exchange (Market)

When requesting a market exchange, the quote received is indicative ONLY. This represents an approximate rate from our liquidity providers. On accepting a market exchange the trade is performed at the current market rate which will be different to the quote presented to you.

Note: Not all custodians support all order types. Where the order type is not possible (Quote/Market/Fix Destination/ Fix Source) an error will be returned.

SecurityOAuth2: OAuth2Flow
Request
header Parameters
Authorization
string

OAuth bearer token (see authentication flows)

x-l2f-request-id
string

Optional Unique ID per request, useful for fault resolution/diagnosis and audit.

x-l2f-idempotency-id
string

Unique ID used to safely retry an operation. See idempotency section for more details.

Request Body schema: application/json
source_account_id
required
string

Source account from which funds will be withdrawn

destination_account_id
required
string

Destination account where funds will be deposited

amount
required
number

The amount to be exchanged depending on the the action.

action
required
string

Type of exchange being performed.

  • FIX_DESTINATION - This fixes the amount to credit to the DESTINATION account, therefore the quote provided is for how much to deduct from the SOURCE account. Think of this as 'buying' the destination amount.
  • FIX_SOURCE - This fixes the amount you want to debit from the SOURCE account, therefore the quote provided is for how much would be credited to the DESTINATION account. Think of this as 'selling' the source amount.
Enum: "FIX_DESTINATION" "FIX_SOURCE"
description
string

(Optional) Description of the transaction

Responses
200

Success

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Error

post/v1/exchanges/market
Request samples
application/json
{
  • "source_account_id": "string",
  • "destination_account_id": "string",
  • "amount": 0,
  • "action": "FIX_DESTINATION",
  • "description": "string"
}
Response samples
application/json
{
  • "data": {
    }
}
© 2023 Layer2 Financial Inc. All Rights Reserved.