Skip to main content
DELETE
/
v1
/
orders
/
{order_id}
Cancel Order
curl --request DELETE \
  --url https://api.example.com/v1/orders/{order_id}
{
  "success": true,
  "data": {
    "id": "<string>",
    "status": "<string>",
    "cancelled_at": "<string>",
    "filled_amount": 123
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.matchr.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Cancel Order

Cancel an open order. Only orders with status open or pending can be cancelled.

Endpoint

DELETE https://api.matchr.xyz/v1/orders/{order_id}

Path Parameters

order_id
string
required
The order ID to cancel

Example Request

curl -X DELETE "https://api.matchr.xyz/v1/orders/ord_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

success
boolean
Whether the cancellation succeeded
data
object
Cancelled order details

Example Response

{
  "success": true,
  "data": {
    "id": "ord_abc123",
    "market_id": "mkt_yes123",
    "status": "cancelled",
    "amount": 100,
    "filled_amount": 0,
    "cancelled_at": "2025-10-15T14:45:00Z"
  }
}

Cancel All Orders

Cancel all open orders for a specific market or all markets.

Endpoint

DELETE https://api.matchr.xyz/v1/orders

Query Parameters

market_id
string
Cancel orders only for this market (optional)
side
string
Cancel only buy or sell orders (optional)

Example Request

# Cancel all orders
curl -X DELETE "https://api.matchr.xyz/v1/orders" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Cancel orders for a specific market

curl -X DELETE "https://api.matchr.xyz/v1/orders?market_id=mkt_yes123" \
 -H "Authorization: Bearer YOUR_API_KEY"

# Cancel only buy orders

curl -X DELETE "https://api.matchr.xyz/v1/orders?side=buy" \
 -H "Authorization: Bearer YOUR_API_KEY"


Response

{
  "success": true,
  "data": {
    "cancelled_count": 5,
    "cancelled_orders": [
      { "id": "ord_abc123", "market_id": "mkt_yes123" },
      { "id": "ord_abc124", "market_id": "mkt_yes123" },
      { "id": "ord_abc125", "market_id": "mkt_no456" },
      { "id": "ord_abc126", "market_id": "mkt_no456" },
      { "id": "ord_abc127", "market_id": "mkt_yes789" }
    ]
  }
}

Get Order Status

Check the status of a specific order.

Endpoint

GET https://api.matchr.xyz/v1/orders/{order_id}

Example Request

curl -X GET "https://api.matchr.xyz/v1/orders/ord_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "id": "ord_abc123",
    "market_id": "mkt_yes123",
    "platform": "polymarket",
    "side": "buy",
    "type": "limit",
    "status": "open",
    "amount": 100,
    "price": 0.52,
    "filled_amount": 0,
    "average_fill_price": null,
    "fees": 0,
    "created_at": "2025-10-15T14:35:00Z",
    "updated_at": "2025-10-15T14:35:00Z"
  }
}

List Open Orders

Get all open orders for the authenticated user.

Endpoint

GET https://api.matchr.xyz/v1/orders

Query Parameters

status
string
default:"open"
Filter by status: open, pending, filled, cancelled, all
market_id
string
Filter by market
side
string
Filter by side: buy, sell
limit
number
default:"50"
Number of results (max: 100)
offset
number
default:"0"
Pagination offset

Example Request

curl -X GET "https://api.matchr.xyz/v1/orders?status=open&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": [
    {
      "id": "ord_abc123",
      "market_id": "mkt_yes123",
      "platform": "polymarket",
      "side": "buy",
      "type": "limit",
      "status": "open",
      "amount": 100,
      "price": 0.52,
      "filled_amount": 0,
      "created_at": "2025-10-15T14:35:00Z"
    },
    {
      "id": "ord_abc124",
      "market_id": "mkt_no456",
      "platform": "kalshi",
      "side": "sell",
      "type": "limit",
      "status": "open",
      "amount": 50,
      "price": 0.45,
      "filled_amount": 25,
      "created_at": "2025-10-15T13:20:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 2
  }
}

Error Codes

CodeDescription
400Invalid parameters
401Missing or invalid API key
404Order not found
409Order already filled or cancelled
429Rate limit exceeded
500Server error

Example Error Response

{
  "success": false,
  "error": {
    "code": "ORDER_NOT_CANCELLABLE",
    "message": "Order has already been filled",
    "details": {
      "order_id": "ord_abc123",
      "status": "filled"
    }
  }
}