Doc Fees

If you’re buying a car out of state, do you pay doc fees based on the state you’re purchasing from or the state you reside in?