curl --request POST \
--url https://api.agg.market/execution/orders/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-app-id: <api-key>' \
--data '
{
"orderId": "cmf3r1a2b00c4mw0lq8y7e3uj"
}
'import requests
url = "https://api.agg.market/execution/orders/cancel"
payload = { "orderId": "cmf3r1a2b00c4mw0lq8y7e3uj" }
headers = {
"x-app-id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-app-id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({orderId: 'cmf3r1a2b00c4mw0lq8y7e3uj'})
};
fetch('https://api.agg.market/execution/orders/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://api.agg.market/execution/orders/cancel",
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([
'orderId' => 'cmf3r1a2b00c4mw0lq8y7e3uj'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-app-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agg.market/execution/orders/cancel"
payload := strings.NewReader("{\n \"orderId\": \"cmf3r1a2b00c4mw0lq8y7e3uj\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-app-id", "<api-key>")
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.agg.market/execution/orders/cancel")
.header("x-app-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"cmf3r1a2b00c4mw0lq8y7e3uj\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/execution/orders/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-app-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"cmf3r1a2b00c4mw0lq8y7e3uj\"\n}"
response = http.request(request)
puts response.read_body{
"quoteId": null,
"orderIds": [
"cmf3r1a2b00c4mw0lq8y7e3uj"
],
"status": "cancelled"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Cancel an order
Send orderId to cancel an agg order (same behaviour as the deprecated /execution/orders/{orderId}/cancel). Send venue, venueOrderId, signerAddress and cancelSignature to cancel a Polymarket or Hyperliquid limit order that one of your linked self-custody wallets placed outside AGG. signerAddress must be a wallet linked to this user and must be the wallet that produced cancelSignature. For an external order AGG reads the order from the venue, cancels it, and only after the venue confirms records it as a cancelled order; the returned orderIds[0] appears in GET /execution/orders?orderId=<id>. Fills that happened before the cancel are not recorded by AGG. An order that is already filled, cancelled or not owned by the wallet returns 409.
curl --request POST \
--url https://api.agg.market/execution/orders/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-app-id: <api-key>' \
--data '
{
"orderId": "cmf3r1a2b00c4mw0lq8y7e3uj"
}
'import requests
url = "https://api.agg.market/execution/orders/cancel"
payload = { "orderId": "cmf3r1a2b00c4mw0lq8y7e3uj" }
headers = {
"x-app-id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-app-id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({orderId: 'cmf3r1a2b00c4mw0lq8y7e3uj'})
};
fetch('https://api.agg.market/execution/orders/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://api.agg.market/execution/orders/cancel",
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([
'orderId' => 'cmf3r1a2b00c4mw0lq8y7e3uj'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-app-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agg.market/execution/orders/cancel"
payload := strings.NewReader("{\n \"orderId\": \"cmf3r1a2b00c4mw0lq8y7e3uj\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-app-id", "<api-key>")
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.agg.market/execution/orders/cancel")
.header("x-app-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"cmf3r1a2b00c4mw0lq8y7e3uj\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/execution/orders/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-app-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"cmf3r1a2b00c4mw0lq8y7e3uj\"\n}"
response = http.request(request)
puts response.read_body{
"quoteId": null,
"orderIds": [
"cmf3r1a2b00c4mw0lq8y7e3uj"
],
"status": "cancelled"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Your application ID. Required for all app-tier and user-tier routes.
JWT access token returned by POST /auth/verify. Required for user-tier routes.
Body
- Option 1
- Option 2
1Self-custody Polymarket limit orders only; omit it for managed orders. An EIP-712 signature by the order's signing wallet (the signingAddress the order was placed with) over Polymarket's CLOB L1 auth message: domain { name: "ClobAuthDomain", version: "1", chainId: 137 }, primary type ClobAuth with fields address (address), timestamp (string), nonce (uint256), message (string), where address is the signing wallet, timestamp is the timestamp below encoded as a decimal string, nonce is 0, and message is "This message attests that I control the given wallet". Ask the user to sign when they cancel. The signature is never persisted or logged. The CLOB credentials derived from it are used only for this request and are not stored.
- Option 1
- Option 2
Show child attributes
Show child attributes
Response
200
Quote whose orders were cancelled. null for limit orders and for orders placed directly on the venue.
Ids of the affected orders. Can be empty for a venue order AGG did not know.
cancelled: done. cancel_pending: the venue has not confirmed yet; the order moves to cancelled (or fills) later.
cancelled, cancel_pending