get invoice error

66 views
Skip to first unread message

Flavio Rinaldi

unread,
May 19, 2021, 6:33:51 AM5/19/21
to AdWords API and Google Ads API Forum

What versions of the client library and Google Ads API are you using?

Client Library : Google Ads API Client Library for PHP v9.0.0
Google Ads API V7

What environment are you using?
PHP 7.3
Debian 10
gRPC

Actions taken

Just run the getInvoice example with this command:

php7.3 GetInvoices.php --customerId=XXXXX --billingSetupId=YYYYYY

Expected result
All the invoices related to the account.

Actual result

Method Name: /google.ads.googleads.v7.services.InvoiceService/ListInvoices Host: googleads.googleapis.com Headers: { "x-goog-api-client": "gl-php\/7.3.28-1+0~20210503.84+debian10~1.gbp6819da gapic\/ gax\/1.7.1 grpc\/1.37.1", "x-goog-request-params": "customer_id=XXXXX", "developer-token": "REDACTED", "login-customer-id": "XXXXXXX" } Request: {"customerId":"XXXXXXXXX","billingSetup":"customers\/XXXXXXXXXXXX\/billingSetups\/XXXXXXXXXXXXXXX","issueYear":"2021","issueMonth":"APRIL"} Response ------- Headers: { "request-id": "25Y0Ww7141tqWpHB_-vbpA", "date": "Tue, 18 May 2021 13:30:23 GMT", "alt-svc": "h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" } Fault ------- Status code: 13 Details: Internal error encountered. Failure: {"errors":[{"errorCode":{"internalError":"INTERNAL_ERROR"},"message":"An internal error has occurred."}],"requestId":"25Y0Ww7141tqWpHB_-vbpA"} Request with ID '25Y0Ww7141tqWpHB_-vbpA' has failed. Google Ads failure details: internal_error: An internal error has occurred.

Google Ads API Forum Advisor Prod

unread,
May 19, 2021, 12:23:21 PM5/19/21
to flavio...@gmail.com, adwor...@googlegroups.com
Hello,

We will take a closer look at this request and let you know why you are facing these errors.

Regards,
Anthony

Google Logo
Anthony
Google Ads API Team
 


ref:_00D1U1174p._5004Q2HC2mQ:ref

Google Ads API Forum Advisor Prod

unread,
May 19, 2021, 7:27:31 PM5/19/21
to flavio...@gmail.com, adwor...@googlegroups.com
Greetings!

Thank you for providing that request ID. It makes it so much faster for me to look up the whole request on our servers. The login-customer-id you specified is correctly a manager account ID. I see the customer_id was also set to a manager account ID. For this particular request, I believe the customer_id needs to be a client customer ID that is serving campaigns so you can get the invoice for that one account. Please give that a try of setting the customer_id to a serving client customer ID in that same hierarchy. If you have further issues with that after changing it, feel free to get back to me.

As for the error being vague, I've filed an issue that in a future version we should return a clearer error to tell you what's going on. Thanks for that feedback!

Cheers,
Nadine Wang, Google Ads API Team

ref:_00D1U1174p._5004Q2HC2mQ:ref

Flavio Rinaldi

unread,
May 20, 2021, 4:16:22 AM5/20/21
to AdWords API and Google Ads API Forum
we need the monthly invoice with multiple customer account

Google Ads API Forum Advisor Prod

unread,
May 20, 2021, 10:30:34 AM5/20/21
to flavio...@gmail.com, adwor...@googlegroups.com
Hello,

I took another look at your configuration. This is what you specifically need to do. 
  • You want the login-customer-id to be the paying manager. In your case, I believe that this was the customer_id that you set.
  • You want the customer_id to be the Google Ads client account that's serving.
  • You then iterate through all your Google Ads client accounts under your paying manager and retrieve the invoice for each client account. As far as I know, from the API there isn't a roll-up invoice at the manager account level.
If you need specific IDs from me, feel free to ask, and I can give you the exact IDs for your particular case offline so it's not on the forum. I'll update our Invoices guide (https://developers.google.com/google-ads/api/docs/billing/invoice) to make it more clear.

Cheers,
Nadine, Google Ads API Team

ref:_00D1U1174p._5004Q2HC2mQ:ref
Reply all
Reply to author
Forward
0 new messages