Environment: Sandbox Bundle ID: com.fosssocial.app Key ID: L7DZYHGM62 Issuer ID: cf1f7bc7-452f-4bb8-a925-31ca29175fac
Summary
Our In-App Purchase key is accepted by the App Store Server API but rejected by the Advanced Commerce API, using the exact same bearer token. This appears to be an authorization grant that was never applied to the key, rather than a signing or request-format problem on our side.
Reproduction — one token, two API families
GET /inApps/v1/subscriptions/1 -> 404, errorCode 4040010 (token ACCEPTED, resource simply not found)
POST /advancedCommerce/v1/subscription/changeMetadata/1 -> 401, errorCode 4010000 (token REJECTED)
Same JWT, same key, issued seconds apart. A 401 on one family and a 404 on the other isolates this to key authorization.
On-device symptom
A signed SubscriptionCreateRequest passed to StoreKit as advancedCommerceData fails with StoreKitError.unknown / "Unable to Complete Request". No payment sheet appears and no InvalidRequestError is returned, so there is no field-level error to act on.
What we have already verified
- JWS header: alg ES256, kid, typ JWT
- Claims: iss, iat, aud "advanced-commerce-api", bid, nonce, request
- No exp claim (per Apple's documentation)
- The request claim uses standard padded base64, not base64url
- Key ID and .p8 file confirmed to be a matching pair
- Key regenerated after receiving the Advanced Commerce access-granted email; the 401 is unchanged
- AdvancedCommerceProduct(id:) resolves successfully on device, which confirms the PRODUCT has Advanced Commerce access
Question
Does the In-App Purchase key require a separate authorization for the Advanced Commerce API beyond the product-level access we were granted? If so, how is that applied to an existing key?