Re: [Google Ads API] Adding account billing setup using existing paymentAccountId

2020-01-13 Thread Google Ads API Forum Advisor Prod
Hi Alok,

I was able to reproduce your error on my end. It appears to be an issue with 
the client library. Please post an issue on the GitHub page here and let them 
know that it should be updated so that the resource is expecting the payments 
account ID without dashes.

In the meantime, if this issue is urgent, you will have to hard-code the dashes 
into the StringValue before passing it to the PaymentsAccount resource or use 
the AdWords API instead.

Regards,
Mitchell
Google Ads API Team
ref:_00D1U1174p._5001USw5MD:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0Pg-E0Q41X9V00Vqf_R4EpQ-GeJe2Nc2suCw%40sfdc.net.


Re: [Google Ads API] Adding account billing setup using existing paymentAccountId

2020-01-13 Thread alok
 Hi Mitchell,

As I mentioned above, I am trying to use an EXISTING paymentAccountID which 
is in --- format. According to billingsetup 

 
document, I should be setting payments_account and not payment_account_info 
as payment_account_info is used to signup with new payments accounts.

payments_account (StringValue) 

 

The resource name of the payments account associated with this billing 
setup. Payments resource names have the form:

customers/{customer_id}/paymentsAccounts/{payments_account_id} * When 
setting up billing, this is used to signup with an existing payments 
account (and then payments_account_info should not be set). * When getting 
a billing setup, this and payments_account_info will be populated.

payments_account_info (PaymentsAccountInfo) 

 

The payments account information associated with this billing setup. *When 
setting up billing, this is used to signup with a new payments account (and 
then payments_account should not be set).* When getting a billing setup, 
this and payments_account will be populated. 


*Approach 1)* Now assuming, I have to use payments_account resource name 
(as I am using existing payments_account), *the java client doesn't support* 
ResourceNames.paymentsAccount(long custonerID,*String payment_accountId*) 
but only supports ResourceNames.paymentsAccount(long customerId,*long 
payment_accountId*)



BillingSetup billingSetup = BillingSetup.newBuilder()
// BUG: Google Ads api accepts only long PaymentsAccountId 
while
// creating ResourceNames.paymentsAccount, but requires 
String
// in format "---"

.setPaymentsAccount(StringValue.of(ResourceNames.paymentsAccount(anAccountID, 
Long.valueOf(aBilling.getPaymentsAccountId()

*Approach 2)* lets try the approach of setting payment_accountInfo, it 
throws error message INVALID_PAYMENTS_ACCOUNT as payments_account_name is 
mandatory to set, which I don't want to overwrite as I am using existing 
payment_accountId which already has a predefined name which I might have 
access to. *If I go ahead and set a payments_account_name in below request, 
the request is successful but It creates a new payment_accountId which 
obviously I don't want, as whole intention is to use same payment_accountId* 

Request
---
MethodName: 
google.ads.googleads.v2.services.BillingSetupService/MutateBillingSetup
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=a, 
x-goog-api-client=gl-java/1.8.0_201 gapic/ gax/1.45.0 grpc/1.21.0}
Body: customer_id: "bb"
operation {
  create {
start_time_type: NOW
payments_account_info {
  payments_account_id {
value: "---"
  }
  payments_profile_id {
value: "--"
  }
}
end_time_type: FOREVER
  }
}


Response

Headers: 
Metadata(content-type=application/grpc,request-id=H8OHfex_fwh3PV-IQQvyUw,date=Mon,
 
13 Jan 2020 10:03:59 GMT,alt-svc=quic=":443"; ma=2592000; 
v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; 
ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; 
ma=2592000,h3-Q043=":443"; ma=2592000)
Body: null
Failure message: errors {
  error_code {
billing_setup_error: INVALID_PAYMENTS_ACCOUNT
  }
  message: "The requested payments account needs either a correctly 
formatted id (---), or a non-blank name."
  location {
field_path_elements {
  field_name: "operation"
}
field_path_elements {
  field_name: "create"
}
field_path_elements {
  field_name: "payments_account_info"
}
field_path_elements {
  field_name: "payments_account_name"
}
  }
}

Any pointers would be nice??

Thanks,

Alok


On Saturday, January 11, 2020 at 3:30:44 AM UTC+5:30, adsapiforumadvisor 
wrote:
>
> Hi Alok,
>
> Thank you for reaching out. Adding the payments_account to BillingSetup 
> 
>  
> requires the payments_account_id from PaymentsAccountInfo 
> .
>  
> As you can see, this value is a string and must be passed with dashes. 
> Therefore, you need to pass the Id as a string with dashes and the error 
> message is correct.
>
> Regards,
> Mitchell
> Google Ads API Team
>
> ref:_00D1U1174p._5001USw5MD:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/

RE: [Google Ads API] Adding account billing setup using existing paymentAccountId

2020-01-10 Thread Google Ads API Forum Advisor Prod
Hi Alok,

Thank you for reaching out. Adding the payments_account to BillingSetup 
requires the payments_account_id from PaymentsAccountInfo. As you can see, this 
value is a string and must be passed with dashes. Therefore, you need to pass 
the Id as a string with dashes and the error message is correct.

Regards,
Mitchell
Google Ads API Team
ref:_00D1U1174p._5001USw5MD:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/CzvTq0Q3WVSP009ZIDQVsGS924vGgyxF0jbA%40sfdc.net.


[Google Ads API] Adding account billing setup using existing paymentAccountId

2020-01-10 Thread alok
Hi,

I am trying to add account billing by calling BillingSetupService using an 
existing paymentAccountId which is in format . But it 
throws invalid format as expected format is --- (dashes are 
required as opposed to adwords api).
Trouble is looks like there is a bug in Google ads java client library as 
it expects payment account resource name with long paymentAccountId

BillingSetup billingSetup = BillingSetup.newBuilder()
// BUG: Google Ads api accepts only long PaymentsAccountId 
while
// creating ResourceNames.paymentsAccount, but requires 
String
// in format "---"

.setPaymentsAccount(StringValue.of(ResourceNames.paymentsAccount(anAccountID, 
Long.valueOf(aBilling.getPaymentsAccountId()

Below is my request and response while adding the billingsetup. Can you 
please confirm if above steps are correct and this is indeed a bug?? or is 
there any other way of getting this work?

Request
---
MethodName: 
google.ads.googleads.v2.services.BillingSetupService/MutateBillingSetup
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=aaa, 
x-goog-api-client=gl-java/1.8.0_201 gapic/ gax/1.45.0 grpc/1.21.0}
Body: customer_id: "b"
operation {
  create {
start_time_type: NOW
payments_account {
  value: "customers/b/paymentsAccounts/"
}
end_time_type: FOREVER
  }
}


Response

Headers: 
Metadata(content-type=application/grpc,request-id=hM4Hr0B0AlzCIMLI1qlSsg,date=Fri,
 
10 Jan 2020 14:49:07 GMT,alt-svc=quic=":443"; ma=2592000; 
v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; 
ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; 
ma=2592000,h3-Q043=":443"; ma=2592000)
Body: null
Failure message: errors {
  error_code {
billing_setup_error: INVALID_PAYMENTS_ACCOUNT
  }
  message: "The requested payments account needs either a correctly 
formatted id (---), or a non-blank name."
}

Thanks,
Alok

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a0b1cdf9-f77c-4e05-b6ff-e6490005d64d%40googlegroups.com.