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>"
}Editar una orden
Cambia el precio o el volumen de una orden en espera
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>"
}orderOdds) y/o el volumen (orderVolume) de una orden limit existente.
En órdenes parcialmente cruzadas, 4casters cancela la orden existente y envía una nueva con los valores indicados. El nuevo orderVolume no descuenta el volumen ya cruzado: si originalmente colocaste bet: 10, se cruzaron 5yeditasa‘orderVolume:10‘,laordenanteriorsecancela(reembolsando5) y se crea una nueva por 10(debitando10), dejándote $5 netos menos.
POST /session/v4/editOrder. Acepta el mismo cuerpo de solicitud y además devuelve errorType en fallos de validación. Prefiérela en integraciones nuevas cuando hayas confirmado que la forma te funciona.Solicitud
POST /session/editOrder
data.unmatched.orderID de /session/v3/place o de id de /user/getUnmatched.null para dejar las cuotas sin cambios.bet. Pasa null para dejar el volumen sin cambios.limit. Consulta tipos de orden.userReference existente de la orden.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
}
Respuesta
El resultado refleja la forma de respuesta de colocar orden: un resumencancelled más el resultado nuevo matched / unmatched:
MatchedFill en colocar orden.Errores
| Estado | Significado |
|---|---|
400 | Error de validación (v4/editOrder devuelve errorType en estos casos). |
503 | El servicio de órdenes no está disponible. |
Autorizaciones
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.
Cuerpo
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.
Respuesta
Edit result. Mirrors the place-order response shape: a cancelled summary plus the new matched / unmatched outcome.
Show child attributes
Show child attributes
¿Esta página le ayudó?