Skip to main content

Execute Trade Order

This endpoint allows to execute a trade order.

Technical Details​

  • Webhooks: This operation triggers the trade_transaction_created webhook.
Authorization:

bearer

HTTP: bearer

HTTP Authorization Scheme: bearer

Headers:
Authorization: APIKey {YOUR_API_KEY}

Endpoint

POST

/api/v2/trade/execute

Request Body Sample​

{
"accountId": "00000000-0000-0000-0000-000000000000",
"product": "BTC-USD",
"type": "market",
"side": "buy",
"quantity": "1.5",
"quantityCurrency": "USD",
"previewId": "00000000-0000-0000-0000-000000000000",
"reference": "client-reference-123"
}

Request Body Schema​

FieldTypeDescription
accountIduuidRequired. The account ID to trade from.
productstringRequired. Product to trade (e.g., BTC-USD).
typestringRequired. Must be set to "market".
sidestringRequired. Side of the trade ("buy" or "sell").
quantitydecimalRequired. Quantity to trade in the currency (must be positive).
quantityCurrencystringRequired. Currency of the quantity. For buy orders: quote currency (e.g., USD). For sell orders: base currency (e.g., BTC).
previewIduuidOptional. Preview ID from the preview response to attempt locking rates. See "Using Preview ID" section below.
referencestringRequired. Client reference for the trade (must be unique per account).

Using Preview ID​

The previewId attempts to lock in the exchange rate and fees from the preview, but does not guarantee the exact same rates due to market fluctuations.

Important:

  • You must send all required fields in the request body (not just the previewId)
  • The previewId is an additional optional field to attempt rate locking
  • Final rates may still vary due to market conditions

Response Sample​

{
"transactionId": "00000000-0000-0000-0000-000000000000"
}

Support and Resources​

If you need assistance or have any questions, our support team is here to help. You can contact our support team at support@blockwyre.com.

Stay Updated​

Stay up-to-date with the latest news, updates, and features from BlockWyre by following us on social media:

We are excited to have you on board and look forward to seeing how you leverage BlockWyre's powerful tools to enhance your financial operations. Happy integrating!