Regarding the future of VPX — Read our announcement →
vancouverpx
← Back to Markets

API Documentation

One API for markets, your account and trading, for scripts, AI agents and VPX Bots

POST

Place an order

/api/v1/orders · needs an API key

Buy or sell YES or NO shares.

A LIMIT order buys or sells at price or better, matches at once against the book, and leaves what doesn't fill resting until you cancel it. A MARKET order takes what the book offers now and cancels the rest. The answer is the order after matching, with its fills.

Buying locks price × quantity cents of available cash (a MARKET buy needs 99¢ × quantity available while it fills, and gets back what it doesn't spend); selling needs that many unlocked shares. To go short, buy NO. Buying NO at p is the same as selling YES at 100 − p, and it matches the same book; while you hold YES, it sells that YES (a market is one contract, and you never hold both sides).

If a request times out, check GET /orders before you send it again, or you may place the order twice.

Parameters

NameInTypeDescription
marketId *bodystringThe market's id (or its slug)
side *body"BUY" | "SELL"
outcome *body"YES" | "NO"
quantity *bodyintegerShares
typebodyOrderTypeLIMIT (default) or MARKET Default "LIMIT".
pricebodyintegerLIMIT only: cents, 1–99, in outcome's terms

Request

curl -X POST "https://www.vancouverpx.ca/api/v1/orders" \
  -H "Authorization: Bearer $VPX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"marketId":"3f1c0f2e-6a55-4a8e-9b53-2a1f0c9d7e11","side":"BUY","outcome":"YES","quantity":10,"price":53}'

Response

201 with this object:

FieldTypeDescription
idstring
marketIdstring
walletIdstring
sideSide
outcomeOutcome
typeOrderType
priceintegerLimit price, in this outcome's cents (market orders: 99 to buy, 1 to sell)
quantityinteger
filledQuantityinteger
remainingQuantityintegerShares still on the book (0 once filled or cancelled)
statusOrderStatus
createdAtstring (date-time)When it was placed
updatedAtstring (date-time)When it last changed
canceledAtstring (date-time) | null
botIdstring | nullThe VPX bot that placed it, if any
clientOrderIdstring | nullThe bot's own id for the order (VPX bots only)
fillsFill[]Its fills, oldest first
Example
{
  "id": "9b2e5c1d-0f47-4d1e-8a55-6c2b7e3f9a10",
  "marketId": "3f1c0f2e-6a55-4a8e-9b53-2a1f0c9d7e11",
  "walletId": "clx8w2k3p0001qz8r5t1y7u4v",
  "side": "BUY",
  "outcome": "YES",
  "type": "LIMIT",
  "price": 53,
  "quantity": 10,
  "filledQuantity": 4,
  "remainingQuantity": 6,
  "status": "PARTIALLY_FILLED",
  "createdAt": "2026-10-27T17:05:00.000Z",
  "updatedAt": "2026-10-27T17:05:00.000Z",
  "canceledAt": null,
  "botId": null,
  "clientOrderId": null,
  "fills": [
    {
      "id": "trade:5d1e9c2a-7b3f-4e8d-a6c1-2f9b8e7d6c5a:buy",
      "kind": "trade",
      "orderId": "9b2e5c1d-0f47-4d1e-8a55-6c2b7e3f9a10",
      "marketId": "3f1c0f2e-6a55-4a8e-9b53-2a1f0c9d7e11",
      "walletId": "clx8w2k3p0001qz8r5t1y7u4v",
      "side": "BUY",
      "outcome": "YES",
      "price": 53,
      "quantity": 4,
      "executedAt": "2026-10-27T17:05:00.000Z",
      "botId": null
    }
  ]
}

Errors

MARKET_NOT_FOUND, MARKET_CLOSED, INSUFFICIENT_FUNDS, INSUFFICIENT_SHARES, BAD_PRICE, POSITION_LIMIT, and the errors every endpoint can answer.

Place an order | VPX API Docs