{"record":{"id":"f9a2f786a3d094c4","repo":"nautechsystems/nautilus_trader","slug":"either-venue-order-id-or-client-order-id-must-be-p-f9a2f7","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/bitmex/src/http/client.rs","lineNumber":2074,"sourceCode":"        Ok(Some(report))\n    }\n\n    /// Request a single order status report.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if:\n    /// - Credentials are missing.\n    /// - The request fails.\n    /// - The API returns an error.\n    pub async fn request_order_status_report(\n        &self,\n        instrument_id: InstrumentId,\n        client_order_id: Option<ClientOrderId>,\n        venue_order_id: Option<VenueOrderId>,\n    ) -> anyhow::Result<OrderStatusReport> {\n        if venue_order_id.is_none() && client_order_id.is_none() {\n            anyhow::bail!(\"Either venue_order_id or client_order_id must be provided\");\n        }\n\n        let mut params = GetOrderParamsBuilder::default();\n        params.symbol(instrument_id.symbol.as_str());\n\n        if let Some(venue_order_id) = venue_order_id {\n            params.filter(serde_json::json!({\n                \"orderID\": venue_order_id.as_str()\n            }));\n        } else if let Some(client_order_id) = client_order_id {\n            params.filter(serde_json::json!({\n                \"clOrdID\": client_order_id.as_str()\n            }));\n        }\n\n        params.count(1i32);\n        let params = params.build().map_err(|e| anyhow::anyhow!(e))?;\n","sourceCodeStart":2056,"sourceCodeEnd":2092,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/http/client.rs#L2056-L2092","documentation":"Raised by request_order_status_report when both venue_order_id and client_order_id are None. This report-generation method requires an order identifier to build the filter for the BitMEX /order request. It fails fast instead of querying without a target order.","triggerScenarios":"Calling request_order_status_report without either identifier. Typically a caller building reconciliation or status flows that did not resolve an order ID from the upstream command.","commonSituations":"Reconciliation sweeps for a specific order where the generate_order_status_report command carried no IDs; handling generate-order-status events before any order was submitted.","solutions":["Supply venue_order_id (checked first) or client_order_id when calling the method","Resolve the identifier from the order cache or a prior submit response before requesting the report","Skip the report request when no identifiers exist for the order"],"exampleFix":"// before\nlet report = client.request_order_status_report(instrument_id, None, None).await?;\n// after\nif venue_order_id.is_none() && client_order_id.is_none() { return Ok(()); }\nlet report = client.request_order_status_report(instrument_id, client_order_id, venue_order_id).await?;","handlingStrategy":"validation","validationCode":"ensure!(venue_order_id.is_some() || client_order_id.is_some(), \"request_order_status_report requires an order id\");\nlet report = client.request_order_status_report(instrument_id, client_order_id, venue_order_id).await?;","typeGuard":"fn reportable(c: &Option<ClientOrderId>, v: &Option<VenueOrderId>) -> bool {\n    c.is_some() || v.is_some()\n}","tryCatchPattern":"match client.request_order_status_report(instrument_id, client_order_id, venue_order_id).await {\n    Ok(report) => { /* handle */ }\n    Err(e) if e.to_string().contains(\"must be provided\") => { /* input bug */ }\n    Err(e) => return Err(e),\n}","preventionTips":["Only generate order status report requests for orders that carry an identifier","Note the method prefers venue_order_id when both are given","Guard reconciliation flows against ID-less order references"],"tags":["rust","bitmex","validation","missing-argument"],"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"}