Option Premium Debit/Credit

I buy Nifty options (Call/Put) and sell them before expiry. Please show with an example, how the daily debit/credit to the trading account works ? I had thought that the premium is immediately debited to the buyer’s account, but that does not appear to be ?
Thanks, Rajan

When you purchase Options, amount equal to Premium * Lot Size is debited from your account, similarly when you sell / square-off your position amount equal to Premium * Lot Size is credited to your account.


If I exit my position before expiry. Will I get to keep the premium or no?