Match lowest price in same or better condition

This script will change your price to MATCH the lowest offer in SAME OR BETTER CONDITION on Amazon.com, while ignoring your own price. 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 change the price floor from 1.00 in the script below, if desired.

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 = [];
// ignore offers made by me
filters.push(f.seller_id.excludes(FILLZ.SETTINGS.v1.seller_id_for_venue('amazon')));
// consider only offers in same or better condition than item
filters.push(f.condition.same_or_better_than(item.condition));
// filter offers from amazon.com
var offers = FILLZ.SOURCE.AMAZONUS.v2.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