# 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. Endpoint: POST /v1/exchanges/market Version: 1.1.2 Security: OAuth2Flow ## 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 fields (application/json): - `source_account_id` (string, required) Source account from which funds will be withdrawn - `destination_account_id` (string, required) Destination account where funds will be deposited - `amount` (number, required) The amount to be exchanged depending on the the action. - `action` (string, required) 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 ## Response 200 fields (application/json): - `data` (object, required) - `data.id` (string, required) Unique ID of the exchange request - `data.status` (string, required) Status of the Exchange. Cannot be modified directly by the client. * REQUESTED - Exchange request is created and has passed validation. It must be accepted at which point it will be executed. * ACCEPTED - Exchange request has been accepted and is waiting execution. At this point it cannot be cancelled. * EXPIRED - Occurs when an exchange request was not accepted within a reasonable time frame. The exchange cannot be replayed from this state. * CANCELLED - Exchange request was cancelled. Only available prior to acceptance. The exchange request cannot be replayed from this state. * EXECUTED - Exchange request has been executed, it is completed with all ledger entries performed. * REJECTED - Exchange request was rejected and cannot be executed. Enum: "REQUESTED", "ACCEPTED", "EXPIRED", "CANCELLED", "EXECUTED", "REJECTED" - `data.created_timestamp` (string, required) Time when the exchange request was generated - `data.exchange_type` (string, required) The type of exchange being performed. Enum: "MARKET", "QUOTE" - `data.action` (string, required) The action defines which side of the exchange to fix. * 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" - `data.source_details` (object, required) Details of transaction to be performed on the source account on acceptance - `data.source_details.source_account_id` (string, required) Source account ID - `data.source_details.asset_type_id` (string) Asset type IDs follow a simple structure as follows: {$BLOCKCHAIN}_{$NETWORK}_{$CURRENCY_CODE} Simple asset type to test with include. - ETHEREUM_SEPOLIA_ETH - ETHEREUM_SEPOLIA_USDC - SOLANA_DEVNET_SOL - BITCOIN_TESTNET_BTC - FIAT_TESTNET_USD - FIAT_TESTNET_USD - FIAT_MAINNET_USD - FIAT_TESTNET_EUR - `data.source_details.amount_to_debit` (number, required) Amount that will be debited from the source account - `data.destination_details` (object, required) Details of transaction to be performed on the destination account on acceptance - `data.destination_details.destination_account_id` (string, required) Destination account ID - `data.destination_details.asset_type_id` (string) Asset type IDs follow a simple structure as follows: {$BLOCKCHAIN}_{$NETWORK}_{$CURRENCY_CODE} Simple asset type to test with include - ETHEREUM_SEPOLIA_ETH - ETHEREUM_SEPOLIA_USDC - SOLANA_DEVNET_SOL - BITCOIN_TESTNET_BTC - FIAT_TESTNET_USD - FIAT_TESTNET_USD - FIAT_MAINNET_USD - FIAT_TESTNET_EUR - `data.destination_details.amount_to_credit` (number, required) Amount that will be credited to the destination account ## Response 400 fields (application/json): - `errors` (array) Error List - `errors.code` (string) Layer2 Standard Error Code - `errors.description` (string) Error Description ## Response 401 fields (application/json): - `errors` (array) Error List - `errors.code` (string) Layer2 Standard Error Code - `errors.description` (string) Error Description ## Response 404 fields (application/json): - `errors` (array) Error List - `errors.code` (string) Layer2 Standard Error Code - `errors.description` (string) Error Description ## Response 500 fields (application/json): - `errors` (array) Error List - `errors.code` (string) Layer2 Standard Error Code - `errors.description` (string) Error Description