API Reference
Trade

Execute trade

PUT/api/v1/trade/customer/{customerId}/execute/{quoteOrder}
Base URL: https://bloquo.mimicr.dev · provider: https://api.bloquo.io

Executes a trade using a previously obtained quote.

The quoteOrder path parameter is the orderId (Guid) returned by POST /quote. The quote must not be expired, check expireAt before calling this endpoint.

On success, a TradeOrder is created in PROCESSING status. Once the liquidity provider confirms, status transitions to WaitingTreasury, then COMPLETED as balance transfers are recorded in the Transaction Service.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Path parameters

customerIdinteger<int64>required
quoteOrderstring<uuid>required

The orderId (Guid) from POST /quote.

Body

application/json
objectrequired

Responses

200Trade submitted for execution.
statusboolean
Example: true
resultobject

Trade execution result. Contains the created tradeOrder (raw entity) and tradeResult (provider confirmation data).

Show child attributes
tradeOrderobject
Show child attributes
orderIdstring<uuid>
Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
customerIdinteger<int64>
Example: 42
baseAccountIdinteger<int64>
Example: 10
quoteAccountIdinteger<int64>
Example: 11
baseCurrencystring
Example: "BRL"
quoteCurrencystring
Example: "USD"
sidestring

Direction of the trade from the customer's perspective. - Buy, buying the base currency (spending the quote currency). - Sell, selling the base currency (receiving the quote currency).

BuySell
baseAmountnumber | null
Example: 10000
quoteAmountnumber | null
Example: 1952.32
pricenumber
Example: 5.1232
quotedBaseAmountnumber | null
Example: 10000
quotedQuoteAmountnumber | null
Example: 1952.32
quotedPricenumber
Example: 5.1232
statusIdinteger
Example: 3
tradeStatusobject | null

Trade status object (id + name).

customerStatusstring

Human-readable status for the customer.

Example: "COMPLETED"
spreadnumber
Example: 0.005
originstring | null
expirationAtstring<date-time> | null
createdBystring | null
Example: "admin"
lastUpdatedBystring
Example: "System"
createdAtstring<date-time>
Example: "2024-01-15T10:30:00Z"
lastUpdatedAtstring<date-time>
Example: "2024-01-15T10:31:00Z"
tradeResultobject
Show child attributes
quoteIdstring<uuid>
providerTxIdstring | null
avgExecutedPricenumber | null
errMessagestring | null
nextStatusstring | null
errorCodestring | null
messagestring | null
422Business validation failed. Common reasons: - Quote has expired - Quote already used - Insufficient balance in the source account
statusboolean
resultany | null
messagestring