Execute Trade Order
This endpoint allows to execute a trade order.
Technical Details
- Webhooks: This operation triggers the
trade_transaction_createdwebhook, thentrade_transaction_status_updatedas the trade settles (success) or fails (failed).
Authorization:
Every request is signed with your API key: a short-lived JWT, signed with your private key, sent in one header on /v3/* and /api/v2/* alike.
Headers:
Authorization: APIKey {SIGNED_JWT}
How to build and sign the JWT: Authentication.
Endpoint
/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
| Field | Type | Description |
|---|---|---|
accountId | uuid | Required. The account ID to trade from. |
product | string | Required. Product to trade (e.g., BTC-USD). |
type | string | Required. Must be set to "market". |
side | string | Required. Side of the trade ("buy" or "sell"). |
quantity | string (decimal) | Required. Quantity to trade in the currency (must be positive). |
quantityCurrency | string | Required. Currency of the quantity. For buy orders: quote currency (e.g., USD). For sell orders: base currency (e.g., BTC). |
previewId | uuid | Optional. Preview ID from the preview response to attempt locking rates. See "Using Preview ID" section below. |
reference | string | Optional. Up to 255 characters. It is not kept today: every trade is given a reference of its own, which List Transactions shows. |
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
previewIdis 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"
}
Errors
| Status | Message | Meaning |
|---|---|---|
400 | account_id_required | The request names no account: a workspace-scoped key must send accountId. |
403 | account_frozen | The account is frozen or blocked. |
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:
- Instagram: BlockWyre Instagram
- Twitter: BlockWyre Twitter
- Facebook: BlockWyre Facebook
- LinkedIn: BlockWyre LinkedIn
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!