Update promotion type/details with API for PromotionExtension

47 views
Skip to first unread message

wtemm...@cyberpublicity.com

unread,
Apr 19, 2018, 8:37:20 AM4/19/18
to AdWords API Forum
Hi everyone,

I have a little issue with the API, to update a PromotionExtension (Operator SET)
In Adwords I have a PromotionExtension, with a percent discount. And It's impossible to update this feedItem, and change it to monetary discount.

Operation 0 - FAILURE:
operation={
    'xsi_type': 'CustomerExtensionSettingOperation',
    'operand': {
        'extensionSetting': {
            'extensions': [
                {
                    'xsi_type': 'PromotionFeedItem',
                    'discountModifier': 'UP_TO',
                    'promotionTarget': 'Test de promotion',
                    'language': 'EN',
                    'moneyAmountOff': {
                        'money': {
                            'microAmount': 115000000
                        },
                        'currencyCode': 'CAD'
                    },
                    'promotionCode': 'B152Q',
                    'promotionEnd': '20180606 000000',
                    'occasion': 'VALENTINES_DAY',
                    'finalUrls': {
                        'urls': ['https://httpstat.us/200']
                    },
                    'feedItemId': 35607278998,
                    'promotionStart': '20180101 000000'
                }
            ]
        },
        'extensionType': 'PROMOTION'
    },
    'operator': 'SET'
}

errorType=ExtensionSettingError
trigger=None
errorString=ExtensionSettingError.PROMOTION_CANNOT_SET_PERCENT_OFF_AND_MONEY_AMOUNT_OFF
fieldPath=operations[0].operand.extensionSetting.extensions[0].moneyAmountOff
reason=PROMOTION_CANNOT_SET_PERCENT_OFF_AND_MONEY_AMOUNT_OFF

This what I send to update, and the error return by the API.
My question is : 

- Is it normal ? because by the UI of Adwords Beta, it's possible to update the promotion type.
- Did I forgot something to send to the API ? (I tried to send the key 'percentOff' with None value)

I have the same problem with Promotion Code to On overs order 

Thanks for your help

Dhanya Sundararaju (AdWords API Team)

unread,
Apr 19, 2018, 3:50:22 PM4/19/18
to AdWords API Forum
Hi,

The error that you receive:ExtensionSettingError.PROMOTION_CANNOT_SET_PERCENT_OFF_AND_MONEY_AMOUNT_OFF is because you will need to assign a value of -1 for field:percentOff when you set a value for field:moneyAmountOff. Similarly, when you set a value for field:ordersOverAmount, you will need to assign a value of '' to field:promotionCode. Please refer attachment:SOAP.xml for a sample SOAP request and let me know if you have any further questions.

Regards,
Dhanya, AdWords API Team
SOAP.xml

wtemm...@cyberpublicity.com

unread,
Apr 19, 2018, 4:55:31 PM4/19/18
to AdWords API Forum
Alright,

And in the reverse case, if I want to set a field:percentOff, what should I set set for field:moneyAmountOff; becaise this field is more complex. (money, microAmount, currencyCode) ?

wtemm...@cyberpublicity.com

unread,
Apr 19, 2018, 4:57:29 PM4/19/18
to AdWords API Forum
I found the answer. Just set -1 to field:microAmount and don't pass any currencyCode.

Thanks for your help
Reply all
Reply to author
Forward
0 new messages