Do you have an invalid product ID that won’t go away? Good thing the StoreKit API provides error codes and detailed error information explaining why the ID is invalid.
Oh, what’s that? There are no error codes or error details of any kind when you have an invalid product ID, you say? Bah, silly me.
To save you the pain of exhaustively searching the web for the cause of your error, here is a checklist of everything I have stumbled across that can cause an invalid product ID. Make sure you can answer “Yes” to each of these questions:
- Have you enabled In-App Purchases for your App ID?
- Have you checked Cleared for Sale for your product?
- Have you submitted (and optionally rejected) your application binary?
- Does your project’s .plist Bundle ID match your App ID?
- Have you generated and installed a new provisioning profile for the new App ID?
- Have you configured your project to code sign using this new provisioning profile?
- Are you building for iPhone OS 3.0 or above?
- Are you using the full product ID when when making an
SKProductRequest? - Have you waited several hours since adding your product to iTunes Connect?
- Are your bank details active on iTunes Connect? (via Mark)
If you answered “No” to any one of these questions, there’s your problem.
If you answered “Yes” for each of these questions and you still have an invalid product ID, then you have a problem I haven’t seen before. Check out the links in the next section, several of which are Developer Forum posts that were especially helpful in my hunt for debugging invalid product IDs.
Resources for Debugging an Invalid Product
Here are the docs and resources I used to debug invalid product IDs:
- Official In App Purchase Programming Guide
- Official iTunes Connect Developer Guide (In App Purchases starting on page 52)
- Developer Forums – Best thread on debugging in-app purchases
- Developer Forums – Invalid product ID with solution
- Developer Forums – Invalid product ID with solution
- Developer Forums – Invalid product ID with solution
- Developer Forums – “in app purchase invalid” search results
- Apple StoreKit support forums – Invalid product ID with several solutions
If your solution for invalid product IDs wasn’t mentioned in the checklist above, please leave a comment detailing how you fixed the problem so I can keep the checklist up to date.
One more:
Are your bank details active on iTunes Connect?
If you try to create a paid app without valid bank data on your account, you’ll get a nice big warning. But if you create a free app and then add a paid product to it, you’ll get no warning; it will just return your product IDs as invalid.
Ok this list is really helpful, but I just want to add that I was getting the same error, and was unable to get it to work until I used the ProductIDs without the preceding bundle ID.
i.e: when I used com.company.appname.productID, I get an invalid product ID error.
When I use just “productID”, it starts working.
Hope that saves someone some trouble.
A couple of things you might want to remember:
1: Developer Rejected status will cause your productID lookup to fail even though the In-App Purchases have been set to “Cleared for Sale” *and* your productIDs are correct.
2: The only way you are able to use: “productID” vs “com.company.appname.productID” is if you did NOT USE Apple’s suggested domain naming convention of “com.company.appname.productID” . Easiest way to find this is to go to iTunes Connect->Manage Your In-App Purchases and look at the ProductID column. if it looks SOMETHING like: “com.company.appname.productID” then you have to use the entire string.
3: You *must* build for “Distribution” (not debug) *and* have your iPhone Device hooked up *and* build for device…not simulator. This “gets” a lot of people.
Reason #3 is the one that bit me.
I just tested this a few times in a row and it seems that rejecting the binary causes the products response to be empty. However, if it’s left in “Waiting For Review” it works.
Fantastic list. I’ve been struggling for hours, wasn’t till I built my app for distribution that it all worked. Got everything else right. Makes debugging quite hard though!
I tried everything suggested in the Apple forums and here, and still couldn’t get it to work. Found the solution – your app needs to be transferred by Xcode for the sandbox to be enabled.
Obvious, right? Well, if you are working with an update to an existing account, the device will still treat it as an App Store-installed app.
Delete it, then transfer it again. It should work now
Hi!
Another case: If the “Product Name” in your build settings under section “Packaging” does not match the name of the application in iTunes connect it does not work either!
(Another day in my live i will never get back…)
Regards,
Anton
I have created an app for testing in app purchase according to the documentation provided by apple and other sites and ok with everything.
And Each of these questions answer is yes but i m still getting invalid product and enable to recognize reason for the mistake.
* Have you enabled In-App Purchases for your App ID?
* Have you checked Cleared for Sale for your product?
* Have you submitted (and optionally rejected) your application binary?
* Does your project’s .plist Bundle ID match your App ID?
* Have you generated and installed a new provisioning profile for the new App ID?
* Have you configured your project to code sign using this new provisioning profile?
* Are you building for iPhone OS 3.0 or above?
* Are you using the full product ID when when making an SKProductRequest?
* Have you waited several hours since adding your product to iTunes Connect?
* Are your bank details active on iTunes Connect? (via Mark)
can anyone tell me what it can be?
or any help from anyone regard this. I will be very thankful.
one thing which may be the reason is that my bundle id is com.octamac.AppPurchase and product id is com.octamac.AppPurchase.3KT78HR and product name is BookApp.
is this a reason of getting invalid product id?
please help me.
Thanks….
Very enjoyed this! Well done!
Great information! I’ve been looking for something like this for a while now. Thanks!
Have you enabled In-App Purchases for your App ID? Yes
Have you checked Cleared for Sale for your product? It’s Cleared for Sale and Pending Developer Approval
Have you submitted (and optionally rejected) your application binary? My App is now “In Review”
Does your project’s .plist Bundle ID match your App ID? Proviosioning Portal, APP ID: M7572N7T45.com.mobilecom.AAAA. iTunes Connect, Bundle ID: com.mobilecom.AAAA, productID: com.mobilecom.BBBB. Plist file, Bundle ID: com.mobilecom.AAA
Have you generated and installed a new provisioning profile for the new App ID? Absolutely, Distribution Provisioning Profile, btw
Have you configured your project to code sign using this new provisioning profile? Yes
Are you building for iPhone OS 3.0 or above? 3.0 to be precise
Are you using the full product ID when when making an SKProductRequest? Im using the product ID I see in iTunes Connect: com.mobilecom.BBBB
Have you waited several hours since adding your product to iTunes Connect? 24 hours already, should I wait longer?
Are your bank details active on iTunes Connect? I activated the yesterday and a green tick appears since then.
Im building for distribution. The only things that come into my mind is to Approve the InApp Purchase (Ive read that it’s not necessary) or to wait longer than 24 hours since I created the InApp Purchase.
Any other suggestion?
Thanks.
Hi everyone,
I did not find any problem so I decided to ask a friend’s developer license to set up all the thing. It worked at the very first try. The only problem that comes to my mind is that my bank info is not properly configured (although it has the green tick).
Anyway, I can guarantee 100% that is not necessary to Build the app in distribution mode nor upload any binary to iTunes Connect. Trust me, Ive been trying all the suggestions that appear in this post as well as many others.