Strange Google Play Batch IAP API Error

Viewed 119

According to the documentation for the Google Play Developer API, I should be able to batch insert or update requests. However, I’m running into an issue where it appears that either the documentation is wrong, the API is broken, or I’m just missing something.

I’m POSTing to the URL: https://www.googleapis.com/androidpublisher/v2/applications/inappproducts/batch?access_token=<my token here>&autoConvertMissingPrices=true' MyContent-Typeis set to:application/json And the body of myPOST` is the following:

{
    "entrys": [{
        "batchId": "<my batch id>",
        "methodName": "update",
        "inappproductsupdaterequest": {
            "inappproduct": {
                "packageName": "<my package name>",
                "sku": "<my product sku>",
                "status": "active",
                "purchaseType": "managedUser",
                "defaultPrice": {
                    "priceMicros": "<my price>",
                    "currency": "USD"
                },
                "listings": {
                    "en-US": {
                        "title": "<my title> ",
                        "description": "<my description>"
                    }
                },
                "defaultLanguage": "en-US"
            }
        }
    }]
}

When I POST this, I get the following error:

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "required",
                "message": "Required parameter: [entry[0].inappproductsUpdateRequest.package_name]",
                "locationType": "parameter",
                "location": "[entry[0].inappproductsUpdateRequest.package_name]"
            }
        ],
        "code": 400,
        "message": "Required parameter: [entry[0].inappproductsUpdateRequest.package_name]"
    }
}

If I’m reading this correctly, they want the package name parameter as a child element under inappproductsUpdateRequest. However, when I try moving or copying (tried both) "packageName": "<my package name>" as a child under inappproductsUpdateRequest, I get the error:

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "invalid",
                "message": "Unknown field name: packageName",
                "locationType": "other",
                "location": "entrys.inappproductsupdaterequest"
            }
        ],
        "code": 400,
        "message": "Unknown field name: packageName"
    }
}

I get the same error when I try package_name instead of packageName.

Any thoughts?

1 Answers
Related