Hi Apple Developer Support,
We're currently implementing auto-renewable subscriptions in a React Native app using the react-native-iap library. The subscription purchases are working as expected in Sandbox. We receive the transaction and purchaseUpdatedListener gives us a valid-looking transactionReceipt
However, when we attempt to validate this receipt with Apple's servers, the response consistently returns status code 21002, indicating that the receipt data is either malformed or missing.
We’ve confirmed the receipt is well-formed, properly passed as received, and well above the minimum size expected. The shared secret is correctly configured and matches the subscription group. We're using the correct sandbox endpoint and ensuring no modification is done to the receipt before validation.
Despite this, validation fails every time. We are looking for guidance or clarification on what might cause this status, especially when the receipt is coming directly from the system after a successful test purchase.
const purchaseUpdateSub = purchaseUpdatedListener(async (purchase) => { console.log("🛒 Purchase Updated:", purchase); const receipt = purchase.transactionReceipt;
if (!receipt) { Alert.alert("Error", "No receipt found."); setLoading(false); return; }
});
the response is: { "status": 21002 }
Any guidance on why this might be happening would be appreciated. Thanks!
For troubleshooting steps, see TN3122: Receipt validation with the App Store fails with a non-zero error code.