Deposit, PPI, purchase order

After agreeing on OTD on a used car, subject to PPI, I assume I’ll need to give a deposit. Is that right? if so, is the deposit a set or standard amount or percentage of the OTD or of sale price? And after the PPI, if the dealer and I cannot agree on something that may come up, will I get the deposit back? In what scenarios can they keep it? And if we do agree after the PPI, is the next step then execution of a purchase order setting out all the terms? And If I’ll be paying cash, is that when I tell them that — prior to signing purchase order — or do I have to meet with the finance person anyway for discussion of extended warranties, etc? TIA!