{"record":{"id":"e0cf07ba9180198b","repo":"nautechsystems/nautilus_trader","slug":"either-venue-order-id-or-client-order-id-must-be-p","errorCode":null,"errorMessage":"Either venue_order_id or client_order_id must be provided","messagePattern":"Either venue_order_id or client_order_id must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/http/client.rs","lineNumber":1914,"sourceCode":"    /// - The HTTP request fails.\n    #[expect(clippy::too_many_arguments)]\n    pub async fn request_order_status(\n        &self,\n        account_id: AccountId,\n        instrument_id: InstrumentId,\n        client_order_id: Option<ClientOrderId>,\n        venue_order_id: Option<VenueOrderId>,\n        order_side: Option<OrderSide>,\n        order_type: OrderType,\n        time_in_force: TimeInForce,\n    ) -> anyhow::Result<OrderStatusReport> {\n        let resp = if let Some(ref voi) = venue_order_id {\n            self.inner.get_order_status_by_id(voi.as_str()).await\n        } else if let Some(ref coid) = client_order_id {\n            let cid = client_order_id_to_cid(coid);\n            self.inner.get_order_status_by_cid(cid).await\n        } else {\n            anyhow::bail!(\"Either venue_order_id or client_order_id must be provided\")\n        }\n        .map_err(|e| anyhow::anyhow!(e))?;\n\n        let detail = resp.status;\n        let size_precision = self\n            .get_instrument(&detail.symbol)\n            .map_or(0, |i| i.size_precision());\n\n        let voi = VenueOrderId::new(&detail.order_id);\n        let order_status = detail.state.into();\n        let filled = detail.filled_quantity.unwrap_or(0);\n        let remaining = detail.remaining_quantity.unwrap_or(0);\n        let quantity = Quantity::new((filled + remaining) as f64, size_precision);\n        let filled_qty = Quantity::new(filled as f64, size_precision);\n        let ts_init = self.generate_ts_init();\n\n        let resolved_coid = client_order_id.or_else(|| detail.clord_id.map(cid_to_client_order_id));\n","sourceCodeStart":1896,"sourceCodeEnd":1932,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/http/client.rs#L1896-L1932","documentation":"get_order_status requires an identifier to look up the order: either a venue_order_id or a client_order_id. When both are None, the client cannot query AX and bails with this error before making a request.","triggerScenarios":"Calling the order-status method with neither venue_order_id nor client_order_id supplied — e.g. both Option arguments left as None.","commonSituations":"Passing unwrapped/order IDs that were never assigned (order rejected before venue order id existed) and also leaving client_order_id None; generic wrapper code forwarding optional IDs without checking at least one exists.","solutions":["Provide the client_order_id (the adapter converts it to a cid for AX)","Provide the venue_order_id if you have one from a prior order-status/update event","Ensure at least one of the two Option arguments is Some before calling"],"exampleFix":"// before\nlet status = client.get_order_status(None, None).await?;\n// after\nlet status = client.get_order_status(None, Some(client_order_id)).await?;","handlingStrategy":"validation","validationCode":"if venue_order_id.is_none() && client_order_id.is_none() {\n    return Err(anyhow::anyhow!(\"need venue_order_id or client_order_id for order status\"));\n}","typeGuard":"fn has_order_id(venue: &Option<VenueOrderId>, client: &Option<ClientOrderId>) -> bool {\n    venue.is_some() || client.is_some()\n}","tryCatchPattern":"match client.get_order_status(venue_order_id, client_order_id).await {\n    Err(e) if e.to_string().contains(\"Either venue_order_id or client_order_id\") => {\n        anyhow::bail!(\"caller forgot to attach an order id\")\n    }\n    other => other,\n}","preventionTips":["Always retain the ClientOrderId returned by the order factory","Prefer venue_order_id when handling order-status events","Make order-id parameters non-optional in wrapper APIs"],"tags":["order-status","missing-argument","lookup"],"backgroundTag":"missing-required-argument","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}