public IActionResult GetLowWalletBalanceStatus([FromQuery] string developerId) { try { string UserId = string.Empty; #region Auth request if (Request.Headers.TryGetValue("Authorization", out StringValues headerValues)) { UserId = headerValues.FirstOrDefault(); } else { return(BadRequest("Not Authorized")); } #endregion if (String.IsNullOrEmpty(developerId)) { return(BadRequest("Incorrect developerId")); } double amount = MongoConnector.GetAmountToAddBeforeNextBillingCycleForUser(developerId); DateTime?balanceWentZeroDate = MongoConnector.GetBalanceWentZeroDateForUser(developerId); Dictionary <string, Object> result = new Dictionary <string, Object> { { "amount_to_add", amount }, { "balanceWentZeroDate", balanceWentZeroDate }, }; return(Json(result)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }