Example match used buy box

If you would like to ONLY match the used buy box and not consider other offers, you can use the script below. This script will change your price to MATCH the USED BUY BOX offer on Amazon.com. If there isn’t a Used Buy Box offer, 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.

Example Code

// match used buy box

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)) );

//match buy box if lower
var source = FILLZ.SOURCE.AMAZONUS.v2;
if (source.buy_box.used) {
  var bb_price = source.buy_box.used.price;
  if (bb_price < price) {
    debug('matching buy box: '+bb_price);
    price = bb_price;
  }
}

//apply price floor
if (price < floor) price = floor;

return price;