INVALID_BILLING_ACCOUNT when trying to add budget order to a new managed account

71 views
Skip to first unread message

Eugene Zinin

unread,
Jun 27, 2018, 4:59:10 PM6/27/18
to AdWords API and Google Ads API Forum
I have a managing account with a credit line. I'm creating new managed accounts and add budgets through the service BudgetOrderService. All worked fine but about a month ago I started to get an error:
Request made: Service: BudgetOrderService Method: mutate clientCustomerId: 111111111 URL: https://adwords.google.com/api/adwords/billing/v201806/BudgetOrderService Request ID: 00056f9cb9ada6e00ac103417802ae84 ResponseTime(ms): 77 OperationsCount: 1 IsFault: true FaultMessage: ApiException{applicationExceptionType=ApiException, errors=[BudgetOrderError{apiErrorType=BudgetOrderError, errorString=BudgetOrderError.INVALID_BILLING_ACCOUNT, fieldPath=operations[0].operand, fieldPathElements=[FieldPathElement{field=operations, index=0}, FieldPathElement{field=operand}], reason=INVALID_BILLING_ACCOUNT, trigger=}]}

That's weird because I get billing account just before adding a budget order. Just as documented in Adwords documentation. And it worked. And I still can add a budget order manually through adwords web interface. Also creating a budget order still works for my older managed accounts which already had budget orders.

The code:
val billingAccount = budgetOrderService.getBillingAccounts.head

val budgetOrder = new BudgetOrder
budgetOrder.setBillingAccountId(billingAccount.getId)
budgetOrder.setPrimaryBillingId(billingAccount.getPrimaryBillingId)
budgetOrder.setStartDateTime(Adwords.formatDateTime(DateTime.now.plusMinutes(5)))
budgetOrder.setEndDateTime("20350118 181818 Europe/Moscow")
budgetOrder.setSpendingLimit(new cm.Money(null, balance * 10000))

val op = new BudgetOrderOperation
op.setOperator(Operator.ADD)
op.setOperand(budgetOrder)

val response = budgetOrderService.mutate(Array(op))

Dannison Yao (AdWords API Team)

unread,
Jun 28, 2018, 2:33:28 AM6/28/18
to AdWords API and Google Ads API Forum
Hi Eugene,

The error INVALID_BILLING_ACCOUNT is encountered when the billing account used when creating a BudgetOrder is not a valid one. Could you confirm if the account has been set-up for consolidated billing by executing BudgetOrderService.getBillingAccounts() and confirm if the BillingAccountId is returned ? If not, please refer to this link under “Put an existing account on consolidated billing”  on how to set up your account.

Once this set-up is already done, you can try again your request and let me know if any issues occur.

Regards,
Dannison
AdWords API Team

Eugene Zinin

unread,
Jun 28, 2018, 3:18:36 AM6/28/18
to AdWords API and Google Ads API Forum
Hello,

As you can see in my code, I'm using a billing account just from output of budgetOrderService.getBillingAccounts.

Dannison Yao (AdWords API Team)

unread,
Jun 28, 2018, 5:57:37 AM6/28/18
to AdWords API and Google Ads API Forum
Hi Eugene,

To further investigate this, could you provide your complete SOAP request and response logs that was generated when the error was encountered along with your clientCustomerId via Reply privately to author?

Eugene Zinin

unread,
Jul 6, 2018, 9:46:07 AM7/6/18
to AdWords API and Google Ads API Forum
It turned out that I sent request with another customer id than I thought. It was the problem. It was very helpful to look at the generated SOAP request.

Thank you!
Reply all
Reply to author
Forward
0 new messages