Mass cancel prediction orders
curl --request POST \
--url https://api.tradearies.dev/v1/predictions/orders/mass-cancels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"symbol": "HORC_1126_Republican"
}
'import requests
url = "https://api.tradearies.dev/v1/predictions/orders/mass-cancels"
payload = {
"accountId": "ACCOUNT-0001",
"symbol": "HORC_1126_Republican"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'ACCOUNT-0001', symbol: 'HORC_1126_Republican'})
};
fetch('https://api.tradearies.dev/v1/predictions/orders/mass-cancels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tradearies.dev/v1/predictions/orders/mass-cancels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'ACCOUNT-0001',
'symbol' => 'HORC_1126_Republican'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tradearies.dev/v1/predictions/orders/mass-cancels"
payload := strings.NewReader("{\n \"accountId\": \"ACCOUNT-0001\",\n \"symbol\": \"HORC_1126_Republican\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tradearies.dev/v1/predictions/orders/mass-cancels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"ACCOUNT-0001\",\n \"symbol\": \"HORC_1126_Republican\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/predictions/orders/mass-cancels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"ACCOUNT-0001\",\n \"symbol\": \"HORC_1126_Republican\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"accountId": "<string>",
"answeredAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"massCancelId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"rejectReason": "not_supported",
"rejectText": "<string>",
"requestType": "all",
"requestedBy": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"status": "pending",
"symbol": "<string>",
"totalAffectedOrders": "<string>"
}
}Orders
Mass Cancel Prediction Orders
Cancels every working prediction-market order on an account, or only those in one contract, in a single request to the venue.
Use Case: Pull all resting orders at once, or every order in one event contract.
POST
/
v1
/
predictions
/
orders
/
mass-cancels
Mass cancel prediction orders
curl --request POST \
--url https://api.tradearies.dev/v1/predictions/orders/mass-cancels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"symbol": "HORC_1126_Republican"
}
'import requests
url = "https://api.tradearies.dev/v1/predictions/orders/mass-cancels"
payload = {
"accountId": "ACCOUNT-0001",
"symbol": "HORC_1126_Republican"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'ACCOUNT-0001', symbol: 'HORC_1126_Republican'})
};
fetch('https://api.tradearies.dev/v1/predictions/orders/mass-cancels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tradearies.dev/v1/predictions/orders/mass-cancels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'ACCOUNT-0001',
'symbol' => 'HORC_1126_Republican'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tradearies.dev/v1/predictions/orders/mass-cancels"
payload := strings.NewReader("{\n \"accountId\": \"ACCOUNT-0001\",\n \"symbol\": \"HORC_1126_Republican\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tradearies.dev/v1/predictions/orders/mass-cancels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"ACCOUNT-0001\",\n \"symbol\": \"HORC_1126_Republican\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/predictions/orders/mass-cancels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"ACCOUNT-0001\",\n \"symbol\": \"HORC_1126_Republican\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"accountId": "<string>",
"answeredAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"massCancelId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"rejectReason": "not_supported",
"rejectText": "<string>",
"requestType": "all",
"requestedBy": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"status": "pending",
"symbol": "<string>",
"totalAffectedOrders": "<string>"
}
}This endpoint is in closed beta. It is available only to accounts enrolled in the beta, and only on staging (
https://api.tradearies.dev). Request and response shapes may change before general availability.Overview
A mass cancel is one request to the venue. The endpoint returns202 Accepted with the request, normally in status pending.
A 202 does not mean any order is canceled. The venue then does two things:
- It answers the request. The request’s
statusbecomesacceptedorrejected, withrejectReasonandrejectTextwhen refused. Read it with Get Prediction Mass Cancel. - It cancels each matching order separately. Each one arrives as an ordinary order update with
statecanceled, on the order stream and in List Prediction Orders. The order’scanceledevent carries the request’smassCancelId.
Request
{
"accountId": "ACCOUNT-0001",
"symbol": "HORC_1126_Republican",
"outcome": "YES"
}
| Field | Notes |
|---|---|
accountId | Required. The account whose working orders to cancel. You are recorded as the user who asked. |
symbol | Optional. Cancel only orders in this contract. Omit it to cancel every working order on the account. |
outcome | Optional, YES or NO. Cancel only that outcome’s orders. Requires symbol. |
Response
{
"success": true,
"data": {
"massCancelId": "0192f3a4-7a1b-7c2d-8e3f-456789abcdef",
"accountId": "ACCOUNT-0001",
"requestedBy": "user-1",
"requestType": "by_security",
"symbol": "HORC_1126_Republican",
"outcome": "YES",
"status": "pending",
"createdAt": "2026-10-18T14:00:00Z",
"sentAt": "2026-10-18T14:00:00Z"
}
}
status is one of:
status | Meaning |
|---|---|
pending | Sent. The venue has not answered yet. |
accepted | The venue took the request. totalAffectedOrders is its count, when it gives one. |
rejected | The venue refused. rejectReason is not_supported, unknown_security, other or business_reject. |
not_sent | Nothing reached the venue, and nothing was canceled. |
Example
curl -X POST "https://api.tradearies.dev/v1/predictions/orders/mass-cancels" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"accountId":"ACCOUNT-0001"}'
Errors
| Status | code | Meaning |
|---|---|---|
400 | INVALID_ORDER | accountId is missing, outcome was sent without symbol, or outcome is not YES or NO. |
400 | EMPTY_BODY, INVALID_JSON, UNKNOWN_FIELD | Missing body, malformed JSON, or a field the endpoint does not accept. |
401 | — | Missing or invalid credentials. |
429 | ORDER_ENTRY_AT_CAPACITY | Order entry is at capacity. Nothing was sent; retry shortly. |
503 | ORDER_ENTRY_UNAVAILABLE | Order entry is not accepting requests. Nothing was sent. |
504 | REQUEST_OUTCOME_UNKNOWN | The request may have reached the venue. Check your orders before sending it again. |
Authorizations
OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.
Body
application/json
Unknown fields are rejected with 400.
The account whose working orders to cancel.
Example:
"ACCOUNT-0001"
Cancel only this outcome's orders. Requires symbol.
Available options:
YES, NO Cancel only orders in this contract. Omit to cancel every working order on the account.
Example:
"HORC_1126_Republican"
Response
Mass cancel sent. The venue has not answered yet.
Was this page helpful?