# Current hosted venues are funded once on Polygon — see /guides/escrow-lifecycle.
# Hosted writes need: pmxt_api_key + wallet_address + private_key (signs EIP-712 locally).
# Pass an outcome straight from client.fetch_markets() — no UUID lookup needed.
import pmxt
client = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
wallet_address="0xYourWallet", # EVM address — its Polygon USDC funds the escrow
private_key="0x...", # any EVM key controlling that address
)
market = client.fetch_markets({"query": "trump 2028"})[0]
yes = next(o for o in market.outcomes if o.label.lower() == "yes")
order = client.create_order(
outcome=yes,
side="buy",
type="limit",
amount=10,
price=0.55,
)
print(order.id, order.status){
"id": "<string>",
"status": "<string>",
"side": "buy",
"type": "market",
"amount": 123,
"price": 123,
"filled": 123,
"remaining": 123,
"fee": 123,
"timestamp": "<string>",
"tx_hash": "<string>",
"chain": "<string>",
"block_number": 123
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}Create Order
Place a buy or sell order on Polymarket, Opinion, or Limitless. Returns the resulting order with id, fill status, average price, fees, and the on-chain tx hash once it settles.
Most callers pass an outcome straight from client.fetch_markets():
market = client.fetch_markets({"query": "trump 2028"})[0]
order = client.create_order(outcome=market.yes, side="buy", amount=10, order_type="limit", price=0.55)
Need to show the order to a user before they sign it (custom approval UX)? Use buildOrderHosted + submitOrderHosted instead — together they do the same thing.
# Current hosted venues are funded once on Polygon — see /guides/escrow-lifecycle.
# Hosted writes need: pmxt_api_key + wallet_address + private_key (signs EIP-712 locally).
# Pass an outcome straight from client.fetch_markets() — no UUID lookup needed.
import pmxt
client = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
wallet_address="0xYourWallet", # EVM address — its Polygon USDC funds the escrow
private_key="0x...", # any EVM key controlling that address
)
market = client.fetch_markets({"query": "trump 2028"})[0]
yes = next(o for o in market.outcomes if o.label.lower() == "yes")
order = client.create_order(
outcome=yes,
side="buy",
type="limit",
amount=10,
price=0.55,
)
print(order.id, order.status){
"id": "<string>",
"status": "<string>",
"side": "buy",
"type": "market",
"amount": 123,
"price": 123,
"filled": 123,
"remaining": 123,
"fee": 123,
"timestamp": "<string>",
"tx_hash": "<string>",
"chain": "<string>",
"block_number": 123
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}{
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
}
}Authorizations
Body
Hosted build-order request. Identify the target outcome by passing venue + venue_outcome_id from client.fetch_markets() (the SDK does this automatically when you pass outcome= to create_order or build_order).
Maximum acceptable slippage as a percent. Use aggressive defaults (30 for buys, 99.9 for sells) until the upstream economic validator tightens -- lower values frequently trip precision checks. Ignored for market orders, which pin worst-price to the domain extreme; the server defaults to 20 when omitted.
0 <= x <= 100Response
Order accepted by the hosted backend.
Hosted-mode Order shape. Mirrors pmxt.Order so the SDK can return it directly. tx_hash, chain, and block_number populate once execution settles on-chain.
Was this page helpful?

