Cal. Rev. & Tax. Code § 6901
(a) If the department determines that any amount, penalty, or interest has been paid more than once or has been erroneously or illegally collected or computed, the department shall set forth that fact in the records of the department and shall certify the amount collected in excess of the amount legally due and the person from whom it was collected or by whom paid. The excess amount collected or paid shall be credited by the department on any amounts then due and payable from the person from whom the excess amount was collected or by whom it was paid under this part, and the balance shall be refunded to the person, or the person’s successors, administrators, or executors, if a determination by the department is made in any of the following cases: