Discounts, where offered, are available at time of purchase - and cannot be applied retrospectively.
If purchased directly from Apple, you generally have 14-days within which Apple will unconditionally accept return of an undamaged device for exchange or refund. This opportunity can sometimes be helpful in being able to return for refund - and then make a new purchase with benefit of a discount where available.
Student Discount programmes from Apple, where available, require that eligible students are enrolled in a recognised higher education programme within the country of purchase.
In most countries, the key to accessing Apple’s Educational Discount programme is being registered with UNiDAYS.
Education Pricing and Student Discounts - Education - Apple
https://www.myunidays.com