Cancel an order
POST
/orders/cancel
curl --request POST \ --url http://localhost:3001/orders/cancel \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{"order_id":"string","reason":null}'import requests
url = "http://localhost:3001/orders/cancel"
payload = { "order_id": "string", "reason": None}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.status_code)use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "http://localhost:3001/orders/cancel";
let payload = json!({ "order_id": "string", "reason": json!(null) });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let status = response.unwrap().status();
dbg!(status);}Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
order_id
required
string
reason
string
Example generated
{ "order_id": "example", "reason": "example"}Responses
Section titled “Responses”Cancel accepted
Invalid UUID
Order not found
Order state version mismatch