[Google Ads API] Add account budget - Resource not found

78 views
Skip to first unread message

Kasper Aamodt

unread,
Aug 18, 2020, 3:21:53 AM8/18/20
to AdWords API and Google Ads API Forum
Hi,

I'm trying to add a budget to an account. I'm using the add_account_budget_proposal example. 

This is the error message and log:

[2020-08-18 09:15:35,440 - INFO] Request
-------
Method: /google.ads.googleads.v4.services.AccountBudgetProposalService/MutateAccountBudgetProposal
Headers: {
  "developer-token": "REDACTED",
  "login-customer-id": "xxxxxxxxxx",
  "x-goog-api-client": "gl-python/3.8.5 grpc/1.31.0 gax/1.22.1 gapic/6.0.0",
  "x-goog-request-params": "customer_id=xxxxxxxxxx"
}
Request: customer_id: "xxxxxxxxxx"
operation {
  create {
    billing_setup {
      value: "customers/xxxxxxxxxx/billingSetups/xxxxxxxxxxxxxxxx"
    }
    proposal_type: CREATE
    proposed_name {
      value: "Account Budget Proposal (example)"
    }
    proposed_start_time_type: NOW
    proposed_end_time_type: FOREVER
    proposed_spending_limit_micros {
      value: 1000000
    }
  }
}


Response
-------
Headers: {
  "google.ads.googleads.v4.errors.googleadsfailure-bin": "\nG\n\u00028\u0003\u0012\u0017Resource was not found.\"(\u0012\u000b\n\toperation\u0012\b\n\u0006create\u0012\u000f\n\rbilling_setup",
  "grpc-status-details-bin": "\b\u0003\u0012%Request contains an invalid argument.\u001a\u0001\nCtype.googleapis.com/google.ads.googleads.v4.errors.GoogleAdsFailure\u0012I\nG\n\u00028\u0003\u0012\u0017Resource was not found.\"(\u0012\u000b\n\toperation\u0012\b\n\u0006create\u0012\u000f\n\rbilling_setup",
  "request-id": "rBUXCldjFfi41xHtznIVgw"
}
Fault: errors {
  error_code {
    mutate_error: RESOURCE_NOT_FOUND
  }
  message: "Resource was not found."
  location {
    field_path_elements {
      field_name: "operation"
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "billing_setup"
    }
  }
}


[2020-08-18 09:15:35,440 - WARNING] Request made: ClientCustomerId: xxxxxxxxxx, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v4.services.AccountBudgetProposalService/MutateAccountBudgetProposal, RequestId: rBUXCldjFfi41xHtznIVgw, IsFault: True, FaultMessage: Resource was not found.

Thanks
Kasper

Kasper Aamodt

unread,
Aug 18, 2020, 3:44:06 AM8/18/20
to AdWords API and Google Ads API Forum
I think i know why it does not work. It's probably because it is a new account, so it does not have a payment profile connected to the account yet. So now my question is, how do i connect new customer accounts with our default payment profile, thrugh the API?

Kasper Aamodt

unread,
Aug 18, 2020, 5:11:33 AM8/18/20
to AdWords API and Google Ads API Forum
And another question, is it possible to set the start and end date for budgets with the  add_account_budget_proposal ? 

Google Ads API Forum Advisor Prod

unread,
Aug 18, 2020, 1:30:57 PM8/18/20
to kasper...@mintmedia.as, adwor...@googlegroups.com
Hi Kasper,

Yes, it is possible that you are getting the RESOURCE_NOT_FOUND error because you do not have a payment profile connected to your customer account. Please create one and try your request again.

Below are my responses to your questions:

How do I connect new customer accounts with our default payment profile, through the API?
  • To connect your new customer account to a payment profile via API, you can follow this guide. 
Is it possible to set the start and end date for budgets with the add_account_budget_proposal? 
  • Yes, it is possible to set the start and end date for budgets by specifying the proposed_start_date_time and proposed_end_date_time. Please note that the format of these fields should be like the following example: 2021-01-02 03:04:05
Let me know if you have any additional questions or encounter any other issues. 

Regards,
Danica, Google Ads API Team

ref:_00D1U1174p._5004Q23L35f:ref

Kasper Aamodt

unread,
Aug 18, 2020, 5:19:39 PM8/18/20
to AdWords API and Google Ads API Forum
Hi, thank you! 

I know that that is possible, but that would mean that i have to change the code for every new budget we make. Is it possible to set start and end time with the input method? Something like this, or another way:

start_time = input("Start time (yyyy-MM-dd HH:mm:ss): ")

proposal.proposed_end_date_time = str(start_time)

Kasper Aamodt

unread,
Aug 18, 2020, 5:47:06 PM8/18/20
to AdWords API and Google Ads API Forum
And do you have a python example of adding an existing payment profile to a customer? I'm pretty new when it comes to this, so I'm relying heavily on the code examples.

Google Ads API Forum Advisor Prod

unread,
Aug 19, 2020, 3:59:40 PM8/19/20
to kasper...@mintmedia.as, adwor...@googlegroups.com
Hi Kasper,

I believe the only method of inputting the start and end time is by setting them in the code each time you make a new budget as shown in the sample I provided in my last response. 

As for Python samples for billing, you can refer here under the "Billing" section under "Code Samples." 
Reply all
Reply to author
Forward
0 new messages