We have implemented apple receipt verification using PHP which is working perfectly fine.
Now, I am trying to fetch the exact promo code from the receipt data if used by the customer in-app.
I can see offer name from latest_receipt_info[0].offer_code_ref_name.
I have implemented the transaction history detail after creating the required JWT
GET https://api.storekit.itunes.apple.com/inApps/v1/history/{originalTransactionId}
I received the following details after decoding signedTransaction.
[transactionId] => 270001159964727
[originalTransactionId] => 270001159964727
[webOrderLineItemId] => 270000507948216
[bundleId] => xxxx
[productId] => xxxxx
[subscriptionGroupIdentifier] => 20970033
[purchaseDate] => 1659593358000
[originalPurchaseDate] => 1659593358000
[expiresDate] => 1660198158000
[quantity] => 1
[type] => Auto-Renewable Subscription
[inAppOwnershipType] => PURCHASED
[signedDate] => 1659599990477
[offerType] => 3
[offerIdentifier] => PK_DEV2
[environment] => Production
Main Problem:
I was assuming to get the exact offer code used by the customer in the offer identifier field. which I am not getting.
Is there any way I can get the exact offer code used by the customer from the receipt?