Error while submitting order through API

Hello Team, When I am submitting my orders from API its thoriwng error as : {‘s’: ‘error’, ‘code’: -310, ‘message’: ‘Please provide a valid order quantity’, ‘id’: ‘’}

I am passing my entries as per documentation only:

Python:

from fyers_api import fyersModel

order_data = []  # List to store the order data, single or multiple

if broker_quantity_multiplier:
    quantity = quantity * broker_quantity_multiplier
for i in range(0, quantity, max_lots_allowed):
    execution_quantity = min(quantity - i, max_lots_allowed)
    data = {
        "symbol": strike_key,
        "qty": int(execution_quantity*lot_size),
        "type": order_type_constant,
        "side": buy_sell_constant,
        "productType": product_type_constant,
        "limitPrice": limit_price,
        "stopPrice": stop_loss,
        "validity": "DAY",
        "disclosedQty": 0,
        "offlineOrder": "False",
    }
    
    order_data.append(data)

print(order_data)
orderResponse = self.fyersOrders(broker_id=broker_api_key, broker_auth_token=broker_auth_token,
                                 order_data=order_data)

Response of print(order_data):
[{'symbol': 'NSE:SBIN-EQ', 'qty': 1, 'type': 2, 'side': 1, 'productType': 'INTRADAY', 'limitPrice': 0, 'stopPrice': 0, 'validity': 'DAY', 'disclosedQty': 0, 'offlineOrder': 'False'}, {'symbol': 'NSE:HDFC-EQ', 'qty': 1, 'type': 2, 's
ide': 1, 'productType': 'INTRADAY', 'limitPrice': 0, 'stopPrice': 0, 'validity': 'DAY', 'disclosedQty': 0, 'offlineOrder': 'False'}]

Hi @amit_moghe ,
Can you loop through this condition - for i in range(0, quantity, max_lots_allowed)
and print int(execution_quantity*lot_size)
I would like to see what are getting from this.

@8Rr5ULRBVR Hi Vinay, Its printing, 25. However whatI observed if I am appendig the data to order_data and then passing to fyersModel to place order its not working , however, If I call fyers model everytime in the loop to place ordewr rather than appending to the order_data= its working.

But as per documentation both approch should work. Even example provided on documentation also didnt work when we are executing:

data = [{
    "symbol":"NSE:SBIN-EQ",
    "qty":1,
    "type":2,
    "side":1,
    "productType":"INTRADAY",
    "limitPrice":0,
    "stopPrice":0,
    "validity":"DAY",
    "disclosedQty":0,
    "offlineOrder":"False",
},
{
    "symbol":"NSE:HDFC-EQ",
    "qty":1,
    "type":2,
    "side":1,
    "productType":"INTRADAY",
    "limitPrice":0,
    "stopPrice":0,
    "validity":"DAY",
    "disclosedQty":0,
    "offlineOrder":"False",
}]

response = fyers.place_basket_orders(data=data)
print(response)

Response of above:
[{'symbol': 'NSE:SBIN-EQ', 'qty': 1, 'type': 2, 'side': 1, 'productType': 'INTRADAY', 'limitPrice': 0, 'stopPrice': 0, 'validity': 'DAY', 'disclosedQty': 0, 'offlineOrder': 'False'}, {'symbol': 'NSE:HDFC-EQ', 'qty': 1, 'type': 2, 's
ide': 1, 'productType': 'INTRADAY', 'limitPrice': 0, 'stopPrice': 0, 'validity': 'DAY', 'disclosedQty': 0, 'offlineOrder': 'False'}]

Hi Amit,
Can you please let me know the SDK version you are using pip list should list all the Python packages and their version.because multi-order does’nt response in that format this is the response format

{
    "s": "ok",
    "code": 200,
    "message": "",
    "data": [{"statusCode": 200,
              "body": {
                        "s": "ok",
                        "code": 200,
                        "message": "Order submitted successfully. 
                                    Your Order Ref. No. 120080778988",
                        "id": "120080778988"
                      },
              "statusDescription": "HTTP OK"
            },
            {
              "statusCode": 200,
              "body": 
                      {
                        "s": "ok",
                        "code": 200,
                        "message": "Order submitted successfully. 
                                    Your Order Ref. No.120080777359",
                        "id": "120080777359"
                      },
              "statusDescription": "HTTP OK"
            },
            {
              "statusCode": 200,
              "body": 
                      {
                        "s": "ok",
                        "code": 200,
                        "message": "Order submitted successfully. 
                                    Your Order Ref. No.120080777379",
                        "id": "120080777379"
                      }, "statusDescription": "HTTP OK"
              }]
  }