They’re called “custom offer codes” and codes have been made redeemable within the app as well, if you care to implement the sheet of course.
In fact, custom codes need to be redeemed either in app or via URL/QR because if multiple apps use the code “NEWYEAR24” the App Store wouldn’t know for which app it is redeemed.
The URL contains your bundle id so that the App Store knows which app’s custom code the user is trying to redeem.
* You cannot generate human readable / human memorable coupon codes to distribute to your users, like NEWYEAR24 etc.
Instead, the codes are long random gobbledygook, single use only, and they can’t be redeemed within the app — only in the App Store itself.
It’s like they made this difficult and useless on purpose.