GerMargin() returning data exception error

Harsh1993
this is happening to only a few users and not all
We tried regenerating a new API Key and checked with the same account but getting data exception errors continuously.

public decimal GetFunds()
{
try
{
UserMarginsResponse userMarginsResponse = _APIHelper.GetMargins();
return Convert.ToDecimal(userMarginsResponse.Equity.Net.ToString());
}
catch (Exception ex)
{
LogMessage.ExceptionLog($"GetFund", ex, ClientID: _BrokerLoginReqRes.ClientID);
}
return 0;
}


EX Response 1 :
{"The given key was not present in the dictionary. {\"debits\":2238702.1425,\"payout\":0,\"liquid_collateral\":2156628.6,\"stock_collateral\":655827.69656,\"span\":1845604.7999999998,\"exposure\":400418.8425,\"additional\":0,\"delivery\":0,\"option_premium\":-7321.5,\"holding_sales\":0,\"m2m_realised\":-3658.5,\"m2m_unrealised\":0} {\"segment\":\"EQUITY\",\"enabled\":true,\"net\":935335.1540600001,\"available\":{\"adhoc_margin\":0,\"cash\":0,\"opening_balance\":365239.5,\"live_balance\":368902.5,\"collateral\":2812456.29656,\"intraday_payin\":0},\"utilised\":{\"debits\":2238702.1425,\"payout\":0,\"liquid_collateral\":2156628.6,\"stock_collateral\":655827.69656,\"span\":1845604.7999999998,\"exposure\":400418.8425,\"additional\":0,\"delivery\":0,\"option_premium\":-7321.5,\"holding_sales\":0,\"m2m_realised\":-3658.5,\"m2m_unrealised\":0}} {\"commodity\":{\"enabled\":false,\"net\":0,\"available\":{\"adhoc_margin\":0,\"cash\":0,\"opening_balance\":0,\"live_balance\":0,\"collateral\":0,\"intraday_payin\":0},\"utilised\":{\"debits\":0,\"payout\":0,\"liquid_collateral\":0,\"stock_collateral\":0,\"span\":0,\"exposure\":0,\"additional\":0,\"delivery\":0,\"option_premium\":0,\"holding_sales\":0,\"m2m_realised\":0,\"m2m_unrealised\":0}},\"equity\":{\"segment\":\"EQUITY\",\"enabled\":true,\"net\":935335.1540600001,\"available\":{\"adhoc_margin\":0,\"cash\":0,\"opening_balance\":365239.5,\"live_balance\":368902.5,\"collateral\":2812456.29656,\"intraday_payin\":0},\"utilised\":{\"debits\":2238702.1425,\"payout\":0,\"liquid_collateral\":2156628.6,\"stock_collateral\":655827.69656,\"span\":1845604.7999999998,\"exposure\":400418.8425,\"additional\":0,\"delivery\":0,\"option_premium\":-7321.5,\"holding_sales\":0,\"m2m_realised\":-3658.5,\"m2m_unrealised\":0}}}"}

EX Response 2 from latest kite .net DLL

The given key 'turnover' was not present in the dictionary. {"debits":2238702.1425,"payout":0,"liquid_collateral":2156628.6,"stock_collateral":655827.69656,"span":1845604.7999999998,"exposure":400418.8425,"additional":0,"delivery":0,"option_premium":-7321.5,"holding_sales":0,"m2m_realised":-3658.5,"m2m_unrealised":0} {"segment":"EQUITY","enabled":true,"net":935335.1540600001,"available":{"adhoc_margin":0,"cash":0,"opening_balance":365239.5,"live_balance":368902.5,"collateral":2812456.29656,"intraday_payin":0},"utilised":{"debits":2238702.1425,"payout":0,"liquid_collateral":2156628.6,"stock_collateral":655827.69656,"span":1845604.7999999998,"exposure":400418.8425,"additional":0,"delivery":0,"option_premium":-7321.5,"holding_sales":0,"m2m_realised":-3658.5,"m2m_unrealised":0}} {"commodity":{"enabled":false,"net":0,"available":{"adhoc_margin":0,"cash":0,"opening_balance":0,"live_balance":0,"collateral":0,"intraday_payin":0},"utilised":{"debits":0,"payout":0,"liquid_collateral":0,"stock_collateral":0,"span":0,"exposure":0,"additional":0,"delivery":0,"option_premium":0,"holding_sales":0,"m2m_realised":0,"m2m_unrealised":0}},"equity":{"segment":"EQUITY","enabled":true,"net":935335.1540600001,"available":{"adhoc_margin":0,"cash":0,"opening_balance":365239.5,"live_balance":368902.5,"collateral":2812456.29656,"intraday_payin":0},"utilised":{"debits":2238702.1425,"payout":0,"liquid_collateral":2156628.6,"stock_collateral":655827.69656,"span":1845604.7999999998,"exposure":400418.8425,"additional":0,"delivery":0,"option_premium":-7321.5,"holding_sales":0,"m2m_realised":-3658.5,"m2m_unrealised":0}}}

Tagged:
Sign In or Register to comment.