Hi everyone,
I'm trying to add a script which adds and updates prices once a day. Here are the issues I have:
- One of the prices is 0 as it's a trial version. The script throws an error when using withAmount(0.0). Is there a possibility to add a price of 0?
When the price extension is edit manually, the price can be set to 0:
- Is there a possibility to update a price extension? When the script runs, it fetches the new prices and then the price extension should be updated or if not possible removed and a new one should get added.
- The issue with removing and adding a new price extension has the consequence that a new price extension has to be approved. But I didn't see a way to fetch the status of price extension with the script.
In order to always have a approved price extension as long as a new price extension is not approved, I'd need to check the status of all extensions.
Any kind of help and ideas are very welcome.
Here's the part of the script for the free trial product and adding the price extension.
var priceFreeTrial = priceItemBuilder.withHeader('Free trial')
.withDescription('Free Trial available')
//.withAmount(0)
.withCurrencyCode('EUR')
.withUnitType('NONE')
.withFinalUrl('URL_TO_PRODUCT')
.withMobileFinalUrl('URL_TO_PRODUCT')
.build()
.getResult();
var priceBuilder = AdsApp.extensions().newPriceBuilder();
var price = priceBuilder.withPriceType('PRODUCT_CATEGORIES')
.withLanguage('EN')
.addPriceItem(priceFreeTrial)
.build()
.getResult();
Best regards
Peter