{"record":{"id":"7c99c466658e1a3b","repo":"nautechsystems/nautilus_trader","slug":"either-client-order-id-or-venue-order-id-must-be-p-7c99c4","errorCode":null,"errorMessage":"Either client_order_id or venue_order_id must be provided","messagePattern":"Either client_order_id or venue_order_id must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/http/spot/client.rs","lineNumber":2885,"sourceCode":"    /// - The request fails.\n    pub async fn modify_order(\n        &self,\n        instrument_id: InstrumentId,\n        client_order_id: Option<ClientOrderId>,\n        venue_order_id: Option<VenueOrderId>,\n        quantity: Option<Quantity>,\n        price: Option<Price>,\n        trigger_price: Option<Price>,\n    ) -> anyhow::Result<VenueOrderId> {\n        let _ = self\n            .get_cached_instrument(&instrument_id.symbol.inner())\n            .ok_or_else(|| InstrumentLookupError::not_found(instrument_id))?;\n\n        let txid = venue_order_id.as_ref().map(|id| id.to_string());\n        let cl_ord_id = client_order_id.as_ref().map(truncate_cl_ord_id);\n\n        if txid.is_none() && cl_ord_id.is_none() {\n            anyhow::bail!(\"Either client_order_id or venue_order_id must be provided\");\n        }\n\n        let mut builder = KrakenSpotAmendOrderParamsBuilder::default();\n        if let Some(ref id) = txid {\n            builder.txid(id.clone());\n        } else if let Some(ref id) = cl_ord_id {\n            builder.cl_ord_id(id.clone());\n        }\n\n        if let Some(qty) = quantity {\n            builder.order_qty(qty.to_string());\n        }\n\n        if let Some(p) = price {\n            builder.limit_price(p.to_string());\n        }\n\n        if let Some(tp) = trigger_price {","sourceCodeStart":2867,"sourceCodeEnd":2903,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/http/spot/client.rs#L2867-L2903","documentation":"amend_order on Kraken Spot requires an identifier for the order to amend: either the venue txid or the client order id. When both are None the client cannot address the edit request and bails before building the amend params.","triggerScenarios":"Calling amend_order with both venue_order_id and client_order_id omitted/None, e.g. amending an order whose submit ack has not arrived and whose client id was not passed.","commonSituations":"UI or strategy flows that let users edit orders before confirmation; lost linkage between local orders and venue ids after restart; forgetting to pass ClientOrderId when only a local order object is available.","solutions":["Pass the client_order_id (it is truncated and sent as cl_ord_id) when the venue txid is unknown.","Pass venue_order_id (txid) from the original order status report when available.","Retrieve the missing identifier from your order cache or the open-orders endpoint first.","Guard the call site so amend is only attempted once at least one identifier exists."],"exampleFix":"// before\nclient.amend_order(instrument_id, None, None, Some(new_qty), Some(new_price)).await?;\n\n// after\nclient.amend_order(instrument_id, Some(venue_order_id), None, Some(new_qty), Some(new_price)).await?;","handlingStrategy":"validation","validationCode":"if venue_order_id.is_none() && client_order_id.is_none() {\n    return Err(\"amend_order requires venue_order_id or client_order_id\");\n}\nclient.amend_order(instrument_id, venue_order_id, client_order_id, qty, price).await?;","typeGuard":"fn is_amendable(venue: Option<&VenueOrderId>, client: Option<&ClientOrderId>) -> bool {\n    venue.is_some() || client.is_some()\n}","tryCatchPattern":"match client.amend_order(instrument_id, vid, cid, qty, price).await {\n    Err(e) if e.to_string().contains(\"Either client_order_id or venue_order_id\") => log::error!(\"no id supplied for amend\"),\n    Err(e) => return Err(e),\n    Ok(_) => {}\n}","preventionTips":["Pass ClientOrderId at submit time and reuse it for later amendments","Block UI/strategy edits until an order identifier is known","Resolve txid from the open-orders endpoint when only local state exists"],"tags":["amend-order","missing-identifier","kraken-spot","validation"],"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-14T05:17:10.506Z"}