Skip to main content
POST
/
v0
/
orders
/
cancel
/
build
# All 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).
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
)
cancelled = client.cancel_order("order_abc123")
print(cancelled.id, cancelled.status)
{
  "cancel_id": "<string>",
  "typed_data": {},
  "deadline": 123,
  "pull_typed_data": {}
}
Available on: Polymarket, Opinion, Limitless. Other venues raise NotSupported in hosted mode — for those, run a local PMXT service.
Before your first call: deposit USDC on Polygon at pmxt.dev/dashboard/wallet (one-time setup). For the programmatic flow, see escrow lifecycle.
Use any EVM private key. Your USDC sits in a non-custodial PreFundedEscrow on Polygon — the single funding location for every hosted venue (including Opinion, which PMXT settles cross-chain for you). PMXT cannot move funds without your EIP-712 signature.

Authorizations

Authorization
string
header
required

Required when calling the hosted API directly (curl, requests, fetch). SDK users pass credentials via constructor params instead.

Body

application/json
order_id
string
required

Unified order id, as returned by fetchOpenOrdersHosted.

user_address
string
required

EVM wallet address that owns the resting order and will sign the cancel typed data.

Response

Cancel build response.

cancel_id
string
required

Opaque server-side key for this cancel build. Pass it to POST /v0/orders/cancel with the EIP-712 signature(s) before deadline.

typed_data
object
required

EIP-712 typed-data payload to sign locally with the wallet key matching user_address. Return the signature when submitting the cancel.

deadline
integer
required

Unix epoch (s) after which the cancel build expires. Submit the signed cancel before this time or call cancelOrderHosted again.

pull_typed_data
object

Optional secondary EIP-712 payload for venues that require a pull-authorization cancel (Polymarket neg-risk markets). Sign with the same wallet and return as pull_signature. null when not required.