Cancel orders
/api/v1/orders · needs an API key
Cancel the orders you name, a market's, or all of them.
Say which in the body: {"ids": [...]} cancels those orders, {"marketId": "..."} every open order you have in that market, and {"all": true} every open order you have. A body that says none of these is refused, so a request that loses its body on the way never cancels everything. The answer lists what was cancelled.
A market's orders, or all of them, include the ones your VPX bots placed in your account, so a script that should only clean up after itself names its ids. A VPX bot only ever cancels its own.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| ids | body | string[] | These orders (at most 5,000; an empty list cancels nothing) |
| marketId | body | string | Every open order you have in this market (its id or slug) |
| all | body | true | Every open order you have |
Request
curl -X DELETE "https://www.vancouverpx.ca/api/v1/orders" \
-H "Authorization: Bearer $VPX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ids":["9b2e5c1d-0f47-4d1e-8a55-6c2b7e3f9a10"]}'Response
200 with this object:
| Field | Type | Description |
|---|---|---|
| cancelled | string[] | The ids of the orders cancelled |
{
"cancelled": [
"9b2e5c1d-0f47-4d1e-8a55-6c2b7e3f9a10"
]
}Errors
MARKET_NOT_FOUND, and the errors every endpoint can answer.