Googleplay purchases.products.acknowledge return 400 not a valid state and 409 cocurrentUpdate

Viewed 931

We try to do acknowledge google play purchase on the server-side through purchases.products.acknowledge with golang

However, the following errors come up sometime

googleapi: Error 409: The operation could not be performed since the object was 
already in the process of being updated., concurrentUpdate
googleapi: Error 400: The purchase is not in a valid state to perform the desired operation

Is there anything am I missing? or how to solve those errors?

2 Answers

Per google support

  • For error 400, the purchaseState must be Purchased or 0 before you can acknowledge the purchase. For more information, please refer to this page: https://developer.android.com/google/play/billing/integrate#process

    Error 400 can also mean that you already acknowledged the purchase.

  • For error 409, this means you are acknowledging the purchase multiple times concurrently. Unfortunately, we don't provide support for API concurrency issues.

Currently having this exactly issue, did you manage to resolve it in the end.

Acknowledgement Request Response:  {
  error: {
    code: 409,
    message: 'The operation could not be performed since the object was already in the process of being updated.',
    errors: [ [Object] ]
  }
}

I'm only sending it once, after i have validated and added to my database. I'm not sure why its happening.

EDIT: I had a theory my code was executing to fast and maybe the order was still pending, so i added a 10 second gap between getting purchase token and then trying to acknowledge once again. Im now getting the following.

Acknowledgement Request Response:  {
  error: {
    code: 400,
    message: 'The purchase is not in a valid state to perform the desired operation.',
    errors: [ [Object] ]
  }
}

However at this time in Google Play Console, the state is Chargeable, meaning it just needs to be acknowledged.

Related