A reference letter is not a statutory right — the employer is not required by law to write one, unlike the termination certificate. But it can be important for your next visa or job back home, so it is worth asking for before you leave.
Nationwide (all cities)
No statutory duty
There is no statutory duty. Unlike the termination certificate (which Article 50 requires), the law does not require the employer to write a reference or recommendation letter. Whether you can get one depends on the employer's goodwill and your relationship.
Still worth asking
It is worth asking anyway. Official departure checklists for foreigners flag the reference letter as a useful document to obtain before leaving — it supports future visa applications and job searches. It is easiest to get while you are still there, so ask before your last day.
What to ask for
What to ask for. A useful reference states your job title, the period of employment, and a short statement of your responsibilities and performance. Ask for it on company letterhead with a contact, and keep a copy of your termination certificate alongside it.