I'm tring to create a create a new billing setups with an exist payments
account
"""This example removes a billing setup with the specified ID.
To get available billing setups, run get_billing_setups.py.
"""
from __future__ import absolute_import
import argparse
import six
import sys
import os
import google.ads.google_ads.client
os.environ['https_proxy'] = 'https_proxy'
GG_DEVELOP_TOKEN = "GG_DEVELOP_TOKEN"
def main(client, customer_id):
billing_setup_service = client.get_service('BillingSetupService',
version='v2')
# Create billing setup operation.
billing_setup_operation = client.get_type('BillingSetupOperation',
version='v2')
setup = billing_setup_operation.create
payments_accounts_path =
"customers/{}/paymentsAccounts/{}".format(customer_id,
"4124-6783-9026-6241")
setup.payments_account.value = payments_accounts_path
setup.start_time_type = client.get_type("TimeTypeEnum").NOW
print(setup)
try:
billing_setup_response = billing_setup_service.mutate_billing_setup(
customer_id, billing_setup_operation)
print(billing_setup_response)
except google.ads.google_ads.errors.GoogleAdsException as ex:
print(ex)
if __name__ == '__main__':
# GoogleAdsClient will read the google-ads.yaml configuration file in
the
# home directory if none is specified.
credentials_dict_m = {"token_uri":
"https://oauth2.googleapis.com/token", "token": None, "scopes":
["https://www.googleapis.com/auth/adwords",
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/userinfo.email", "openid"], "client_id":
"785323125934-aol074kt589xxxxhenrk4v368sq.apps.googleusercontent.com",
"refresh_token": "1/jqqgxxxsqwe21Q5vKUHwpNCRdKzwDq-zEf8", "client_secret":
"Lxsxdsad1YC0q6Vd7ionYsED"}
credentials_m =
google.oauth2.credentials.Credentials(**credentials_dict_m)
google_ads_client =
google.ads.google_ads.client.GoogleAdsClient(credentials_m,
GG_DEVELOP_TOKEN, login_customer_id='5851848752')
parser = argparse.ArgumentParser(
description=('Removes billing setup for specified customer and
billing '
'setup ID.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()
main(google_ads_client, args.customer_id)
When I run the script I get error like :
Request made: ClientCustomerId: 5851848752, Host:
googleads.googleapis.com:443, Method:
/google.ads.googleads.v2.services.BillingSetupService/MutateB
illingSetup, RequestId:
ns2KIbANISYkRvos_wmF0w, IsFault: True, FaultMessage: The customer is not
eligible to mutate this resource.
(<_Rendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string =
"{"created":"@1568281068.346439745","description":"Error received from peer
ipv4:10.0.0.19:8118","file":"src/core/lib/su
rface/call.cc","file_line":1052,"grpc_message":"Request contains an invalid
argument.","grpc_status":3}"
>, <_Rendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string =
"{"created":"@1568281068.346439745","description":"Error received from peer
ipv4:10.0.0.19:8118","file":"src/core/lib/su
rface/call.cc","file_line":1052,"grpc_message":"Request contains an invalid
argument.","grpc_status":3}"
>, errors {
error_code {
mutate_error: MUTATE_NOT_ALLOWED
}
message: "The customer is not eligible to mutate this resource."
}
, 'ns2KIbANISYkRvos_wmF0w')
Why customer is not eligible to mutate this resource?
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/d4bf12db-5bf2-4d32-b453-7d2092c36afd%40googlegroups.com.