
All keys return in camelCase format (just like in all App Store Server API requests). As a reminder, they contain a date and a reason for subscription revocation as a result of a refund, so the new name looks more logical. Cancellation_date and cancellation_reason fields have new names now: revocationDate and revocationReason. Another new field – type – includes transaction type. Apple added inAppOwnershipType field, which helps to understand whether a user bought a product or accessed it thanks to a family subscription. Now, you can use offer codes for analytics. In the past, it was impossible to track the use of the offer on the server-side, this worsened the analytics. If a promo offer or offer code was used, offerIdentifier key will contain the ID of the used offer. 2 - promo offer (available only for current and expired subscriptions). 1 - intro offer (available only for the users without active or expired subscriptions). Apple also added offerType and offerIdentifier fields that contain the information about a used offer (if any). If it is set, it will be returned in all transactions in this chain (renewal, billing issues, etc.), and you will easily understand which user made a purchase. This ID must be in UUID format, it is set in the mobile app when a purchase is being initialized. Apple added appAccountToken field, which contains your system’s user ID.
Below, I will describe the most important changes. You can learn details about a new format in documentation. From my point of view, now, it’s more convenient to work with them. "offerIdentifier": "basic_subscription_1_month.pay_as_you_go.3_months"Īpple changed and extended the transaction format. "productId": "basic_subscription_1_month", You will also need its ID – you can copy it on the same page as Issue ID which can be found in the App Store Connect API tab. Open App Store Connect and go to the Users and Access section, then to Keys tab. Key generationįirst of all, create a private key that will be used to authorize the requests. A new version of API uses JSON Web Token (JWT) standard for request authentication. This is a secret fixed string that you can get in App Store Connect. In the current API version, you need Shared Secret to send a request. Today, we will consider working with StoreKit 2 on the part of the server, in other words, with the help of App Store Server API. A share of apps with in-app purchase and subscription features grows steadily, and Apple significantly simplified integration of in-app purchases into the app by releasing StoreKit 2. This is a framework responsible for making purchases in iOS. Apple introduced a new version of StoreKit 2 during WWDC 2021 that took place recently.