diff --git a/src/lib_binance_execution/binance_execution/spots/messages/create_order_request.cpp b/src/lib_binance_execution/binance_execution/spots/messages/create_order_request.cpp index ef431712e..78cf1d9a1 100644 --- a/src/lib_binance_execution/binance_execution/spots/messages/create_order_request.cpp +++ b/src/lib_binance_execution/binance_execution/spots/messages/create_order_request.cpp @@ -37,6 +37,9 @@ void to_json(nlohmann::json &j, const CreateOrderRequest &req) { if (!req.newClientOrderId.empty()) { j["newClientOrderId"] = req.newClientOrderId; } + if (req.newOrderRespType != NewOrderResponseType::NONE) { + j["newOrderRespType"] = req.newOrderRespType; + } if (!std::isnan(req.price)) { std::string price_str; price_to_string(req.price, price_str); @@ -61,7 +64,11 @@ void from_json(const nlohmann::json &j, CreateOrderRequest &req) { j.at("type").get_to(req.type); j.at("timestamp").get_to(req.timestamp); j.at("newClientOrderId").get_to(req.newClientOrderId); - auto it = j.find("price"); + auto it = j.find("newOrderRespType"); + if (it != j.end()) { + it->get_to(req.newOrderRespType); + } + it = j.find("price"); if (it != j.end()) { it->get_to(req.price); }