RE: unable to edit promotion assets.

45 views
Skip to first unread message
Message has been deleted

Google Ads API Forum Advisor

unread,
Feb 10, 2025, 7:20:41 AM2/10/25
to shahilve...@gmail.com, adwor...@googlegroups.com
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 Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Google Ads API Forum Advisor

unread,
Feb 10, 2025, 7:44:10 AM2/10/25
to adwor...@googlegroups.com, shahilve...@gmail.com
Hi,

Please be informed that I have removed your response from the forums as it contains the PII information.

Going forward, if you face any issues with the Google Ads API, you can send the logs via Reply privately to the author option, or direct private reply to this email.
Reply all
Reply to author
Forward
0 new messages