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
Example Request
curl -X DELETE "https://api.matchr.xyz/v1/orders/ord_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
Whether the cancellation succeeded
Cancelled order details
Updated status (will be cancelled)
ISO 8601 timestamp of cancellation
Amount that was filled before cancellation
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
Cancel orders only for this market (optional)
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
Filter by status: open, pending, filled, cancelled, all
Filter by side: buy, sell
Number of results (max: 100)
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
| Code | Description |
|---|
400 | Invalid parameters |
401 | Missing or invalid API key |
404 | Order not found |
409 | Order already filled or cancelled |
429 | Rate limit exceeded |
500 | Server error |
Example Error Response
{
"success": false,
"error": {
"code": "ORDER_NOT_CANCELLABLE",
"message": "Order has already been filled",
"details": {
"order_id": "ord_abc123",
"status": "filled"
}
}
}