Order placing API returns status = success even when order failed due to margin shortfall

I placed an order to sell few options, the last option sell failed due to margin shortfall, but API returned success

code used was:

response = requests.post(url, json=data, headers=headers)

@Pradeep_Jaiswar @Ketan any help here?

I recommend checking your funds and margin before placing an order, as order rejections due to insufficient funds occur within the order management system after you receive your initial acknowledgment with the order number.

We are developing a margin API that will enable you to calculate the required margin for all your orders within a bucket or strategy.

The margin API will be useful

Yes, the margin API is currently in development and will be available for customers soon.

If I am placing 4 option orders. which include Buying and selling of a particualar option using Python script.

BUY - place_order()
SOLD - place_order()
BUY - place_order()
SOLD - place_order()

Now these are executed in sequence and quick and It will take Miliseconds to place order. If I have a Fix Balance. In how much time does margins or balance in upstox wallet get updated. So That the next order which required balance does not failed due to late updation of margins of previous exit orders the order due to insufficent margins

1 Like

Can someone answer this?? @Pradeep_Jaiswar @Ketan

I want to Know Margin Calculation Time by Upstoxā€¦ because I am placing Many lots of Options buy and Sell within 1 second with a limited balance only and I have to do Shifting of postions further which requires correct margin for perfect shifting of positions.

The process occurs immediately when the order is processed in the order management system. Once your order is executed, the margin hedge are released and managed accordingly.

You can use the Margin API to calculate your margin. Refer to the documentation here: Upstox Margin API.

1 Like