Edit an order
curl --request POST \
--url https://api.4casters.io/session/editOrder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionID": "6549b6df6634097d2704716f",
"orderOdds": 185,
"orderVolume": 100
}
'import requests
url = "https://api.4casters.io/session/editOrder"
payload = {
"sessionID": "6549b6df6634097d2704716f",
"orderOdds": 185,
"orderVolume": 100
}
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({sessionID: '6549b6df6634097d2704716f', orderOdds: 185, orderVolume: 100})
};
fetch('https://api.4casters.io/session/editOrder', 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/editOrder",
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([
'sessionID' => '6549b6df6634097d2704716f',
'orderOdds' => 185,
'orderVolume' => 100
]),
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/editOrder"
payload := strings.NewReader("{\n \"sessionID\": \"6549b6df6634097d2704716f\",\n \"orderOdds\": 185,\n \"orderVolume\": 100\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/editOrder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sessionID\": \"6549b6df6634097d2704716f\",\n \"orderOdds\": 185,\n \"orderVolume\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/session/editOrder")
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 \"sessionID\": \"6549b6df6634097d2704716f\",\n \"orderOdds\": 185,\n \"orderVolume\": 100\n}"
response = http.request(request)
puts response.read_body{
"data": {
"cancelled": {},
"matched": [
{
"amount": 123,
"odds": 123,
"number": 123,
"type": "moneyline",
"side": "<string>",
"market": "<string>",
"orderID": "<string>",
"txID": "<string>",
"wagerRequestID": "<string>",
"userReference": "<string>",
"risk": 123,
"win": 123,
"winWithoutCommission": 123
}
],
"unmatched": {
"orderID": "<string>",
"wagerRequestID": "<string>",
"offered": 123,
"odds": 123,
"type": "moneyline",
"side": "<string>",
"market": "<string>",
"number": 123,
"userReference": "<string>"
}
}
}{
"error": "<string>"
}訂單
修改訂單
更改掛單的價格或數量
POST
/
session
/
editOrder
Edit an order
curl --request POST \
--url https://api.4casters.io/session/editOrder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionID": "6549b6df6634097d2704716f",
"orderOdds": 185,
"orderVolume": 100
}
'import requests
url = "https://api.4casters.io/session/editOrder"
payload = {
"sessionID": "6549b6df6634097d2704716f",
"orderOdds": 185,
"orderVolume": 100
}
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({sessionID: '6549b6df6634097d2704716f', orderOdds: 185, orderVolume: 100})
};
fetch('https://api.4casters.io/session/editOrder', 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/editOrder",
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([
'sessionID' => '6549b6df6634097d2704716f',
'orderOdds' => 185,
'orderVolume' => 100
]),
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/editOrder"
payload := strings.NewReader("{\n \"sessionID\": \"6549b6df6634097d2704716f\",\n \"orderOdds\": 185,\n \"orderVolume\": 100\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/editOrder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sessionID\": \"6549b6df6634097d2704716f\",\n \"orderOdds\": 185,\n \"orderVolume\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/session/editOrder")
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 \"sessionID\": \"6549b6df6634097d2704716f\",\n \"orderOdds\": 185,\n \"orderVolume\": 100\n}"
response = http.request(request)
puts response.read_body{
"data": {
"cancelled": {},
"matched": [
{
"amount": 123,
"odds": 123,
"number": 123,
"type": "moneyline",
"side": "<string>",
"market": "<string>",
"orderID": "<string>",
"txID": "<string>",
"wagerRequestID": "<string>",
"userReference": "<string>",
"risk": 123,
"win": 123,
"winWithoutCommission": 123
}
],
"unmatched": {
"orderID": "<string>",
"wagerRequestID": "<string>",
"offered": 123,
"odds": 123,
"type": "moneyline",
"side": "<string>",
"market": "<string>",
"number": 123,
"userReference": "<string>"
}
}
}{
"error": "<string>"
}更改現有 limit 訂單的價格(
orderOdds)和/或數量(orderVolume)。
對於部分成交的訂單,4casters 會取消現有訂單並按所提供的值提交一筆新訂單。新的 orderVolume 不會計入此前已成交的數量 — 如果你最初下單 bet: 10,其中 5已成交,然後改單為‘orderVolume:10‘,則原訂單被取消(退回5),並建立一筆 10的新訂單(扣款10),淨效果是你少了 $5。
更新的 gRPC 變體位於
POST /session/v4/editOrder。它接受相同的請求主體,並在校驗失敗時額外回傳 errorType。確認形態適合你後,新整合請優先使用它。請求
POST /session/editOrder
string
必填
要修改的訂單 ID。可從
/session/v3/place 的 data.unmatched.orderID 或 /user/getUnmatched 的 id 獲取。integer
新的美式賠率。傳
null 表示賠率不變。number
新的
bet 金額。傳 null 表示數量不變。string
可選。替換訂單上現有的
userReference。number
可選。你最初打算下單的數量;伺服器在對帳部分成交時使用。
string
可選。新的過期時間(分鐘,字串)。
boolean
僅 v4。若對面沒有掛單流動性,則拒絕此次改單。
curl -X POST https://api.4casters.io/session/editOrder \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sessionID": "6549b6df6634097d2704716f",
"orderOdds": 185,
"orderVolume": 100
}'
{
"sessionID": "6549b6df6634097d2704716f",
"orderOdds": 185,
"orderVolume": 100
}
回應
結果鏡像 下單 的回應形態 — 一個cancelled 彙總,加上新的 matched / unmatched 結果:
object
被取消並替換的原訂單彙總。
object
新訂單未成交剩餘部分的掛單。
錯誤
| 狀態 | 含義 |
|---|---|
400 | 校驗錯誤(v4/editOrder 會為這些錯誤回傳 errorType)。 |
503 | 訂單服務不可達。 |
授權
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.
主體
application/json
Order id to edit.
New American odds. Pass null to leave odds unchanged.
New bet amount. Pass null to leave volume unchanged. Does not account for previously-filled volume.
Order placement strategy.
limit— default. Match against any liquidity at your price or better as a taker, rest the remainder as a maker.post— guarantee maker. Reject if the order would match resting liquidity.postArb— likepost, but allowed to match if the matched odds are within 1% of yours, avoiding taker fees.fillAndKill— guarantee taker. Match whatever size is available at your price or better and cancel the remainder; never rests. A partial fill is a success; rejected only when there is no matchable liquidity at all.fillOrKill— all-or-nothing taker. Match the entirebetimmediately or the whole order is rejected and any partial fills are rolled back; never rests.
可用選項:
limit, post, postArb, fillAndKill, fillOrKill Optional. The volume you originally intended to place; used by the server when reconciling partial fills.
Optional. New expiration in minutes (string).
v4 only. Reject the edit if there is no resting opposite-side liquidity.
回應
Edit result. Mirrors the place-order response shape: a cancelled summary plus the new matched / unmatched outcome.
Show child attributes
Show child attributes
這個頁面有幫助嗎?