Can't remove a budget

65 views
Skip to first unread message

Igor Grigorev

unread,
Mar 5, 2020, 12:35:14 PM3/5/20
to AdWords API and Google Ads API Forum

I'm doing everything as was told at the 
. The code runs smoothly without an error, but I'm getting Budget with status "ENABLED" as a result. It seems like my remove operation didn't make any changes to the Budget.
Here goes the function which I'm using to remove the Budget and SOAP XMLs follow.
def remove_budget(budget_service, budget_id):
'''function to remove budget
we need this because there is a limitation on a number of the budget instances
we are allowed to create'''

# Construct operations to remove budget.

budget = {
'budgetId': budget_id,
'status': 'REMOVED'
}

operations = [{
'operator': 'SET',
'operand': budget

}]

budgets = budget_service.mutate(operations)

return budgets

# Here goes SOAP XML:
[2020-03-05 20:03:01,764 - googleads.soap - INFO] Request made: Service: "BudgetService" Method: "mutate" URL: "https://adwords.google.com/api/adwords/cm/v201809/BudgetService" [2020-03-05 20:03:01,766 - googleads.soap - DEBUG] Outgoing request: {'SOAPAction': '""', 'Content-Type': 'text/xml; charset=utf-8', 'authorization': 'REDACTED'} <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Header> <ns0:RequestHeader xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809"> <ns0:clientCustomerId> ANONYMYZED </ns0:clientCustomerId> <ns0:developerToken>REDACTED</ns0:developerToken> <ns0:userAgent>Zavient (AwApi-Python, googleads/22.0.0, Python/3.7.3, zeep)</ns0:userAgent> <ns0:validateOnly>false</ns0:validateOnly> <ns0:partialFailure>false</ns0:partialFailure> </ns0:RequestHeader> </soap-env:Header> <soap-env:Body> <ns0:mutate xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809"> <ns0:operations> <ns0:operator>SET</ns0:operator> <ns0:operand> <ns0:budgetId>ANONYMYZED</ns0:budgetId> <ns0:status>REMOVED</ns0:status> </ns0:operand> </ns0:operations> </ns0:mutate> </soap-env:Body> </soap-env:Envelope> [2020-03-05 20:03:04,074 - googleads.soap - DEBUG] Incoming response: b'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">\n <soap:Header>\n
<requestId> ANONYMYZED </requestId>\n
<serviceName>BudgetService</serviceName>\n <methodName>mutate</methodName>\n
<operations>1</operations>\n <responseTime>218</responseTime>\n
</ResponseHeader>\n </soap:Header>\n <soap:Body>\n
<rval>\n <ListReturnValue.Type>BudgetReturnValue</ListReturnValue.Type>\n <value>\n
<budgetId> ANONYMYZED </budgetId>\n
<name> ANONYMYZED </name>\n
<amount>\n <ComparableValue.Type>Money</ComparableValue.Type>\n <microAmount>1100000</microAmount>\n </amount>\n
<deliveryMethod>STANDARD</deliveryMethod>\n
<isExplicitlyShared>false</isExplicitlyShared>\n
<status>ENABLED</status>\n </value>\n </rval>\n </mutateResponse>\n </soap:Body>\n</soap:Envelope>\n'

Google Ads API Forum Advisor Prod

unread,
Mar 5, 2020, 3:51:13 PM3/5/20
to scufan...@slingwave.com, adwor...@googlegroups.com
Hi Igor,

Can you please reply privately to author your full SOAP logs which include your client customer ID so I can take a closer look?

Thanks,
Anthony
Google Ads API Team

ref:_00D1U1174p._5001UXUEIn:ref

Franklin Buitron

unread,
Sep 13, 2021, 12:14:37 PM9/13/21
to AdWords API and Google Ads API Forum
Hello.

We are experiencing the same issue:

Sending a SET operation with budgetId and status REMOVED, as the documentation states. But the Budget is not being deleted. We get back the full Budget with status ENABLED.
Updating the Budget in any other way it works, it just doesn't let us REMOVE.

Any updates would be great
Tks

Google Ads API Forum Advisor

unread,
Sep 14, 2021, 11:51:59 AM9/14/21
to fbui...@tangocode.com, adwor...@googlegroups.com
Hello,

Thanks for following up. I recommend trying this operation with the new Ads API, as the attention is shifting to this new API since the AdWords API will sunset next April. You can find guidance on removing budgets in the new Ads API here.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5001UXUEIn:ref
Reply all
Reply to author
Forward
0 new messages