FeedItemService clear a moneyWithCurrencyValue attribute

67 views
Skip to first unread message

Paco Hobi

unread,
Sep 25, 2017, 5:25:56 AM9/25/17
to AdWords API Forum
I'm trying to update the table rows of price extensions, e.g. changing 3 first rows and removing the last 5 rows. Leaving stringValue and stringValues attributes empty works fine for clearing them (headline, description, URLs, etc.), but it doesn't work for moneyWithCurrencyValue attributes (item price).

This a request to clear the stringValue and stringValues attributes, which works as expected.

<?xml version="1.0" encoding="UTF-8"?>
  <SOAP-ENV:Header>
    <tns:RequestHeader>
      <tns:clientCustomerId>578-741-4405</tns:clientCustomerId>
      <tns:developerToken>XXXXXXXXXXXXXXXXXXXXXX</tns:developerToken>
      <tns:userAgent>Webrepublic Googletools/20.1.0 (AwApi-Python, googleads/5.6.0, Python/3.5.2)</tns:userAgent>
      <tns:validateOnly>false</tns:validateOnly>
      <tns:partialFailure>false</tns:partialFailure>
    </tns:RequestHeader>
  </SOAP-ENV:Header>
  <ns1:Body>
    <ns0:mutate>
      <ns0:operations>
        <ns0:operator>SET</ns0:operator>
        <ns0:operand>
          <ns0:feedId>59560008</ns0:feedId>
          <ns0:feedItemId>19849123362</ns0:feedItemId>
          <ns0:attributeValues>
            <ns0:feedAttributeId>5</ns0:feedAttributeId>
            <ns0:stringValue/>
          </ns0:attributeValues>
          <ns0:attributeValues>
            <ns0:feedAttributeId>6</ns0:feedAttributeId>
            <ns0:stringValue/>
          </ns0:attributeValues>
          <ns0:attributeValues>
            <ns0:feedAttributeId>8</ns0:feedAttributeId>
            <ns0:stringValue/>
          </ns0:attributeValues>
          <ns0:attributeValues>
            <ns0:feedAttributeId>9</ns0:feedAttributeId>
            <ns0:stringValues/>
          </ns0:attributeValues>
          <ns0:attributeValues>
            <ns0:feedAttributeId>10</ns0:feedAttributeId>
            <ns0:stringValues/>
          </ns0:attributeValues>
        </ns0:operand>
      </ns0:operations>
    </ns0:mutate>
  </ns1:Body>
</SOAP-ENV:Envelope>


And now an example of a request to empty moneyWithCurrencyValue attributes, which fails:

<?xml version="1.0" encoding="UTF-8"?>
  <SOAP-ENV:Header>
    <tns:RequestHeader>
      <tns:clientCustomerId>578-741-4405</tns:clientCustomerId>
      <tns:developerToken>XXXXXXXXXXXXXXXXXXXXXX</tns:developerToken>
      <tns:userAgent>Webrepublic Googletools/20.1.0 (AwApi-Python, googleads/5.6.0, Python/3.5.2)</tns:userAgent>
      <tns:validateOnly>false</tns:validateOnly>
      <tns:partialFailure>false</tns:partialFailure>
    </tns:RequestHeader>
  </SOAP-ENV:Header>
  <ns1:Body>
    <ns0:mutate>
      <ns0:operations>
        <ns0:operator>SET</ns0:operator>
        <ns0:operand>
          <ns0:feedId>59560008</ns0:feedId>
          <ns0:feedItemId>19849123362</ns0:feedItemId>
          <ns0:attributeValues>
            <ns0:feedAttributeId>7</ns0:feedAttributeId>
            <ns0:moneyWithCurrencyValue/>
          </ns0:attributeValues>
        </ns0:operand>
      </ns0:operations>
    </ns0:mutate>
  </ns1:Body>
</SOAP-ENV:Envelope>


Which returns the following error response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
      <requestId>00055a0016460a310a3728247807d3c1</requestId>
      <serviceName>FeedItemService</serviceName>
      <methodName>mutate</methodName>
      <operations>1</operations>
      <responseTime>174</responseTime>
    </ResponseHeader>
  </soap:Header>
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</faultstring>
      <detail>
        <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201705">
          <message>[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</message>
          <ApplicationException.Type>ApiException</ApplicationException.Type>
          <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="InternalApiError">
            <fieldPath/>
            <trigger/>
            <errorString>InternalApiError.UNEXPECTED_INTERNAL_API_ERROR</errorString>
            <ApiError.Type>InternalApiError</ApiError.Type>
            <reason>UNEXPECTED_INTERNAL_API_ERROR</reason>
          </errors>
        </ApiExceptionFault>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>



Shwetha Vastrad (AdWords API Team)

unread,
Sep 25, 2017, 2:03:25 PM9/25/17
to AdWords API Forum
Hi, 

To clear out the moneyWithCurrencyValue attribute, you need to update the MoneyWithCurrency field to a Money object with microAmountset to 0 as shows below. Please try this out and let me know if it works.

            <operations>
               
<operator>SET</operator>
               
<operand>
                   
<feedId>YOUR_FEED_ID</feedId>
                   
<feedItemId>YOUR_FEED_ITEM_ID</feedItemId>
                   
<attributeValues>
                       
<feedAttributeId>7</feedAttributeId>
                       
<moneyWithCurrencyValue>
                           
<money>
                               
<microAmount>0</microAmount>
                           
</money>
                           
<currencyCode>USD</currencyCode>
                       
</moneyWithCurrencyValue>
                   
</attributeValues>
               
</operand>
           
</operations>

Regards,
Shwetha, AdWords API Team.

Paco Hobi

unread,
Sep 26, 2017, 3:46:08 AM9/26/17
to AdWords API Forum
Hi,

This doesn't seem to work for me. The attributes are not cleared, they are set to CHF 0.00 (I also tried with USD).


Part of the request:

<ns0:attributeValues>
    <ns0:feedAttributeId>25</ns0:feedAttributeId>
    <ns0:moneyWithCurrencyValue>
        <ns0:money>
            <ns0:microAmount>0</ns0:microAmount>
        </ns0:money>
        <ns0:currencyCode>CHF</ns0:currencyCode>
    </ns0:moneyWithCurrencyValue>
</ns0:attributeValues>


Part of the response relevant to this attribute:

<attributeValues>
    <feedAttributeId>25</feedAttributeId>
    <moneyWithCurrencyValue>
        <ComparableValue.Type>MoneyWithCurrency</ComparableValue.Type>
        <money>
            <ComparableValue.Type>Money</ComparableValue.Type>
            <microAmount>0</microAmount>
        </money>
        <currencyCode>CHF</currencyCode>
    </moneyWithCurrencyValue>
</attributeValues>


In the interface I also see the prices set to CHF0.00 and the extension is disapproved (Required field is missing) because all the extension's items I want to clear still have the price set to CHF0.00.



Regards,
Paco

Shwetha Vastrad (AdWords API Team)

unread,
Sep 26, 2017, 2:01:08 PM9/26/17
to AdWords API Forum
Hi, 

I'm afraid its not possible to clear the price of an item in a row. I see that if you clear the other attributes, but not the price, the FeedItem is disapproved. If you want to clear the attribute values for a particular item (say item 8) in a price extension, I would suggest that you create a new FeedItem which doesn't contain these attributes.

Dorian Kind

unread,
Sep 27, 2017, 3:34:35 AM9/27/17
to AdWords API Forum
Hi Shwetha,


"Leave empty to clear an existing PRICE attribute value."

when talking about the "moneyWithCurrencyValue" field.

So is the UNEXPECTED_INTERNAL_API_ERROR a bug that is going to be fixed in a later version, or is the documentation wrong? Also note that creating a new FeedItem and deleting the old one would mean that its competitive metrics are lost, so we'd much prefer to edit the existing one.

Thanks and best regards,
Dorian

Shwetha Vastrad (AdWords API Team)

unread,
Sep 27, 2017, 10:08:46 AM9/27/17
to AdWords API Forum
Hi Dorian, 

Thanks for pointing this out. I tried a couple of things and the following operation successfully cleared the price:

            <operations>
               
<operator>SET</operator>
               
<operand>

                   
<feedId>FeedId</feedId>
                   
<feedItemId>FeedItemId</feedItemId>
                   
<attributeValues>
                       
<feedAttributeId>7</feedAttributeId>
                   
</attributeValues>
               
</operand>
           
</operations>

So, you should not send a null moneyWithCurrencyValue, rather not specify the attribute value to clear it. I apologize for the confusion earlier. I hope this clears things up. 

Dorian Kind

unread,
Sep 27, 2017, 10:29:19 AM9/27/17
to AdWords API Forum
Hi Shwetha,

that works indeed! Thanks a lot for your support!

Best regards,
Dorian
Reply all
Reply to author
Forward
0 new messages