I would like to programmatically keep track of offer codes that have been used.
I just configured a Test Offer Code (Reference name), which contains 500 codes (Offer Codes) to buy a 1-month subscription for 0,49€.
I was able to redeem the code and everything works, but I was expecting to receive the used code. Instead I received the Reference name in the payload from the App Store Server Notification in the field offer_code_ref_name="Test Offer Code"
. (expected was sth like offer_code_ref_name="JFFDS61SBJDBJ5BXJS4BX"
)
I would be able to identify the Reference name by the code, if it was provided, because I have the following table in my app's backend:
reference_name | code | url | expires_at | used | reserved
Test Offer Code | xadz | zzz | 31-07-2022 | t | f
Test Offer Code | asdf | *** | 31-07-2022 | f | f
The used code doesn't seem to be included in the latest receipt. How can I obtain it?
Can I somehow call App Store Connect API?
Thanks