Always returning status 21004

In sandbox envirnoment, after making an auto-renewing subscription, all calls to: https://sandbox.itunes.apple.com/verifyReceipt Always returns:

{

environment = Sandbox;

status = 21004;

}

This error is meant to mean that the password sent with the request in wrong.

I am sending both the "receipt-data", and the "password". And I have checked a million times that the "password" matches the shared secret in iTunes Connect.

This same call works fine when validating a receipt before an anto-renewing subscription has been purchased.

So I am just wondering if this is a current issue on Apple's end, and if anyone else is experiencing the same problem?

Accepted Reply

I was just informed that this problem has been fixed. I then used a sample receipt provided in a recent bug report, and the receipt validated in the sandbox and presented the info on the auto-renewing subscriptions


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

Replies

Hello, I'm having exact same issue. Tried to regenerate shared secred couple of times, still getting the error.

  • I added the apple password and it worked { "password": "3XXXXXXXXXXXXXXX80", "exclude-old-transactions": false, "receipt-data": "MIIVtgYJKoZIhvcNAQcCoIIVpzCCFaMCAQExCzAJBgUrDgMCGgUAMIIFVwYJKoZIhvcNAQcBoIIFSASCBUQxggVAMAoCARQCAQEEAgwAMAsCAQMCAQEEAwwBMTALAgETAgEBBAMMATEwCwIBGQIBAQQDAgEDMAwCAQoCAQEEBBYCNCswDAIBDgIBAQQEAgIAyzANAgENAgEBBAUCAwJLHTAOAgEBAgEBBAYCBF1sGwIwDgIBCQIBAQQGAgRQMjU2MA4CAQsCAQEEBgIEB0WyCTAOAgEQAgEBBAYCBD....."

    ( remember to remove the == at the end of the receipt

Add a Comment

Question - does it work if you don't send the shared secret?

Are you sending a transaction.transactionReceipt or a [[NSBundle mainBundle] appStoreReceiptURL] receipt?

Yes I am sending the [[NSBundle mainBundle] appStoreReceiptURL] receipt.

And it works fine before a sandbox user has purchased an auto-renewing subscription, for example a consumable product. I assue this is because the "password" field is not needed for a regular IAP. But as soon as I purchase a subscription it returns status 21004, even with the correct shared secret in the "password" field. I have tried this on one of my other iTunesConnect accounts, and it has the exact same problem. Also tried regenerating the shared secret, and new sandbox user accounts. Aslo tried validating the receipt from the client and from my server, check the sent request in Fiddler, and it is definitely sending the correct shared secret in the password field of the JSON object.

Hi Guys,


Anyone has any success with this ? Having an exact the same issue. When I validated receipt for sandbox user with buying autorenewable subscription I forgot to add "password" with shared secret and got 21004, but then when I added "password" still got 21004 error. From that point even when validating simple consumable product receipts, I keep getting 21004 error. Is this somehow connected with apple's february 22nd itunesconnect maintainance ?


Cheers

This sounds like a bug report issue to be investigated by the iTunes Store Server engineering team. Not sure what all is needed, so I propose that you follow these steps. I've submitted a request to my contacts in the iTunes Store Server enginnering to ask whether this is a known issue. In the meantime bug reports can't hurt.


Please use the Apple Developer Bug Report web page - http:/

After logging in, select the iTunesConnect Product.

Fill out the bug report form.


Include the applicationID


Also include the 'shared-secret in the bug report as well as a base64 encoded receipt as a text file, or in the bug report itself. Actually it will help if you can set up a curl command to demonstrate the problem in the terminal app


yyyy - the shared secret (if there is no auto-renewing subscription item in the receipt, you can delete “password”:”yyyy” as a parameter.

xxxx - the base64 encoded receipt content

curl -d ‘{ “password”:”yyyy” “receipt-data”: “xxxx”}’ https:/sandbox.itunes.apple.com/verifyReceipt


Please send me the bug report numbers - rkubota@apple.com and I will see that they get assigned to the correct team for investigation.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

Hi Rich,


I have submitted a bug report, number: 30653899


Thanks for your help

Thanks ItchyBlar and Rich. Hope we will get some results soon enough 🙂

Are you able to solve the issue? I have the same problem 😟

I am also having the same issue.


Please let me know when its getting solved.


Thanks

Hi,


To update. I have received and email from Rich saying that the problem 30653899 is being investigated now. Waiting for new updates from Rich.


Cheers

Armen

Add me to the list too. And here I thought it was just me.😉

Same here

Same for me.


I always get 21004 even with the good password.

Please, Apple, it's very urgent.


Can you check why in the Sandbox :


- You check a Consumable product : it's OK

- You check a Auto Renewable Subscription Product with the RIGHT shared secret : it fail with 21004

- All nex Consumable product receipt checked after this are 21004, even if they are NOT AutoRenewable Subscription.


I tried with many fresh clear Sandbox test users, and it is the same


This thread , as we talk about Apple, a quite big company, should be addressed in hours, not in days


Please give us an ANSWER


Thanks

Having same issue today, Receipt validation stop working after shared secret was updated, always received 21004 instead.