Skip to main content
POST
/
v1beta1
/
insert_order
Insert Order
curl --request POST \
  --url https://traderapi.us-east-1.privatelink.preprod.polymarketexchange.com/api/v1beta1/insert_order \
  --header 'Content-Type: application/json' \
  --data '
{
  "account": "trading-account-456",
  "all_or_none": true,
  "best_limit": true,
  "cash_order_qty": "<string>",
  "client_account_id": "<string>",
  "client_participant_id": "<string>",
  "clord_id": "<string>",
  "commission_override_basis_points": "<string>",
  "commission_override_flat_fee": "<string>",
  "good_till_time": "2023-11-07T05:31:56Z",
  "ignore_price_validity_checks": true,
  "immediately_executable_limit": true,
  "manual_order_indicator": "MANUAL_ORDER_INDICATOR_UNDEFINED",
  "min_qty": "<string>",
  "order_capacity": "ORDER_CAPACITY_UNDEFINED",
  "order_qty": "<string>",
  "participate_dont_initiate": true,
  "price": "5500",
  "quote": "<string>",
  "self_match_prevention_id": "<string>",
  "self_match_prevention_instruction": "SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED",
  "session_id": "<string>",
  "side": "SIDE_UNDEFINED",
  "stop_price": "<string>",
  "strict_limit": true,
  "symbol": "aec-nfl-buf-nyj-2025-01-15",
  "symbol_sub_type": "<string>",
  "time_in_force": "TIME_IN_FORCE_UNDEFINED",
  "trigger_method": "CONDITION_TRIGGER_METHOD_UNDEFINED",
  "type": "ORDER_TYPE_UNDEFINED",
  "user": "<string>"
}
'
{
  "order_id": "1ABC2DEF3GHI4"
}

Body

application/json

Request to insert an order with the given details.

account
string

The trading account for this order.

Example:

"trading-account-456"

all_or_none
boolean

A flag that if set indicates that either all of the order quantity should be filled, or none of it (partial fills will not be allowed).

best_limit
boolean

A flag that if set indicates that the price of a limit order shall be set to the price at the top of the book on the same side as this order.

cash_order_qty
string<int64>

Fixed point decimal representation of the total cash order qty. (One of order_qty and cash_order_qty must be set. If set, must be > 0 and order_type must be MARKET_TO_LIMIT).

client_account_id
string

Client assigned free-form account ID for the order.

client_participant_id
string

Client assigned free-form participant ID for the order.

clord_id
string

Client assigned ID for the order.

commission_override_basis_points
string

If present and an eligible singular commission with allow_order_entry_override is present for the order, assigns basis points to this value.

commission_override_flat_fee
string

If present and an eligible singular commission with allow_order_entry_override is present for the order, assigns flat fee to this value.

good_till_time
string<date-time>

The time at which this order shall expire (required for time_in_force of GOOD_TILL_TIME, ignored otherwise).

ignore_price_validity_checks
boolean

A flag that if set indicates that this order is exempt from instrument level price, order, and total notional limits. Only allowed in case of market sell orders to support liquidation.

immediately_executable_limit
boolean

A flag that if set indicates that the price of a limit order shall be set to the price at the top of the book on the opposing side as this order, thus able to immediately match.

manual_order_indicator
enum<string>
default:MANUAL_ORDER_INDICATOR_UNDEFINED

ManualOrderIndicator designates the manual or automated nature of an order.

  • MANUAL_ORDER_INDICATOR_UNDEFINED: An unset value for the manual order indicator.
  • MANUAL_ORDER_INDICATOR_MANUAL: The order was initially received via manual entry.
  • MANUAL_ORDER_INDICATOR_AUTOMATED: The order was initially received electronically.
Available options:
MANUAL_ORDER_INDICATOR_UNDEFINED,
MANUAL_ORDER_INDICATOR_MANUAL,
MANUAL_ORDER_INDICATOR_AUTOMATED
min_qty
string<int64>

Minimum quantity that must be filled immediately upon order insertion. If the order cannot be matched for at least this quantity at the time of submission, the order is expired. Any quantity above min_qty that is not immediately filled will rest on the book as a working order (optional for IOC time in force).

order_capacity
enum<string>
default:ORDER_CAPACITY_UNDEFINED

OrderCapacity designates the capacity of the party placing an order.

  • ORDER_CAPACITY_UNDEFINED: An unset value for the order capacity.
  • ORDER_CAPACITY_AGENCY: Firm is acting to match a customer order with another participant in the market in an agency capacity.
  • ORDER_CAPACITY_PRINCIPAL: Firm is trading with its own inventory and capital in a principal capacity.
  • ORDER_CAPACITY_PROPRIETARY: Firm is trading with its own inventory and capital in a proprietary capacity.
  • ORDER_CAPACITY_INDIVIDUAL: An individual is trading with their own inventory and capital.
  • ORDER_CAPACITY_RISKLESS_PRINCIPAL: Firm is placing a principal order that is party to an offsetting transaction.
  • ORDER_CAPACITY_AGENT_FOR_OTHER_MEMBER: Firm is acting to match a customer order with another participant in the market on behalf of another member.
Available options:
ORDER_CAPACITY_UNDEFINED,
ORDER_CAPACITY_AGENCY,
ORDER_CAPACITY_PRINCIPAL,
ORDER_CAPACITY_PROPRIETARY,
ORDER_CAPACITY_INDIVIDUAL,
ORDER_CAPACITY_RISKLESS_PRINCIPAL,
ORDER_CAPACITY_AGENT_FOR_OTHER_MEMBER
order_qty
string<int64>

The quantity to be ordered (One of order_qty and cash_order_qty must be set. If set, must be > 0).

participate_dont_initiate
boolean

A flag that if set indicates that immediate match is not desired.

price
string<int64>

Integer representation of limit price (required for limit and stop limit orders).

Example:

"5500"

quote
string

If set, the quote to accept.

self_match_prevention_id
string

Client assigned Self Match Prevention ID (required to use the optional Self Match Prevention functionality).

self_match_prevention_instruction
enum<string>
default:SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED

SelfMatchPreventionInstruction is the methodology used to handle self match prevention upon insertion onto the book.

  • SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED: An unset value for the self match prevention instruction uses the default behavior of the exchange, which is to reject the incoming order and allow resting orders to remain on the book.
  • SELF_MATCH_PREVENTION_INSTRUCTION_REJECT_AGGRESSOR: Reject the incoming aggressor order and allow resting orders to remain on the book.
  • SELF_MATCH_PREVENTION_INSTRUCTION_CANCEL_RESTING: Cancel any resting orders on the book that would self match and allow the aggressor to insert on the book.
  • SELF_MATCH_PREVENTION_INSTRUCTION_REMOVE_BOTH: Cancel any resting orders on the book that would self match and reject the aggressor insertion on the book.
Available options:
SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED,
SELF_MATCH_PREVENTION_INSTRUCTION_REJECT_AGGRESSOR,
SELF_MATCH_PREVENTION_INSTRUCTION_CANCEL_RESTING,
SELF_MATCH_PREVENTION_INSTRUCTION_REMOVE_BOTH
session_id
string

Client assigned Session ID (required to use the optional Cancel on Disconnect functionality).

side
enum<string>
default:SIDE_UNDEFINED

Side indicates the side of an Order.

Available options:
SIDE_UNDEFINED,
SIDE_BUY,
SIDE_SELL
stop_price
string<int64>

Integer representation of stop price (required for stop and stop limit orders).

strict_limit
boolean

A flag that if set indicates this particular order must be filled at the exact limit price specified without price improvement.

symbol
string

The symbol of the instrument to be ordered (required for all orders).

Example:

"aec-nfl-buf-nyj-2025-01-15"

symbol_sub_type
string

The sub type of the instrument symbol.

time_in_force
enum<string>
default:TIME_IN_FORCE_UNDEFINED

TimeInForce specifies how long the order remains in effect.

  • TIME_IN_FORCE_UNDEFINED: An unset value for TimeInForce. In the context of inserting orders, this will be interpreted as TIME_IN_FORCE_DAY
  • TIME_IN_FORCE_DAY: Order will automatically cancel if it has not been filled by the close of the trading day
  • TIME_IN_FORCE_GOOD_TILL_CANCEL: Order will remain active until filled or cancelled
  • TIME_IN_FORCE_IMMEDIATE_OR_CANCEL: Order will attempt to fill immediately, then cancel any unfilled portions of the order
  • TIME_IN_FORCE_GOOD_TILL_TIME: Order will remain active until filled or until the time specified
  • TIME_IN_FORCE_FILL_OR_KILL: Order will attempt to fill immediately for the entire order quantity, then cancel if the order was unable to be filled.
Available options:
TIME_IN_FORCE_UNDEFINED,
TIME_IN_FORCE_DAY,
TIME_IN_FORCE_GOOD_TILL_CANCEL,
TIME_IN_FORCE_IMMEDIATE_OR_CANCEL,
TIME_IN_FORCE_GOOD_TILL_TIME,
TIME_IN_FORCE_FILL_OR_KILL
trigger_method
enum<string>
default:CONDITION_TRIGGER_METHOD_UNDEFINED

ConditionTriggerMethod is the methodology used to trigger an order for insertion onto the book.

  • CONDITION_TRIGGER_METHOD_UNDEFINED: An unset value for the trigger method must be used when the order type is not meant to trigger (a limit order for instance) or uses the default last price method for orders that do trigger (a stop order for instance).
  • CONDITION_TRIGGER_METHOD_LAST_PRICE: Trigger the order using the last trade price on the book.
  • CONDITION_TRIGGER_METHOD_SETTLEMENT_PRICE: Trigger the order using the settlement price on the book.
Available options:
CONDITION_TRIGGER_METHOD_UNDEFINED,
CONDITION_TRIGGER_METHOD_LAST_PRICE,
CONDITION_TRIGGER_METHOD_SETTLEMENT_PRICE
type
enum<string>
default:ORDER_TYPE_UNDEFINED

OrderType indicates the type of an order.

  • ORDER_TYPE_MARKET_TO_LIMIT: An order that executes at the current best price. If only partially filled, the remainder is cancelled and reinserted as a LIMIT order with the price equal to the price at which the filled portion of the order executed
  • ORDER_TYPE_LIMIT: An order that will fill only at the specified price or better
  • ORDER_TYPE_STOP: An order that will become active as a MARKET_TO_LIMIT order once a trade has occured at the specified stop price
  • ORDER_TYPE_STOP_LIMIT: An order that will become active as a LIMIT order once a trade has occured at the specified stop price
Available options:
ORDER_TYPE_UNDEFINED,
ORDER_TYPE_MARKET_TO_LIMIT,
ORDER_TYPE_LIMIT,
ORDER_TYPE_STOP,
ORDER_TYPE_STOP_LIMIT
user
string

The participant for which an agent is submitting the order (an agent must set this field, ignored otherwise).

Response

A successful response.

order_id
string

The exchange assigned ID for the order.

Example:

"1ABC2DEF3GHI4"