When trying to retrieve option margin, proper margin amount is returned for "TRANSACTION_TYPE_BUY" but the order margin is received as "0" for "TRANSACTION_TYPE_SELL".
Another example for "option_premium": (some figure) for "transaction_type:BUY" "option_premium": 0 for "transaction_type:SELL" (actually, this is the latest):
PS: Make sure to remove app and client specific tokens.
DEBUG: POST https://api.kite.trade/margins/orders
[{"exchange":"NFO","tradingsymbol":"BANKNIFTY2420746500CE","transaction_type":"SELL","quantity":15,"price":46483.8,"product":"NRML","order_type":"LIMIT","trigger_price":46483.8,"variety":"regular"},{"exchange":"NFO","tradingsymbol":"BANKNIFTY2420746500PE","transaction_type":"SELL","quantity":15,"price":46483.8,"product":"NRML","order_type":"LIMIT","trigger_price":46483.8,"variety":"regular"}]
DEBUG: Content-Type: application/json
DEBUG: User-Agent: KiteConnect.Net/3.0.7.0
DEBUG: X-Kite-Version: 3
DEBUG: Authorization: token X0X0X0X0X0X0X0X:X0X0X0X0X0X0X0X0X0X0X0X0X0X0X
DEBUG: 200 {"status":"success","data":[{"type":"equity","tradingsymbol":"BANKNIFTY2420746500CE","exchange":"NFO","span":73602,"exposure":27817.019999999997,"option_premium":0,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":435.785625,"transaction_tax_type":"stt","exchange_turnover_charge":352.11478500000004,"sebi_turnover_charge":0.697257,"brokerage":20,"stamp_duty":0,"gst":{"igst":67.10616756,"cgst":0,"sgst":0,"total":67.10616756},"total":875.70383456},"total":101419.01999999999},{"type":"equity","tradingsymbol":"BANKNIFTY2420746500PE","exchange":"NFO","span":12464.850000000006,"exposure":0,"option_premium":0,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":435.785625,"transaction_tax_type":"stt","exchange_turnover_charge":352.11478500000004,"sebi_turnover_charge":0.697257,"brokerage":20,"stamp_duty":0,"gst":{"igst":67.10616756,"cgst":0,"sgst":0,"total":67.10616756},"total":875.70383456},"total":12464.850000000006}]}
And here is the one before, for 'banknifty buy':
DEBUG: POST https://api.kite.trade/margins/orders
[{"exchange":"NFO","tradingsymbol":"BANKNIFTY2420746500CE","transaction_type":"BUY","quantity":15,"price":46483.8,"product":"NRML","order_type":"LIMIT","trigger_price":46483.8,"variety":"regular"},{"exchange":"NFO","tradingsymbol":"BANKNIFTY2420746500PE","transaction_type":"BUY","quantity":15,"price":46483.8,"product":"NRML","order_type":"LIMIT","trigger_price":46483.8,"variety":"regular"}]
DEBUG: Content-Type: application/json
DEBUG: User-Agent: KiteConnect.Net/3.0.7.0
DEBUG: X-Kite-Version: 3
DEBUG: Authorization: token X0X0X0X0X0X0X0X:X0X0X0X0X0X0X0X0X0X0X0X0X0X0X
DEBUG: 200 {"status":"success","data":[{"type":"equity","tradingsymbol":"BANKNIFTY2420746500CE","exchange":"NFO","span":0,"exposure":0,"option_premium":5237.25,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":0,"transaction_tax_type":"stt","exchange_turnover_charge":2.64481125,"sebi_turnover_charge":0.00523725,"brokerage":20,"stamp_duty":0,"gst":{"igst":4.07700873,"cgst":0,"sgst":0,"total":4.07700873},"total":26.72705723},"total":5237.25},{"type":"equity","tradingsymbol":"BANKNIFTY2420746500PE","exchange":"NFO","span":0,"exposure":0,"option_premium":8427,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":0,"transaction_tax_type":"stt","exchange_turnover_charge":4.255635,"sebi_turnover_charge":0.008427,"brokerage":20,"stamp_duty":0,"gst":{"igst":4.3675311599999995,"cgst":0,"sgst":0,"total":4.3675311599999995},"total":28.63159316},"total":8427}]}
DEBUG: POST https://api.kite.trade/margins/orders
[{"exchange":"MCX","tradingsymbol":"GOLDM24FEB62700PE","transaction_type":"BUY","quantity":1,"price":62695,"product":"NRML","order_type":"LIMIT","trigger_price":62695,"variety":"regular"},{"exchange":"MCX","tradingsymbol":"GOLDM24FEB62700CE","transaction_type":"BUY","quantity":1,"price":62695,"product":"NRML","order_type":"LIMIT","trigger_price":62695,"variety":"regular"}]
DEBUG: Content-Type: application/json
DEBUG: User-Agent: KiteConnect.Net/3.0.7.0
DEBUG: X-Kite-Version: 3
DEBUG: Authorization: token X0X0X0X0X0X0X0X:X0X0X0X0X0X0X0X0X0X0X0X0X0X0X
DEBUG: 200 {"status":"success","data":[{"type":"commodity","tradingsymbol":"GOLDM24FEB62700PE","exchange":"MCX","span":0,"exposure":0,"option_premium":4630,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":0,"transaction_tax_type":"ctt","exchange_turnover_charge":2.315,"sebi_turnover_charge":0.00463,"brokerage":20,"stamp_duty":0,"gst":{"igst":4.0175334,"cgst":0,"sgst":0,"total":4.0175334},"total":26.3371634},"total":4630},{"type":"commodity","tradingsymbol":"GOLDM24FEB62700CE","exchange":"MCX","span":0,"exposure":0,"option_premium":5050,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":0,"transaction_tax_type":"ctt","exchange_turnover_charge":2.525,"sebi_turnover_charge":0.00505,"brokerage":20,"stamp_duty":0,"gst":{"igst":4.055409,"cgst":0,"sgst":0,"total":4.055409},"total":26.585459},"total":5050}]}
DEBUG: POST https://api.kite.trade/margins/orders
[{"exchange":"MCX","tradingsymbol":"GOLDM24FEB62700PE","transaction_type":"SELL","quantity":1,"price":62695,"product":"NRML","order_type":"LIMIT","trigger_price":62695,"variety":"regular"},{"exchange":"MCX","tradingsymbol":"GOLDM24FEB62700CE","transaction_type":"SELL","quantity":1,"price":62695,"product":"NRML","order_type":"LIMIT","trigger_price":62695,"variety":"regular"}]
DEBUG: Content-Type: application/json
DEBUG: User-Agent: KiteConnect.Net/3.0.7.0
DEBUG: X-Kite-Version: 3
DEBUG: Authorization: token X0X0X0X0X0X0X0X:X0X0X0X0X0X0X0X0X0X0X0X0X0X0X
DEBUG: 200 {"status":"success","data":[{"type":"commodity","tradingsymbol":"GOLDM24FEB62700PE","exchange":"MCX","span":43728.99902,"exposure":15629.375,"option_premium":0,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":313.475,"transaction_tax_type":"ctt","exchange_turnover_charge":313.475,"sebi_turnover_charge":0.62695,"brokerage":20,"stamp_duty":0,"gst":{"igst":60.13835100000001,"cgst":0,"sgst":0,"total":60.13835100000001},"total":707.7153010000001},"total":59358.37402},{"type":"commodity","tradingsymbol":"GOLDM24FEB62700CE","exchange":"MCX","span":0,"exposure":0,"option_premium":0,"additional":0,"bo":0,"cash":0,"var":0,"pnl":{"realised":0,"unrealised":0},"leverage":1,"charges":{"transaction_tax":313.475,"transaction_tax_type":"ctt","exchange_turnover_charge":313.475,"sebi_turnover_charge":0.62695,"brokerage":20,"stamp_duty":0,"gst":{"igst":60.13835100000001,"cgst":0,"sgst":0,"total":60.13835100000001},"total":707.7153010000001},"total":0}]}