Wrong Documentation for autoslice order caused me loss

zhkas
zhkas edited October 8 in General
The documentation says:
autoslice : Enable automatic slicing for orders exceeding freeze quantity limits. Values: true (enable), false (disable, default).
However, it doesn't explicitly mention what happens when the order quantity is less than the freeze quantity.

My understanding is that when automatic slicing is enabled
orders exceeding the freeze quantity will be automatically split into multiple orders,
while orders below the freeze quantity should be placed normally without requiring slicing

However, when I enabled this option, I received the following error:
Quantity should be greater than or equal to 3510 for order slicing.
Why is the minimum quantity for slicing being enforced even when my order quantity is below the freeze quantity?

Shouldn't the system automatically handle it as:
  • qty <= freeze quantity → place the order normally </li>
  • qty > freeze quantity → automatically slice the order
Please clarify whether this is the intended behavior or whether there is an additional requirement for using automatic order slicing.

Also please correct the documentation accordingly.


I also feel that publishing an OpenAPI specification would make the API much more transparent and useful for developers.
It would clearly define the request parameters, data types, required fields, allowed values, validation rules, error responses, and expected behaviour for cases such as quantities below or above the freeze quantity.
This would make it much easier to understand and integrate the API correctly without having to infer behaviour from brief parameter descriptions.

Example:
Response for autoslice is
{"status":"success","data":{"order_id":"XXXXX","children":[{"order_id":"YYYYYY"}]}}

which is nowhere mentioned in the API doc

Please publish the openAPI specification.
  • zhkas
    @nagavenij @Nivas
    please help here
  • zhkas
    Please reply
    its urgent
  • nagavenij
    We are looking into this and will update you shortly.
  • salim_chisty
    However, when I enabled this option, I received the following error:
    Quantity should be greater than or equal to 3510 for order slicing.
    The autoslice=true automatically splits orders exceeding the exchange freeze quantity into smaller orders. When the quantity is at or below the freeze limit, the order should be placed without autoslice or 'autoslice'="false". The error indicates that the submitted quantity did not meet the minimum required by the slicing validation.
    Please clarify whether this is the intended behavior or whether there is an additional requirement for using automatic order slicing.
    This is the intended behaviour for auto-slicing, as mentioned in the API documentation.Even when the order quantity is within the freeze limit, enabling auto-slicing by default may result in orders being split without the user’s explicit intent.
    Accordingly, users should pass autoslice=true when they want an order exceeding the freeze quantity to be automatically sliced. This ensures that slicing is performed only when explicitly requested.

    For the minimum-quantity validation request, we will check the feasibility of making it smoother.
    I also feel that publishing an OpenAPI specification would make the API much more transparent and useful for developers.
    Currently, we don't support the OpenAPI specification. We consider this as feedback.
  • zhkas
    Please update the same on API docs
    and the response
    {"status":"success","data":{"order_id":"XXXXX","children":[{"order_id":"YYYYYY"}]}} too.

    It will be very helpful if we already know all the responses (error types) , so that we can write handler accordingly.

    Thanks
  • nagavenij
    We understand your request. However, documenting every possible error type and response may not be feasible. We recommend handling errors based on the error codes and exceptions outlined in the API documentation.
  • zhkas
    Thanks
    But it is feasible, if you simply publish the open-API specification,
    your back-end server must have all defined routes, request and response schema.
    so simply publish that for developer to use them
  • zhkas
    This is the response you stated that will be returned
    {
    "status": "success",
    "data": [
    {
    "order_id": "1914227164488687616"
    },
    {
    "order_id": "1914227164534824960"
    },
    {
    "order_id": "1914227164580962304"
    },
    {
    "error": {
    "code": 400,
    "error_type": "MarginException",
    "message": "Insufficient funds. Required margin is 228365.92 but available margin is 228358.50.",
    "data": null
    }
    },
    {
    "order_id": "1914227164681625600"
    }
    ]
    }
    but in reality, response we are getting is :
    {"status":"success","data":{"order_id":"XXXXX","children":[{"order_id":"YYYYYY"}]}}
    @salim_chisty @nagavenij
    How then API documentation is correct ?

    Unlike a regular order placement response, the API returns data as an array with one entry per slice.
    But response is slice under children.

    Why are you not rectifying the documentation ?
  • zhkas
    zhkas edited October 13

    To elaborate further

    In reality, response we are getting is :
    {
    "status": "success",
    "data": {
    "order_id": "XXXX",
    "children": [
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "order_id": "XXXX"
    },
    {
    "error": {
    "code": 429,
    "error_type": "NetworkException",
    "message": "Maximum allowed order requests per second exceeded.",
    "data": null
    }
    }
    ]
    }
    }
    @salim_chisty @nagavenij
    The documentation states:

    Unlike a regular order placement response, the API returns data as an array with one entry per slice.

    Please clarify the correct response structure and expected behaviour even if you do not wish to share the full REST API specification.
    If children is the actual and final response format, please confirm explicitly. I need this clarity to avoid unexpected issues during live trading hours.


    @salim_chisty words
    Even when the order quantity is within the freeze limit, enabling auto-slicing by default may result in orders being split without the user’s explicit intent.
    Accordingly, users should pass autoslice=true when they want an order exceeding the freeze quantity to be automatically sliced. This ensures that slicing is performed only when explicitly requested.
    Please add this scenario to the documentation, as API documentation currently does not specify what happens when the provided quantity is less than the freeze quantity.

    All I am looking for is:
    1. The response schema.
    2. The expected behaviour in different scenarios.

    I want to ensure there are no surprises during trading hours.
  • nagavenij
    We are looking into this and will update you shortly.
  • salim_chisty
    @zhkas

    Response Schema
    • data.children[] is the canonical JSON structure for autosliced orders. Each element represents an individual slice and contains either an order_id if the order is successfully placed or an error object if the slice fails.
    • The top-level data.order_id represents the parent ID for the request. This is updated in the doc.
    Behavioral Scenarios
    • Quantity exceeds Freeze Limit and autoslice=true: The order is automatically divided into multiple child orders. The details of each slice are returned in data.children[].
    • Quantity is less than Freeze Limit and autoslice=true: The request is rejected immediately with HTTP 400 (InputException). The autoslice flag should only be set to true when the requested quantity strictly exceeds the freeze limit.
    • Quantity is greater than Freeze Limit and autoslice=false: The order is rejected by the RMS or exchange with the standard freeze limit rejection error.
    Slice Limit and Rate Limiting (HTTP 429)
    • Kite Connect enforces the rate limit of 10 order placements per second. Since autosliced orders are submitted concurrently, a single request can generate a maximum of 10 slices without exceeding this limit.
    • Any slice beyond the 10th may fail with HTTP 429 (NetworkException: Maximum allowed order requests per second exceeded).
    Recommendation
    • Ensure that the quantity in a single order request does not exceed 10 × freeze_quantity.
    • If the total quantity requires more than 10 slices, split the parent order into multiple requests on the client side and space those requests more than one second apart to reduce the risk of rate-limit errors.
  • zhkas
    Thanks
Sign In or Register to comment.