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
此页面对您有帮助吗?