Hi,

I am trying to get Billing Accounts using BudgetOrderService interface.


I logged in with the manger account.  And before creating budget order 
service instance, I set the client customer id in session. what am I doing 
wrong here?

session.setClientCustomerId("xxx-xxx-xxxx");
BudgetOrderServiceInterface bos = adWordsServices.get(session, 
BudgetOrderServiceInterface.class);
BillingAccount accts[] = bos.getBillingAccounts();
System.out.println("accts ==>"+accts); * -- this always returns null*
if (accts != null) {
for (BillingAccount acct : accts) {
System.out.println("billing acct ==>" + acct); 
}
}

But, I am able to read the Budget Orders thru selector

int offset = 0;
 int PAGE_SIZE = 500;

SelectorBuilder selectorBuilder = new SelectorBuilder()
.fields(BudgetOrderField.BillingAccountId, 
BudgetOrderField.BillingAccountName,
BudgetOrderField.BudgetOrderName, BudgetOrderField.Id, 
BudgetOrderField.PoNumber,
BudgetOrderField.PrimaryBillingId, BudgetOrderField.SecondaryBillingId)
.in(BudgetOrderField.BillingAccountName, "Test Billing 
Account").offset(offset).limit(PAGE_SIZE);
BudgetOrderPage page;

do {
page = bos.get(selectorBuilder.build());

if (page.getEntries() != null) {
// Create account tree nodes for each customer.
for (BudgetOrder bo : page.getEntries()) {
System.out.println(bo.getBillingAccountId());
System.out.println(bo.getBillingAccountName());
System.out.println(bo.getBudgetOrderName());
System.out.println("------");
System.out.println(bo.getId());
System.out.println(bo.getPoNumber());
System.out.println(bo.getPrimaryBillingId());
System.out.println(bo.getSecondaryBillingId());
System.out.println(bo.getLastRequest());
System.out.println(bo.getStartDateTime());
System.out.println(bo.getEndDateTime());
System.out.println(bo.getSpendingLimit());
System.out.println(bo.getTotalAdjustments());
}
}
offset += PAGE_SIZE;
selectorBuilder.increaseOffsetBy(PAGE_SIZE);
} while (offset < page.getTotalNumEntries());


Can anyone help me to fix this? If required, I can send the MCC id and 
client customer id.


Suresh

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/91e65e8c-418d-4258-947c-993fb6983360%40googlegroups.com.

Reply via email to