Hi,

Thank you for reaching out to the Google Ads API support team.

The error message is stating that "Both the percent off and money amount off 
fields are set.", which means that you cannot set both values at the same time. 
When you update the resource, looking at your request, I don't see that you're 
clearing out the old value.

I don't see you clearing out the old money amount off you had set. First, I 
would try including the field for the `moneyAmountOff` in the `updateMask` (and 
not include that field in the update request), so that it deletes that field 
from the resource. You can refer to the clearing fields guide for more 
information.

If that still gives you the same error, then I would try clearing the 
`moneyAmountOff` field first, and then sending a second request to update it to 
use `percentOff`. That should solve the error. However, I am providing you the 
sample request and response on how to update the discount type from 
'moneyAmountOff' to 'percentOff':

Request Body: ============== 
POST 
https://googleads.googleapis.com/v18/customers/{customerId}/assets:mutate?key=[YOUR_API_KEY]
 HTTP/1.1

developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "operations": [
    {
      "update": {
        "resourceName": "customers/{customerId}/assets/{assetId}",
        "promotionAsset": {
          "percentOff": 50000
        }
      },
      "updateMask": "promotionAsset.percentOff,promotionAsset.moneyAmountOff"
    }
  ]
}

Response: ============ 
HTTP/1.1 200 
content-encoding: gzip
content-length: 106
content-type: application/json; charset=UTF-8
date: Mon, 10 Feb 2025 11:59:03 GMT
server: ESF
vary: Origin, X-Origin, Referer

{
  "results": [
    {
      "resourceName": "customers/{customerId}/assets/{assetId}"
    }
  ]
}

I hope this helps.

This message is in relation to case "ref:!00D1U01174p.!5004Q02vH11i:ref" 
(ADR-00287674)

Thanks,

Google Ads API Team


Feedback
How was our support today?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/3ZYFp000000000000000000000000000000000000000000000SRGVLI00zRPdimywSr6QM11hYGfxBg%40sfdc.net.
  • Un... Shahil Verma
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to