this is my working code sample. you need budgetResourceName or budgetId of existing budget to update campaign budget. ($budget_resource_name=ResourceNames::forCampaignBudget($cam_infos['customer_id'], $budgetId);) .......
$budgetResourceName = self::updateCampaignBudget($googleAdsClient, $cam_infos['customer_id'], $cam_infos['campaign_budget'],$cam_infos['budget_resource_name']); ........ private static function updateCampaignBudget(GoogleAdsClient $googleAdsClient, int $customerId,int $campaign_budget,string $budget_resource_name){ // Creates a campaign budget. $budget = new CampaignBudget([ 'resource_name' => $budget_resource_name, //'delivery_method' => BudgetDeliveryMethod::STANDARD, 'amount_micros' => $campaign_budget //'explicitly_shared' => false ]); // Creates a campaign budget operation. $campaignBudgetOperation = new CampaignBudgetOperation(); $campaignBudgetOperation->setUpdate($budget); $campaignBudgetOperation->setUpdateMask(FieldMasks::allSetFieldsOf($budget)); // Issues a mutate request. $campaignBudgetServiceClient = $googleAdsClient->getCampaignBudgetServiceClient(); $response = $campaignBudgetServiceClient->mutateCampaignBudgets( $customerId, [$campaignBudgetOperation] ); /** @var CampaignBudget $addedBudget */ $updatedBudget = $response->getResults()[0]; //printf("Added budget named '%s'%s", $addedBudget->getResourceName(), PHP_EOL); return $updatedBudget->getResourceName(); } On Thursday, April 28, 2022 at 10:43:33 AM UTC+8 adsapi wrote: > Hi Mahir, > > Thank you for raising this concern to the Google Ads API team. > > Moving forward to your concern, it seems that you want to update the > existing budget with the budget id. That said, you can use this > CampaignBudgetService > <https://developers.google.com/google-ads/api/reference/rpc/v10/CampaignBudgetService?hl=en> > which > allows you to manage your campaign budgets with available operations > [create,update,remove]. Unfortunately, the said service is utilizing the > resource > name > <https://developers.google.com/google-ads/api/reference/rpc/v10/CampaignBudget?hl=en#resource_name> > of > the campaign budget instead of the campaign budget ID. > > Regards, > [image: Google Logo] > Carmela > Google Ads API Team > > > ref:_00D1U1174p._5004Q2aNwfX: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 "Google Ads API and AdWords 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/4b3fc26a-d38b-47f9-8a2d-ab830eed641dn%40googlegroups.com.