orders

Place orders on the exchange.

Description

This route only works for Smarkets API users, other users will receive a 403 status code response.<br><br> For immediate_or_cancel orders type, the route will return when the order is matched (or cancelled).<br> For all other order types, the route will return when the order is accepted by the exchange.<br> In the latter case, GET v3/orders should be used to check the status of the order, using the order id returned by this response.

Rate limits

Maximum 10 requests per second<br>

post/v3/orders/

Request body

contract_idstring required

This ID uniquely identifies the contract

labelstring

Label is a user-defined string that will be stored in the order. It can be used to identify different trading strategies

market_idstring required

This ID uniquely identifies the market

minimum_accepted_quantityinteger

If this minimum accepted quantity is not matched on bet placement time, the order will be cancelled and nothing will be matched.<br> Only applicable to immediate_or_cancel order types.

priceinteger required

This price is in percentage basis points.<br> Example: 5000 = 50% <br> To convert it to decimal odds, just divide 10000 by it<br> Example: 10000 / 5000 = 2.0 (decimal odds).<br> This price has to conform to a valid tick on the exchange; an invalid price error will be returned if it does not.

quantityinteger required
Quantity is the sum of the total pot (back+lay) in case the order is matched<br>
The units are 1/10000 * one unit of the user's currency.<br>
Example: Quantity 500 = 0.05 GBP<br>
To convert it to back stake, just multiply by the price and divide by 100000000<br>
Example: 100000 (quantity) * 5000 (price) / 100000000 = 5 GBP back stake<br>
The minimum stake is £0.05 or currency equivalent
side'buy' | 'sell' required

side can either be:<ul>

<li>buy: backing a contract <li>sell: laying a contract </ul>
type'good_til_cancelled' | 'keep_in_play' | 'good_til_halted' | 'immediate_or_cancel'

Order types can have the following values: <ul> <li>good_til_cancelled: this order will be open until a reduction factor is applied or a market state changes to live, which will cancel the order. <li>keep_in_play: the same as good_til_cancelled, except it will not be cancelled on market state changes <li>good_til_halted: the same as good_til_cancelled, except a market <li>immediate_or_cancel: if the minimum_accepted_quantity is not matched at the time of order placement, this order will be cancelled. </ul> <p>The following table explains the lifetime of orders:</p> <table cellpadding="3" style="border: 1px solid white;"> <tr> <th>order_type</th> <th>Market Goes Live</th> <th>Market Halted</th> <th>Reduction Factor Applied</th> </tr> <tr> <td>good_til_cancelled</td> <td>Cancelled</td> <td>Cancelled</td> <td>Cancelled</td> </tr> <tr> <td>good_til_halted</td> <td>Kept</td> <td>Cancelled</td> <td>Cancelled</td> </tr> <tr> <td>keep_in_play</td> <td>Kept</td> <td>Kept</td> <td>Cancelled</td> </tr> </table><br> <p>Orders marked as immediate_or_cancel must be executed immediately and thus will not remain in the book.</p>

Example request

{
  "contract_id": "123456",
  "label": "strategy_1",
  "market_id": "128939",
  "minimum_accepted_quantity": 10000,
  "price": 5000,
  "quantity": 10000,
  "side": "buy",
  "type": "good_til_halted"
}

Response

Order placement success

available_balancestring required

Current available balance on the account, it is equal to the balance deducted by the exposure

available_quantityinteger required

Quantity left to be matched in the order

contract_idstring required

This ID uniquely identifies the contract

executed_avg_priceinteger nullable required

The average price for the executions on the order

exposurestring required

Current exposure on the account

market_idstring required

This ID uniquely identifies the market

order_idstring required

This ID uniquely identifies an order

orig_priceinteger nullable required

The price at which the order was placed at, it can be different from the matched price. This value will be null if there were no executions.

priceinteger required

This price is in percentage basis points.<br> Example: 5000 = 50% <br> To convert it to decimal odds, just divide 10000 by it<br> Example: 10000 / 5000 = 2.0 (decimal odds).<br> This price has to conform to a valid tick on the exchange; an invalid price error will be returned if it does not.

quantityinteger required
Quantity is the sum of the total pot (back+lay) in case the order is matched<br>
The units are 1/10000 * one unit of the user's currency.<br>
Example: Quantity 500 = 0.05 GBP<br>
To convert it to back stake, just multiply by the price and divide by 100000000<br>
Example: 100000 (quantity) * 5000 (price) / 100000000 = 5 GBP back stake<br>
The minimum stake is £0.05 or currency equivalent
side'buy' | 'sell' required

side can either be:<ul>

<li>buy: backing a contract <li>sell: laying a contract </ul>
total_executed_quantityinteger required

Quantity matched (executed) in the order

Example response

{
  "available_balance": "100.00",
  "available_quantity": 15000,
  "contract_id": "123456",
  "executed_avg_price": 5000,
  "exposure": "-50.00",
  "market_id": "128939",
  "order_id": "1518455672861",
  "orig_price": 5000,
  "price": 5000,
  "quantity": 10000,
  "side": "buy",
  "total_executed_quantity": 15000
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.