Example beat landed price by 1%

This script will change your price to BEAT the lowest LANDED PRICE offer (Item Price + shipping) with a % positive rating AT OR ABOVE 90%, in ANY CONDITION on Amazon.com by 1%, 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. The script will use shipping amount defaults based on item type, if there is no default the shipping amount will be 0.00. For example, if the lowest landed price of a competitive seller on Amazon.com was $15 ($10 item price and $5 shipping price and discount of 1%) and the default shipping amount was $3.99, the script will set the price of your item to $10.86. You can also change the price floor from ((1.00)), the % rating from (((90))), and the multiplier from ((((((0.99)))))) in the script below, if desired.

Example Code

// beat landed price by 1 percent

var item = FILLZ.ITEM.v1;
var f = FILLZ.FILTERS.v1;
var util = FILLZ.UTIL.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
// filter offers from amazon.com
var offers = FILLZ.SOURCE.AMAZONUS.v2.offers(filters);

//determine my shipping amount
var shipping = util.shipping_by_type(item.type, 0);
if (item.is_fba) shipping = 0;

// beat if competitors exist after filtering (landed price)
var lowest = offers.lowest_total_offer();
if (lowest) {
  var multiplier = ((((((0.99))))));
  debug('beating lowest price: '+lowest);
  price = lowest.total * multiplier - shipping;

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

return price;