Skip to main content

POST /api/v1/partner/bets

Place a bet in a prediction market on behalf of one of the partner's users. The stake is debited from the partner's float account, and the position is opened on the Intotes sub-account mapped to external_user_id.

Amounts are integers in kopecks, where 1 RUB = 100 kopecks. See Money Format for the money and price conventions used across the API.

Authentication​

Required. Partner API key in X-Partner-Key header, not a Bearer token. See Partner Integration.

Request​

Body Parameters​

ParameterTypeRequiredDescription
external_user_idstringYesIdentifier of the user in the partner's own system. The user is mapped to an Intotes sub-account automatically.
market_idint64YesID of the market to bet in.
sidestringYesSide to buy: "yes" or "no".
amount_kopecksintYesStake in kopecks. Debited from the partner's float account.
client_bet_idstringYesThe partner's unique idempotency key for this bet.

Market IDs are returned by Get Markets By Pool, which lists the markets of a pool; the pool IDs themselves come with each event in Get All Events.

Example​

curl -X POST https://api.intotes.com/api/v1/partner/bets \
-H "X-Partner-Key: <partner_key>" \
-H "Content-Type: application/json" \
-d '{
"external_user_id": "user_42",
"market_id": 12345,
"side": "yes",
"amount_kopecks": 50000,
"client_bet_id": "bet_abc_001"
}'

Response​

200 OK​

{
"status": "accepted",
"client_bet_id": "bet_abc_001",
"external_user_id": "user_42",
"user_id": 987654,
"market_id": 12345,
"side": "yes",
"cost_kopecks": 50000,
"shares_delta": 91234,
"fee_bps": 300
}

The resulting position goes into the shared LMSR pool, the same pool that backs regular platform trades. See LMSR AMM. The position can be closed later with Sell Position.

Response Fields​

FieldTypeDescription
statusstring"accepted" when the bet was placed.
client_bet_idstringThe idempotency key sent in the request.
external_user_idstringIdentifier of the user in the partner's own system.
user_idint64ID of the Intotes sub-account mapped to external_user_id.
market_idint64Market the bet was placed in.
sidestringSide that was bought: "yes" or "no".
cost_kopecksintAmount charged to the float account, in kopecks.
shares_deltaintNumber of shares added to the position. 100 shares = 1 token.
fee_bpsintTrade fee in basis points.

How trade fees are applied on the platform is described in Fees and Commissions.

Idempotent Repeat​

Repeating a request with a client_bet_id that was already accepted returns the following body. The bet is not placed a second time and the float account is not debited again.

{
"status": "already_accepted",
"client_bet_id": "bet_abc_001"
}

See Partner Integration for the full idempotency contract.

Errors​

StatusCodeDescription
400BAD_BODYThe request body is not valid JSON.
400BAD_PARAMSA required field is missing or invalid.
400BET_LIMITThe stake is above the partner's per-bet limit.
400TRADE_FAILEDThe trade was rejected, for example because the market is closed.
402INSUFFICIENT_FLOATThe float account does not have enough funds. Top it up.
500RESOLVE_USER_FAILEDThe sub-account could not be created or found.
500RECORD_FAILEDInternal write error.

The authentication errors shared by every partner endpoint are listed in the Overview, and the full catalogue is in Error Handling.