Cancel an order
curl --request POST \
--url https://calibri.io/api/v2/pythia/orders/{id}/cancel \
--header 'X-Auth-Apikey: <api-key>'import requests
url = "https://calibri.io/api/v2/pythia/orders/{id}/cancel"
headers = {"X-Auth-Apikey": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Auth-Apikey': '<api-key>'}};
fetch('https://calibri.io/api/v2/pythia/orders/{id}/cancel', 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://calibri.io/api/v2/pythia/orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Auth-Apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://calibri.io/api/v2/pythia/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Auth-Apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://calibri.io/api/v2/pythia/orders/{id}/cancel")
.header("X-Auth-Apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://calibri.io/api/v2/pythia/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1420,
"state": "cancel"
}{
"errors": [
"order.not_found"
]
}{
"errors": [
"order.not_found"
]
}{
"errors": [
"order.not_found"
]
}Trade
Cancel an order
Cancels one of your open (wait) orders and refunds unmatched
collateral. Same route for custodial and non-custodial resting
orders — non-custodial placement is via Atlas; once resting, cancel
is here. Terminal orders return 422.
POST
/
api
/
v2
/
pythia
/
orders
/
{id}
/
cancel
Cancel an order
curl --request POST \
--url https://calibri.io/api/v2/pythia/orders/{id}/cancel \
--header 'X-Auth-Apikey: <api-key>'import requests
url = "https://calibri.io/api/v2/pythia/orders/{id}/cancel"
headers = {"X-Auth-Apikey": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Auth-Apikey': '<api-key>'}};
fetch('https://calibri.io/api/v2/pythia/orders/{id}/cancel', 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://calibri.io/api/v2/pythia/orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Auth-Apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://calibri.io/api/v2/pythia/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Auth-Apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://calibri.io/api/v2/pythia/orders/{id}/cancel")
.header("X-Auth-Apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://calibri.io/api/v2/pythia/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1420,
"state": "cancel"
}{
"errors": [
"order.not_found"
]
}{
"errors": [
"order.not_found"
]
}{
"errors": [
"order.not_found"
]
}