curl --request DELETE \
--url https://gateway-sandbox.matambaintelligence.com/v1/orders/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://gateway-sandbox.matambaintelligence.com/v1/orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://gateway-sandbox.matambaintelligence.com/v1/orders/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://gateway-sandbox.matambaintelligence.com/v1/orders/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"object": "order",
"id": "ord_62jxryztxctob7uopekg",
"state": "pending",
"account": "1000000001",
"symbol": "DANGCEM",
"side": "buy",
"quantity": 10,
"type": "market",
"time_in_force": "day",
"price_kobo": null,
"filled_quantity": 0,
"exchange_order_id": "1790316754123",
"reason": null,
"reject_reason": null,
"created_at": "2026-09-25T06:12:34Z",
"updated_at": "2026-09-25T06:12:34Z",
"filled_at": null,
"average_fill_price_kobo_decimal": null,
"client_reference": null
}Cancel an order
Requests a cancel of a pending or partially_filled limit order. Only limit orders can be cancelled. A 202 means the broker accepted the request, not that the order is cancelled: the order then moves to cancelled, or to filled if it fills before the cancel takes effect. Wait for the event, or retrieve the order. Requires the trade scope.
curl --request DELETE \
--url https://gateway-sandbox.matambaintelligence.com/v1/orders/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://gateway-sandbox.matambaintelligence.com/v1/orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://gateway-sandbox.matambaintelligence.com/v1/orders/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://gateway-sandbox.matambaintelligence.com/v1/orders/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"object": "order",
"id": "ord_62jxryztxctob7uopekg",
"state": "pending",
"account": "1000000001",
"symbol": "DANGCEM",
"side": "buy",
"quantity": 10,
"type": "market",
"time_in_force": "day",
"price_kobo": null,
"filled_quantity": 0,
"exchange_order_id": "1790316754123",
"reason": null,
"reject_reason": null,
"created_at": "2026-09-25T06:12:34Z",
"updated_at": "2026-09-25T06:12:34Z",
"filled_at": null,
"average_fill_price_kobo_decimal": null,
"client_reference": null
}Authorizations
Response
Cancel requested. The broker accepted the request, and the order isn't cancelled yet. The body is the order as it was before the cancel.
Fees are not on the order. The broker fixes them only on the contract note, so see GET /v1/accounts/{account}/contract-notes for what an order cost.
sending: stored, and the send is in progress. If it still reads sending after its request has ended, its outcome was not recorded: it resolves as an uncertain order does, and an identical order is refused with 409 similar_order_unresolved until then. pending: the exchange has the order. partially_filled, filled: some or all of the order has traded. uncertain: the exchange did not confirm receipt. The gateway does not resubmit it, and our operations team reconciles it against the exchange's records. Until it resolves, an identical order on the same account is refused with 409 similar_order_unresolved. rejected: the broker or the exchange rejected it; see reject_reason. refused: it never reached the exchange: we refused it before sending, or our operations team confirmed the exchange never received it. cancelled: the exchange confirmed the cancel. expired: its time in force ran out. New values can be added: handle an unrecognised value with a safe default.
sending, pending, partially_filled, filled, uncertain, rejected, refused, cancelled, expired Why the broker or the exchange rejected the order. Set only when state is rejected. New values can be added: handle an unrecognised value with a safe default.
insufficient_funds, market_closed, settlement_lockout, etf_limit_orders_only, limit_orders_etf_only, unknown_symbol, symbol_not_tradable, account_not_at_broker, rejected_by_exchange, null The average price the filled shares traded at, in kobo, as a decimal string, before charges. It's exact when it has 12 decimal places or fewer, and otherwise rounded to 12. Null until a share has traded, or when we don't have the exchange's prices for the fills.
^[0-9]+(\.[0-9]{1,12})?$"47512.5"