Cancel all orders
curl --request POST \
--url https://api.4casters.io/session/cancelAllOrders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.4casters.io/session/cancelAllOrders"
payload = {}
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({})
};
fetch('https://api.4casters.io/session/cancelAllOrders', 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/cancelAllOrders",
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([
]),
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/cancelAllOrders"
payload := strings.NewReader("{}")
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/cancelAllOrders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/session/cancelAllOrders")
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 = "{}"
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>"
}
]
}訂單
取消全部訂單
取消屬於你帳戶的每一筆未成交訂單
POST
/
session
/
cancelAllOrders
Cancel all orders
curl --request POST \
--url https://api.4casters.io/session/cancelAllOrders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.4casters.io/session/cancelAllOrders"
payload = {}
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({})
};
fetch('https://api.4casters.io/session/cancelAllOrders', 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/cancelAllOrders",
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([
]),
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/cancelAllOrders"
payload := strings.NewReader("{}")
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/cancelAllOrders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/session/cancelAllOrders")
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 = "{}"
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>"
}
]
}取消呼叫方在所有賽事和聯賽上的每一筆未成交訂單。用於緊急停止 — 例如來自監控系統的熔斷開關。
若需要破壞性更小、之後還能恢復訂單的替代方案,見
POST /session/pauseOrders(會取消並記住的配套端點;與 resumeOrders 配對使用)。
請求
POST /session/cancelAllOrders
不接受參數。
curl -X POST https://api.4casters.io/session/cancelAllOrders \
-H "Authorization: Bearer YOUR_TOKEN"
回應
示例
{
"data": [
{
"success": true,
"sessionID": "65b036dfb31407c2b6bc1cfe",
"odds": -110,
"filled": 0,
"offered": 0,
"remaining": 100,
"gameID": "65f0c3c24ef07d0008abc123"
},
{
"success": true,
"sessionID": "65b036e0b31407c2b6bc1d08",
"odds": 125,
"filled": 25,
"offered": 0,
"remaining": 75,
"gameID": "65f0c4ae4ef07d0008abc456"
}
]
}
這個頁面有幫助嗎?