Invalid product ID when attempting mass extend subscription API

Hi there,

I'm having trouble using this API: https://developer.apple.com/documentation/appstoreserverapi/extend_subscription_renewal_dates_for_all_active_subscribers

It is returning a 400 response for all product IDs for my app's subscriptions:

(400, 4000023, 'Invalid request. The product id parameter is invalid.')

I have verified these productIds in the App Store Server UI, and using the App Store Connect API to retrieve the product IDs for all subscriptions in the subscription group.

Any tips would be greatly appreciated!

Answered by in 800024022

Hi,

Can you please check and confirm if your paid application agreement is signed via developer.apple.com?

Thank you

This is the code I'm using (utilising the app-store-server-library python library):

import time
import uuid

import requests

from typing import List, Optional

from appstoreserverlibrary.api_client import AppStoreServerAPIClient, APIException
from appstoreserverlibrary.models.Environment import Environment
from appstoreserverlibrary.models.ExtendReasonCode import ExtendReasonCode
from appstoreserverlibrary.models.MassExtendRenewalDateRequest import MassExtendRenewalDateRequest
from appstoreserverlibrary.models.MassExtendRenewalDateResponse import MassExtendRenewalDateResponse

def renew(key_path: str, key_id: str, bundle_id: str, issuer_id: str, request_identifier: str, product_id: str):
    private_key: bytes = _load_key(key_path)
    environment = Environment.PRODUCTION

    client = AppStoreServerAPIClient(private_key, key_id, issuer_id, bundle_id, environment)

    try:
        renewal_request = MassExtendRenewalDateRequest(extendByDays=90,
                                                       extendReasonCode=ExtendReasonCode.UNDECLARED,
                                                       requestIdentifier=request_identifier,
                                                       productId=product_id,
                                                       storefrontCountryCodes=["GBR", "USA"])
        response: MassExtendRenewalDateResponse = client.extend_renewal_date_for_all_active_subscribers(
            mass_extend_renewal_date_request=renewal_request)
        print(response)
    except APIException as e:
        print(e)

Hi,

Please send us the following via feedback assistant and let me know the ticket ID here:

  1. Timestamp the call was made at
  2. Full request
  3. Full curl response

Thank you

How to File Feedback assistant ticket? https://feedbackassistant.apple.com/

  • Login with your developer account,
  • Choose "iOS & iPadOS”
  • Choose AppStore
  • “Incorrect & Unexpected behavior"
  • Input the issue description and title.
  • Upload attachements
  • Click “Submit”
  • Copy the Ticket ID “FBxxxxxxx” and let us know.

FB14779753

Accepted Answer

Hi,

Can you please check and confirm if your paid application agreement is signed via developer.apple.com?

Thank you

Can you please check and confirm if your paid application agreement is signed via developer.apple.com?

This was the issue, thank you.

Thank you for confirming!

Invalid product ID when attempting mass extend subscription API
 
 
Q