关于通过Advanced commerce API 创建SKU,有几个问题:
1、通过Advanced commerce API创建的自动续费订阅的SKU是否支持推介优惠、促销优惠?如果可以,是在苹果connect设置吗?
2、已订阅通过connect创建的SKU的用户,是否可以重复订阅通过Advanced commerce API创建的SKU?还是要通过Advanced commerce API变更订阅?
3、Advanced commerce API创建的SKU ,用户订阅成功后,续费的扣款是否仍由苹果发起?还是由开发者自行发起?
The Advanced Commerce API support In-App Purchases through the App Store for exceptionally large catalogs of custom one-time purchases, subscriptions, and subscriptions with optional add-ons.
Posts under Advanced Commerce API tag
12 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
会员等级进行升级?需要按天计算费用,像爱奇艺这样是怎么做的?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
StoreKit
In-App Purchase
App Store Server API
Advanced Commerce API
We got Advanced Commerce API and the generic product identifiers approved. When I was try to migrate a sandbox subscription to ACA enabled subscription I hit an error
Request payload
(Hid some info but the requestReferenceId is the real)
{
"descriptors": {
"description": "Migrated",
"displayName": "Migration"
},
"items": [
{
"sku": "product_1mo_999",
"description": "description",
"displayName": "Product"
}
],
"requestInfo": {
"requestReferenceId": "3b0b8e67-d8a0-45f4-8f6d-06bffa9a2c08"
},
"storefront": "USA",
"targetProductId": "com.company.generic.subscription",
"taxCode": "C003-00-1"
}
Response
{
"errorCode": 5000000,
"errorMessage": "An unknown error occurred."
}
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
In-App Purchase
App Store Server API
Advanced Commerce API
We've been approved for the Advanced Commerce API. After receiving the approval, we completed the initial setup requirements (submitted a generic product ID and shared our subscriptions page deep link).
When testing the Migrate Subscription to Advanced Commerce endpoint in the sandbox, we receive a 5000000 error.
What could be the reason/s for it? There is no information, and the API call we make includes all required parameters. Could it be related to the fact that our new generic product ID status is "Missing Metadata"? Is there a way to understand what the issue is on Apple's side?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
In-App Purchase
App Store Server API
Advanced Commerce API
We’ve been approved for the Advanced Commerce API and are setting up the generic product identifiers per the guide:
https://developer.apple.com/documentation/advancedcommerceapi/setting-up-your-project-for-advanced-commerce#Set-up-generic-product-identifiers
We have multiple auto-renewable subscriptions (for simplicity: Product 1, Product 2, etc.). We created a new subscription group for Advanced Commerce and are about to add the subscription(s) inside that group.
Should we create one auto-renewable subscription (generic, e.g. subscription.ac) to represent all of our subscriptions, or one generic per product family (e.g., product1.ac, product2.ac, …)? If the answer depends on whether subscribers can hold multiple products simultaneously, please advise which structure supports that (e.g., separate groups).
Reporting identifiers / segmentation: In Sales and Trends and Payments & Financial Reports, which identifier(s) will appear after migration: the legacy StoreKit product_id, the new generic product id, and/or the SKU? If we use a single generic subscription for all products, what’s Apple’s recommended way to segment revenue by product (Product 1 vs. Product 2)? If SKUs don’t surface in these reports, should we prefer multiple generics/groups to preserve report-level segmentation?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
In-App Purchase
Advanced Commerce API
We got access into Advanced Commerce API and trying out the server APIs.
I was trying out the Migrate a Subscription to Advanced Commerce API but the API was just simply returning not found to me with a generic error code 4040000 (this is undocumented in the API doc).
Here is the request body
{
"descriptors": {
"description": "User migrated from old plan to Essential",
"displayName": "Essential Plan"
},
"items": [
{
"sku": "com.company.essential",
"description": "A new subscription description after migration",
"displayName": "Essential"
}
],
"requestInfo": {
"requestReferenceId": "11aa3174-9aeb-41a6-996d-fc655a793c06"
},
"storefront": "HKG",
"targetProductId": "com.company.subscription.base",
"taxCode": "C003-00-1"
}
Headers
Authorization: Bearer <REQUEST_TOKEN>
And the response
{
"errorCode": 4040000,
"errorMessage": "Not found."
}
Am I doing something wrong or there will be additional configuration needed?
Hi!
My product SKU has been approved for Advanced Commerce API. I successfully receive a purchase pop-up with the correct information.
However, I am still having issues with completing the purchase. I always receive Unauthorize error when I confirm the purchase (subscription in my case; see the screenshot). I am using the node.js server library to sign the request. I made sure that the account is a valid account enabled for Sandbox.
Logs unfortunately don't indicate any further detail.
Thanks for your advice! We've been stuck on this for a while now and would appreciate your help.
Marek
Hi Apple Team,
I'm a Nigerian developer building an app for local users, and I’m facing a major challenge:
Due to CBN regulations, most Nigerian cards can’t make international payments and do not support Dynamic currency conversion, which means In-App Purchases (IAP) don’t work for most Nigerians.
My app involves real-world services with external rewards and users would have to subscribe to be members, yet it’s unclear whether IAP is still mandatory.
If I am forced to use IAP, most Nigerian users simply can’t pay, and I lose nearly all revenue.
Questions:
Can developers targeting Nigeria use local gateways like Paystack or Flutterwave instead of IAP ?
Will Apple provide alternatives or guidance for regions where IAP is effectively unusable?
This is a critical issue for many local developers. I’d appreciate any official clarification.
Thanks,
Joseph
(Nigerian Developer)
Topic:
App Store Distribution & Marketing
SubTopic:
General
Tags:
Subscriptions
App Store Receipts
Advanced Commerce API
Hello,
We have been approved for the Advanced commerce API and we are trying to implement dynamically created subscriptions via the SubscriptionCreateRequest.
We followed the Sending Advanced Commerce API requests from your app (https://developer.apple.com/documentation/storekit/sending-advanced-commerce-api-requests-from-your-app) documentation but we are not able to make it work correctly.
We created a generic subscription in the Appstore connect, product ID: com.example.subscription
Then in the app we load the subscription:
try await Product.products(for: ["com.example.subscription"])
We do the JWS serialization on our backend and then we wrap the jwt and convert it to Data in the app as this:
let request = """
{
"signatureInfo": {
"token": "\(result.signedPayload)"
}
}
"""
let advancedCommerceRequestData = Data(request.utf8)
Lastly, we apply the purchase options on the generic product as this:
try await product.purchase(
options: [
Product.PurchaseOption.custom(
key: "advancedCommerceData",
value: advancedCommerceRequestData
)
]
)
It doesn't show any error, but on the payment sheet it shows the data from the generic subscription and not the data that was in the SubscriptionCreateRequest.
Here is an example of the generated jwt:
eyJraWQiOiI4V0tNQjhLWTI0IiwidHlwIjoiSldUIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiI0MDZkYmEyOS04ZjIyLTQ3ZDUtYWI1Mi1kY2M2NTQ5OTE1Y2MiLCJiaWQiOiJjby5oZXJvaGVyby5IZXJvaGVybyIsImlhdCI6MTc0NjQ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App Purchase
Advanced Commerce API
We’ve recently encountered an increased rate of purchase errors StoreKit.InvalidRequestError error 1 (https://developer.apple.com/documentation/storekit/invalidrequesterror) specifically on iOS 18.4.
We suspect this might be related to the new Advanced Commerce API introduced by Apple, although we haven’t made any changes related to this API in our app.
Have you experienced similar issues since the release of iOS 18.4 or when integrating the Advanced Commerce API? Any insights or suggestions would be greatly appreciated.
Thanks!
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit
In-App Purchase
Advanced Commerce API
Hi All,
We are trying to integrate Promotional Offer in our app, We have a React Native app and are using react-native-iap for handling our in app purchases, as per the documentation we are generating signature in our BE and passing the proper details to the function as well, but for subscription request which have offer applied we are getting the apple pop up properly as well with offer details but when trying to subscribe it gives us SKErrroDomain: 12,
for subscription without applying offer the subscription goes through but when we apply the offer we get the above error.
Our app is currently in Development Stages and has not been sent for review sam for our subscription plans as well.
Please let me know what could be the probable cause for this and help us resolve the issue.
This is the code snippet of ours for the front end :
export const buySubscription = async (subscriptionData: any) => {
try {
if (subscriptionData.offer_id) {
const response = await getSubscriptionSignature(
subscriptionData.productId,
subscriptionData.offer_id,
);
const offerData = response?.data;
const offer = {
identifier: offerData?.offer_id,
keyIdentifier: offerData?.key_id,
nonce: offerData?.nonce,
signature: offerData?.signature,
timestamp: Number(offerData?.timestamp),
};
await requestSubscription({
sku: subscriptionData.productId,
withOffer: offer,
});
} else {
await requestSubscription({ sku: subscriptionData.productId });
}
} catch (err) {
logger.error('Subscription error: ' + JSON.stringify(err));
throw err;
}
};
and
from my python Backend which generates the signature:
def generate_signature(self, product_id: str, offer_id: str) -> dict:
"""
Generate signature for Apple StoreKit promotional offers.
Args:
product_id: The product identifier from App Store Connect
offer_id: The promotional offer identifier
Returns:
dict: Contains signature and required metadata
Reference: https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/implementing_promotional_offers_in_your_app
"""
try:
# Generate UUID without dashes and use as nonce
nonce = str(uuid.uuid4())
timestamp = get_current_time_ms() # milliseconds
# Create the payload string in exact order required by Apple
payload_components = [
self.bundle_id, # App Bundle ID
self.key_id, # Key ID from App Store Connect
product_id, # Product identifier
offer_id, # Promotional offer identifier
nonce, # UUID without dashes
str(timestamp) # Current timestamp in milliseconds
]
payload_str = "\u2063".join(payload_components) # Use Unicode separator
logger.debug(f"Signing payload: {payload_str}")
# Create SHA256 hash of the payload
digest = hashes.Hash(hashes.SHA256())
digest.update(payload_str.encode('utf-8'))
payload_hash = digest.finalize()
# Sign the hash using ES256 (ECDSA with SHA-256)
signature = self.private_key.sign(
data=payload_hash,
signature_algorithm=ec.ECDSA(hashes.SHA256())
)
# Encode signature in base64
signature_b64 = base64.b64encode(signature).decode('utf-8')
logger.info(f"Generated signature for product {product_id} and offer {offer_id}")
return {
"key_id": self.key_id, # Changed to match Apple's naming
"nonce": nonce, # UUID without dashes
"timestamp": timestamp, # As integer
"signature": signature_b64, # Base64 encoded signature
"product_id": product_id, # Changed to match Apple's naming
"offer_id": offer_id # Changed to match Apple's naming
}
except Exception as e:
logger.error(f"Failed to generate signature: {str(e)}")
raise HTTPException(
status_code=500,
detail=f"Failed to generate signature: {str(e)}"
)
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit
App Store Connect
Advanced Commerce API
Hello,
We are an app developer offering subscription-based services, and we want to better understand how Apple determines the consumptionStatus when processing refund requests for in-app subscriptions.
Based on Apple’s documentation on subscription refund requests, we understand that the consumptionStatus value plays a key role in Apple’s refund decision-making process. However, the documentation does not provide a clear guideline on how much usage qualifies as consumptionStatus = 2 (partially used) vs. consumptionStatus = 3 (fully used).
Our key questions:
1. Usage Threshold: Does Apple have a specific percentage of subscription duration (e.g., 20% of the subscription period) that determines whether a subscription is considered “fully used”?
2. Function-Based Usage: Does Apple prioritize certain types of user actions (e.g., unlocking premium content, engaging with subscription features) when evaluating consumptionStatus?
3. Best Practices: Are there recommended best practices to increase the credibility of our consumptionStatus = 3 submission to minimize unjustified refunds?
4. Refund Preference Impact: If we set refundPreference = 2 (deny refund), how much influence does it actually have on Apple’s decision?
We aim to reduce unnecessary refunds while ensuring fairness to our users. Any official guidance or insights from other developers would be greatly appreciated!
Thank you!