You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
process.env.APPLE_KEY_ID, // From App Store Connect
239
+
);
240
+
241
+
res.json(signature);
242
+
});
243
+
```
244
+
245
+
**Important Notes:**
246
+
247
+
1.**Data Order**: The 7 fields MUST be joined in the exact order shown above (as per [Apple's documentation](https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/subscriptions_and_offers/generating_a_signature_for_promotional_offers))
248
+
2.**Nonce**: Must be a lowercase UUID v4 string
249
+
3.**Timestamp**: Must be in milliseconds (not seconds)
250
+
4.**Signature**: Must be base64-encoded (not hex or raw)
251
+
5.**Private Key**: Must be PKCS#8 PEM format from App Store Connect
252
+
6.**Separator**: Use Unicode character U+2063 (invisible separator)
253
+
254
+
**Common Errors:**
255
+
256
+
- "The data couldn't be read because it isn't in the correct format" → Signature is not base64-encoded
257
+
- "Invalid signature" → Incorrect data order or wrong separator
258
+
- "Signature verification failed" → Wrong private key or key ID
0 commit comments