This is illegal under both California law and the Oakland Tenant Protection Ordinance (Am I covered under the Oakland Tenant Protection Ordinance?).

You are legally entitled to a rent receipt if you pay cash.
The only time this is not true is if you are trying to make an overdue payment after a 3-day notice to pay or quit has expired.

To protect yourself:

  1. You can try and pay rent through traceable ways through forms like money orders or checks. Because your landlord may try to evict you due to non payment of rent, try and keep the rent payments your landlord does not take. This will be helpful when needing evidence that you have attempted to pay your rent.
  2. You can also write a short letter informing your landlord of your right to receive a rent receipt. You can either send this letter through certified mail and get a receipt from the post office OR you can include the letter the next time you pay your rent. Regardless, make sure you keep a signed copy of the letter and give your landlord the original copy. If you can, get proof of your landlord receiving this letter. If your landlord does not stop this tactic, you can pursue suing them in small claims court.