Orders
Cancel Order
Withdraw a resting order from the venue and release its reservation
DELETE
/
orderbooks
/
external-securities
/
api
/
orders
/
{orderId}
curl -X DELETE "https://api.trusset.org/orderbooks/external-securities/api/orders/c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3" }'
const res = await fetch(
`https://api.trusset.org/orderbooks/external-securities/api/orders/${orderId}`,
{
method: 'DELETE',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ userAddress: await signer.getAddress() })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"orderId": "c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320",
"orderBookId": "clx_ob_extsec_001",
"userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"side": "BUY",
"orderType": "LIMIT",
"price": "104200000",
"quantity": "10000000",
"filledQuantity": "0",
"remainingQuantity": "10000000",
"status": "CANCELLED",
"cancelReason": "USER_CANCELLED",
"updatedAt": "2025-06-15T12:06:00.000Z"
}
}
Cancels an order that is still
OPEN or PARTIALLY_FILLED. Only the wallet that placed it can cancel: userAddress must match the order’s owner. The order must also have been submitted by your instance. An order another instance submitted reads as missing, even on a book you own.
This removes the order from the book and releases the reservation behind it. It does not invalidate the signature on chain. The trader keeps a signed authorization that any venue holding it could still settle until it expires.
To retire the signature itself, use Cancel Orders On Chain. Cancel here for ordinary order management; cancel on chain when the trader wants the authorization gone.
Path Parameters
Body Parameters
Response Fields
Returns the cancelled order, withstatus: "CANCELLED" and cancelReason: "USER_CANCELLED". Same shape as Get Order, without the trade arrays.
An order the chain has already retired is cancelled automatically the next time an incoming order could have matched it, with a
cancelReason naming the reason: cancelled on chain, nonce invalidated, or filled on chain. You do not have to clean those up yourself.curl -X DELETE "https://api.trusset.org/orderbooks/external-securities/api/orders/c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3" }'
const res = await fetch(
`https://api.trusset.org/orderbooks/external-securities/api/orders/${orderId}`,
{
method: 'DELETE',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ userAddress: await signer.getAddress() })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"orderId": "c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320",
"orderBookId": "clx_ob_extsec_001",
"userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"side": "BUY",
"orderType": "LIMIT",
"price": "104200000",
"quantity": "10000000",
"filledQuantity": "0",
"remainingQuantity": "10000000",
"status": "CANCELLED",
"cancelReason": "USER_CANCELLED",
"updatedAt": "2025-06-15T12:06:00.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | userAddress is missing or not an address |
ORDER_NOT_FOUND | 404 | No open order with that ID for this wallet submitted by your instance, or the book is not reachable from your instance |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl -X DELETE "https://api.trusset.org/orderbooks/external-securities/api/orders/c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3" }'
const res = await fetch(
`https://api.trusset.org/orderbooks/external-securities/api/orders/${orderId}`,
{
method: 'DELETE',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ userAddress: await signer.getAddress() })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"orderId": "c81f4a9e-2d70-4bb3-9f16-08a5c7d1e320",
"orderBookId": "clx_ob_extsec_001",
"userAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"side": "BUY",
"orderType": "LIMIT",
"price": "104200000",
"quantity": "10000000",
"filledQuantity": "0",
"remainingQuantity": "10000000",
"status": "CANCELLED",
"cancelReason": "USER_CANCELLED",
"updatedAt": "2025-06-15T12:06:00.000Z"
}
}
