Skip to main content

Execute Buy

Execute a buy order for prediction outcome tokens, paying USDC to receive outcome token shares.

info
  • Must call Get Engine Status first to verify the engine is available
  • Must call Get Event Detail to obtain tokenId and verify the market is open
  • Must call Get Order Estimate to preview the order
  • Must display the estimate to the user and obtain explicit confirmation before calling this endpoint
  • Phase 1 supports orderType=1 (FOK) only — orders that cannot be fully filled are cancelled
  • A 200 response is an acknowledgment only — use Get Order List to check the final fill status

HTTP Request

POST/v5/alpha/prediction/buy

Request Parameters

ParameterRequiredTypeComments
tokenIdtruestringOutcome token ID to buy (from Get Event Detail)
amounttruestringUSDC amount to invest (positive decimal as string)
payTokenCodetruestringPayment token code. Phase 1 fixed to USDC
orderTypetrueintegerOrder type. Refer to predictionOrderType. Phase 1: 1 (FOK) only
slippagetruestringMaximum acceptable price slippage as decimal. 0.05 = 5% tolerance
eventIdtruestringEvent ID associated with the token

Response Parameters

ParameterTypeComments
orderNostringOrder number. Use with Get Order List to check fill status

Request Example

POST /v5/alpha/prediction/buy HTTP/1.1
Host: api.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1704067200000
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"tokenId": "token_yes_123",
"amount": "100",
"payTokenCode": "USDC",
"orderType": 1,
"slippage": "0.05",
"eventId": "event_123"
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderNo": "ord_buy_20240101_001"
},
"retExtInfo": {},
"time": 1704067200000
}