Cancel multiple orders
curl --request POST \
--url https://api.4casters.io/session/cancelMultiple \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionIDs": [
"65b036dfb31407c2b6bc1cfe",
"65b036e0b31407c2b6bc1d08"
]
}
'import requests
url = "https://api.4casters.io/session/cancelMultiple"
payload = { "sessionIDs": ["65b036dfb31407c2b6bc1cfe", "65b036e0b31407c2b6bc1d08"] }
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({sessionIDs: ['65b036dfb31407c2b6bc1cfe', '65b036e0b31407c2b6bc1d08']})
};
fetch('https://api.4casters.io/session/cancelMultiple', 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.4casters.io/session/cancelMultiple",
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([
'sessionIDs' => [
'65b036dfb31407c2b6bc1cfe',
'65b036e0b31407c2b6bc1d08'
]
]),
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.4casters.io/session/cancelMultiple"
payload := strings.NewReader("{\n \"sessionIDs\": [\n \"65b036dfb31407c2b6bc1cfe\",\n \"65b036e0b31407c2b6bc1d08\"\n ]\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.4casters.io/session/cancelMultiple")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sessionIDs\": [\n \"65b036dfb31407c2b6bc1cfe\",\n \"65b036e0b31407c2b6bc1d08\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/session/cancelMultiple")
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 \"sessionIDs\": [\n \"65b036dfb31407c2b6bc1cfe\",\n \"65b036e0b31407c2b6bc1d08\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"success": true,
"reason": "<string>",
"sessionID": "<string>",
"description": "<string>",
"odds": 123,
"filled": 123,
"offered": 123,
"remaining": 123,
"gameID": "<string>",
"userReference": "<string>"
}
]
}Orders
Cancel multiple orders
Cancel a batch of orders by id
POST
/
session
/
cancelMultiple
Cancel multiple orders
curl --request POST \
--url https://api.4casters.io/session/cancelMultiple \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionIDs": [
"65b036dfb31407c2b6bc1cfe",
"65b036e0b31407c2b6bc1d08"
]
}
'import requests
url = "https://api.4casters.io/session/cancelMultiple"
payload = { "sessionIDs": ["65b036dfb31407c2b6bc1cfe", "65b036e0b31407c2b6bc1d08"] }
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({sessionIDs: ['65b036dfb31407c2b6bc1cfe', '65b036e0b31407c2b6bc1d08']})
};
fetch('https://api.4casters.io/session/cancelMultiple', 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.4casters.io/session/cancelMultiple",
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([
'sessionIDs' => [
'65b036dfb31407c2b6bc1cfe',
'65b036e0b31407c2b6bc1d08'
]
]),
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.4casters.io/session/cancelMultiple"
payload := strings.NewReader("{\n \"sessionIDs\": [\n \"65b036dfb31407c2b6bc1cfe\",\n \"65b036e0b31407c2b6bc1d08\"\n ]\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.4casters.io/session/cancelMultiple")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sessionIDs\": [\n \"65b036dfb31407c2b6bc1cfe\",\n \"65b036e0b31407c2b6bc1d08\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/session/cancelMultiple")
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 \"sessionIDs\": [\n \"65b036dfb31407c2b6bc1cfe\",\n \"65b036e0b31407c2b6bc1d08\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"success": true,
"reason": "<string>",
"sessionID": "<string>",
"description": "<string>",
"odds": 123,
"filled": 123,
"offered": 123,
"remaining": 123,
"gameID": "<string>",
"userReference": "<string>"
}
]
}Cancel a batch of orders by id. The result is positional with the input
sessionIDs array and may contain a mix of successful cancels and per-order failures.
Request
POST /session/cancelMultiple
array
required
Array of order ids to cancel. Every id must be a valid
ObjectID — if any one of them is malformed the whole request fails with 400.curl -X POST https://api.4casters.io/session/cancelMultiple \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sessionIDs": [
"65b036dfb31407c2b6bc1cfe",
"65b036e0b31407c2b6bc1d08"
]
}'
Response
array
Per-order cancel results. Same shape as Cancel an order. On failure, entries include
{ success: false, reason: "..." } (no sessionID field for invalid-id / not-found / not-yours rejections).Example
{
"data": [
{
"success": true,
"sessionID": "65b036dfb31407c2b6bc1cfe",
"odds": 125,
"filled": 0,
"offered": 0,
"remaining": 100,
"gameID": "65f0c3c24ef07d0008abc123"
},
{ "success": false, "reason": "Not your order" }
]
}
Errors
| Status | Meaning |
|---|---|
400 | sessionIDs missing or not an array, or any id malformed. |
Authorizations
Pass your auth token in the Authorization header. The Bearer prefix is optional; the server also accepts a signed auth cookie or a token field in the request body.
Body
application/json
Response
Per-order cancel results
Show child attributes
Show child attributes
Was this page helpful?
⌘I