Adwords API Budget Error NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT

36 views
Skip to first unread message

Ronak Shah

unread,
Jan 15, 2019, 8:12:14 AM1/15/19
to AdWords API and Google Ads API Forum
Hello,

We are trying to set the daily budget via Adwords API but api call is getting failed.

Here are below Details

$daily_budget = 33.51;
$micro_amount = (float) ($daily_budget  * 1000000);

so if we convert to micro amount it becomes (33.51 * 1000000) = 33510000

But API throws error [BudgetError.NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT @ operations[0].operand.amount].We also type casted to float but still gives same problem.Please check below Money object.

object(Google\AdsApi\AdWords\v201809\cm\Money)#790 (3) {

  ["microAmount":protected]=>

  float(33510000)

  ["ComparableValueType":protected]=>

  NULL

  ["parameterMap":"Google\AdsApi\AdWords\v201809\cm\ComparableValue":private]=>

  array(1) {

    ["ComparableValue.Type"]=>

    string(19) "ComparableValueType"

  }

}


We are using PHP client library v201809 and PHP version 7

Please check

Thanks,
Ronak

googleadsapi...@google.com

unread,
Jan 15, 2019, 2:47:45 PM1/15/19
to AdWords API and Google Ads API Forum
Hello Ronak,

I was able to add the same value in my testing and it worked. Could you please share the SOAP logs(request and response) of the operation you are performing without redacting any information to see if everything is okay? You could follow the instruction shown in this guide to enable logging. You could use reply privately to the author option while sharing the information requested.

Regards,
Sai Teja, AdWords API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/f0abd617-d72f-4099-81c9-9d91b4a76e9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ronak Shah

unread,
Jan 17, 2019, 7:19:13 AM1/17/19
to AdWords API and Google Ads API Forum
Hello Sai Teja,

This issue has been fixed.So the scenario is the PHP version on our server is 64 bit and for 64 bit system its better to convert the amount to string as mentioned here

//$micro_amount = floatval($daily_budget * 1000000); // creates Error
$micro_amount =number_format($daily_budget * 1000000, 0,'.',''); // Fixes issue

I hope this would be helpful to others who come across this issue.

Thanks,
Ronak

googleadsapi...@google.com

unread,
Jan 17, 2019, 1:27:58 PM1/17/19
to AdWords API and Google Ads API Forum
Hello Ronak,

Glad that the problem is resolved. Thanks for sharing your solution. It would be helpful for others facing similar issues.

Regards,
Sai Teja, AdWords API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages