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

API Documentation

REST API reference for the Vancouver Prediction Exchange

POST

Cancel Order

Cancel a single open or partially filled order. The order must belong to the authenticated user. For buy orders, locked cash is returned to the wallet. For sell orders, locked shares are unlocked.

Endpoint

POST /api/v1/cancel-order

Request Body

ParameterTypeRequiredDescription
orderIdUUIDYesThe ID of the order to cancel

Response

Returns the canceled order object on success (status 200).

{
  "id": "clxyz...",
  "marketId": "clxyz...",
  "walletId": "clxyz...",
  "side": "BUY",
  "outcome": "YES",
  "price": 65,
  "quantity": 10,
  "filledQuantity": 3,
  "status": "PARTIALLY_FILLED_CANCELLED",
  "createdAt": "2026-03-17T12:00:00.000Z",
  "canceledAt": "2026-03-17T14:30:00.000Z"
}

Errors

StatusDescription
400Invalid request body or order is not open/partially filled
401Invalid or revoked API key
403Order does not belong to the authenticated user
404Order not found

Example

import requests

API_KEY = "your_api_key"
BASE_URL = "https://www.vancouverpx.ca/api/v1"

def cancel_order(order_id: str) -> dict:
    response = requests.post(
        f"{BASE_URL}/cancel-order",
        json={"orderId": order_id},
        headers={"Authorization": f"Bearer {API_KEY}"},
    )
    response.raise_for_status()
    return response.json()

canceled = cancel_order("your-order-uuid")
print(f"Canceled order {canceled['id']} — status: {canceled['status']}")
Cancel Order | VPX API Docs