Match lowest price using specific market data

This script will change your price to MATCH the lowest offer in ANY CONDITION, with a % positive rating AT OR ABOVE 90%, using Specific Pricing Data, while ignoring your own Amazon prices. If there isn’t competition, the script will use your Base Price. This script applies a price floor of Cost or $1, whichever is greater.

You can also change the price floor from 1.00, the % rating from 90 in the script below, if desired.

You will need to edit the marketplaces and data sources in red below.

var item = FILLZ.ITEM.v1;
var f = FILLZ.FILTERS.v1;

// default price
var price = item.base_price;
// price floor
var floor = Math.max(item.cost, 1.00);

 // competition filters
 var filters = [];
 // consider only offers with rating >= 90%
 filters.push(f.rating.greater_than_or_equal(90));
 // ignore offers made by me: this only works for amazon marketplaces
 filters.push(f.seller_id.excludes(FILLZ.SETTINGS.v1.seller_id_for_venue('amazon')));
 filters.push(f.seller_id.excludes(FILLZ.SETTINGS.v1.seller_id_for_venue('amazonca')));
 filters.push(f.seller_id.excludes(FILLZ.SETTINGS.v1.seller_id_for_venue('amazonuk')));
 filters.push(f.seller_id.excludes(FILLZ.SETTINGS.v1.seller_id_for_venue('amazonde')));
 filters.push(f.seller_id.excludes(FILLZ.SETTINGS.v1.seller_id_for_venue('amazonfr')));
 // map venues to sources
 var sources = {
   'abebooks': FILLZ.SOURCE.ABEBOOKS.v1,
   'amazon':   FILLZ.SOURCE.AMAZONUS.v2,
   'amazonca': FILLZ.SOURCE.AMAZONCA.v2,
   'amazonuk': FILLZ.SOURCE.AMAZONUK.v2,
   'amazonde': FILLZ.SOURCE.AMAZONDE.v2,
   'amazonfr': FILLZ.SOURCE.AMAZONFR.v2,
   'valore':   FILLZ.SOURCE.AMAZONUS.v2,
 };
 var source = sources[FILLZ.venue];
 // filter offers from source chosen above
 var offers = source.offers(filters);

 // match if competitors exist after filtering
 var lowest = offers.lowest_price_offer();
 if (lowest) {
   debug('matching lowest price: '+lowest);
   price = lowest.price;
 }

 //apply price floor
 if (price < floor) price = floor;
 return price;
Have more questions? Submit a request