5.3 KiB
5.3 KiB
Documentation Index
Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt Use this file to discover all available pages before exploring further.
Cancel Orders(s)
Multiple endpoints to cancel a single order, multiple orders, all orders or all orders from a single market.
Cancel an single Order
This endpoint requires a L2 Header.
Cancel an order.
HTTP REQUEST
DELETE /<clob-endpoint>/order
Request Payload Parameters
| Name | Required | Type | Description |
|---|---|---|---|
| orderID | yes | string | ID of order to cancel |
Response Format
| Name | Type | Description |
|---|---|---|
| canceled | string[] | list of canceled orders |
| not_canceled | {} | a order id -> reason map that explains why that order couldn't be canceled |
async function main() {
// Send it to the server
const resp = await clobClient.cancelOrder({
orderID:
"0x38a73eed1e6d177545e9ab027abddfb7e08dbe975fa777123b1752d203d6ac88",
});
console.log(resp);
console.log(`Done!`);
}
main();
Cancel Multiple Orders
This endpoint requires a L2 Header.
HTTP REQUEST
DELETE /<clob-endpoint>/orders
Request Payload Parameters
| Name | Required | Type | Description |
|---|---|---|---|
| null | yes | string[] | IDs of the orders to cancel |
Response Format
| Name | Type | Description |
|---|---|---|
| canceled | string[] | list of canceled orders |
| not_canceled | {} | a order id -> reason map that explains why that order couldn't be canceled |
async function main() {
// Send it to the server
const resp = await clobClient.cancelOrders([
"0x38a73eed1e6d177545e9ab027abddfb7e08dbe975fa777123b1752d203d6ac88",
"0xaaaa...",
]);
console.log(resp);
console.log(`Done!`);
}
main();
Cancel ALL Orders
This endpoint requires a L2 Header.
Cancel all open orders posted by a user.
HTTP REQUEST
DELETE /<clob-endpoint>/cancel-all
Response Format
| Name | Type | Description |
|---|---|---|
| canceled | string[] | list of canceled orders |
| not_canceled | {} | a order id -> reason map that explains why that order couldn't be canceled |
async function main() {
const resp = await clobClient.cancelAll();
console.log(resp);
console.log(`Done!`);
}
main();
Cancel orders from market
This endpoint requires a L2 Header.
Cancel orders from market.
HTTP REQUEST
DELETE /<clob-endpoint>/cancel-market-orders
Request Payload Parameters
| Name | Required | Type | Description |
|---|---|---|---|
| market | no | string | condition id of the market |
| asset_id | no | string | id of the asset/token |
Response Format
| Name | Type | Description |
|---|---|---|
| canceled | string[] | list of canceled orders |
| not_canceled | {} | a order id -> reason map that explains why that order couldn't be canceled |
```javascript Typescript theme={null}
async function main() {
// Send it to the server
const resp = await clobClient.cancelMarketOrders({
market:
"0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af",
asset_id:
"52114319501245915516055106046884209969926127482827954674443846427813813222426",
});
console.log(resp);
console.log(`Done!`);
}
main();