Talk:RepricerPseudoCode

From ChannelMAX

Jump to: navigation, search
Available Macros under Rule#60 ..(as on Dec, 24, 2013)
 
01. @MySellerID@ = Amazon Merchant ID
02. @MyFulfillmentType@ = FBA or FBM
03. @Floor@ = MyFloor (usually same as 'Cost/Min')
04. @RetailPrice@ = My ceiling (usually same as 'Retail/Max')
05. @MyShipping@ = My Shipping in Amazon
06. @MyNewNotch@ = My new position in the offer listing page after new price
07. @MyCurrNotch@ = My position in the offer listing page before reprice
08. @AmazonIsSelling@ = Y or N
09. @LowestSellerID@ = Lowest Amazon Merchant ID
10. @Amazon@
11. @AmazonTotalPrice@ = Amazon's total price
12. @NoOneElseButMeAndAmazon@ = Y if only Amazon and myself selling that ASIN
13. @NoChange@ = If price change is not needed
14. @NewPrice@ = if price change is needed
15. @BuyBoxSellerName@ = BuyBox holder seller name
16. @BuyBoxPosition@ = BuyBox position in the offer listing page
17. @BuyBoxPrice@ = BuyBox price
18. @BuyBoxTotalPrice@ = BuyBox Total price including shipping
19. @LowestFBAPrice@ = Lowest FBA Price
20. @LowestFBAShipping@ = Lowest FBA Shipping
21. @LowestFBATotal@ = Lowst FBA Total
22. @LowestFBAFBRating@ = Lowest FBA Feedback Rating
23. @LowestNonFBAPrice@ = Lowest nonFBA Pirce
24. @LowestNonFBAShipping@ = Lowest nonFBA Shipping
25. @LowestNonFBATotal@ = Lowest nonFBA Total
26. @LowestNonFBAFBRating@ = Lowest nonFBA Feedback Rating
27. @TotalOffers@ = Total number of offers
28. @TotalOffersFBA@ == Total Number of offers that are nonFBA
29. @TotalOffersNonFBA@ = Total number of nonFBA Offers
30. @TotalOffersFeatured@ = Total number of Featured Offers
31. @PrevBBoxSellerID@ = Previous BuyBox SellerID, such as MySelf, Amazon etc.
32. @CurrBBoxSellerID@ = Current BuyBox SellerID, such as MySelf, Amazon etc.
33. @SalesRank@ = SalesRank as returned by Amazon API
34. @1stLowestTotalPrice@ @2ndLowestTotalPrice@ @3rdLowestTotalPrice@
@4thLowestTotalPrice@ @5thLowestTotalPrice@
35. @1stLowestSellerName@ @2ndLowestSellerName@ @3rdLowestSellerName@
@4thLowestSellerName@ @5thLowestSellerName@
36. @1stLowestFulfillmentType@ @2ndLowestFulfillmentType@ @3rdLowestFulfillmentType@
@4thLowestFulfillmentType@ @5thLowestFulfillmentType@
37. @1stLowestFeaturedTotalPrice@ @2ndLowestFeaturedTotalPrice@ @3rdLowestFeaturedTotalPrice@
@4thLowestFeaturedTotalPrice@ @5thLowestFeaturedTotalPrice@
38. @1stLowestFeaturedSellerName@ @2ndLowestFeaturedSellerName@ @3rdLowestFeaturedSellerName@
@4thLowestFeaturedSellerName@ @5thLowestFeaturedSellerName@
39. @1stLowestFeaturedFulfillmentType@ @2ndLowestFeaturedFulfillmentType@ @3rdLowestFeaturedFulfillmentType@
@4thLowestFeaturedFulfillmentType@, @5thLowestFeaturedFulfillmentType
40. @1stLowestRegularTotalPrice@ @2ndLowestRegularTotalPrice@ @3rdLowestRegularTotalPrice@
@4thLowestRegularTotalPrice@ @5thLowestRegularTotalPrice@
41. @1stLowestRegularSellerName@ @2ndLowestRegularSellerName@ @3rdLowestRegularSellerName@
@4thLowestRegularSellerName@ @5thLowestRegularSellerName@
42. @1stLowestRegularFulfillmentType@ @2ndLowestRegularFulfillmentType@ @3rdLowestRegularFulfillmentType@
@4thLowestRegularFulfillmentType@ @5thLowestRegularFulfillmentType@
43. @MyStock@ = My Own Quantity (For future use)
 

Contents

Usage-1

//If Amazon is selling, then don't do any pricing management
if (@AmazonIsSelling@ == "1")
{
strTrace = strTrace +"AmazonIsSelling-";
@NewPrice@ = 0;
Return @NewPrice@;
}

Usage-2

Question

I'm trying to accomplish following. Set price 1.95% higher than lowest featured merchant. If featured FBA merchant exist and his/her price is in the range of 0-2% of the lowest - match his price. Examples: A) featured seller A:100.00 my price : 101.95 B) featured seller A:100.00 featured FBA seller B : 104 my price 101.95 C) featured seller A:100.00 featured FBA seller B : 101.00 my price 101.00

Answer
//If myShipping is missing, return 0 so that reprice can work normally
if (@MyShipping@ < 0)
{
strTrace = strTrace + "Missing myShipping";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();
}
//If lowest featured price is missing, return 0 so that reprice can work normally
if (@1stLowestFeaturedTotalPrice@ == 0)
{
strTrace = strTrace + "Missing 1stLowestFeaturedTotalPrice";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();
}
//Find Minimum FBA Price
double dblMinimumFBAPrice = 0;
if (@1stLowestFeaturedFulfillmentType@ == "FBA")
{
strTrace = strTrace + "MinFBAPrice At 1 -";
dblMinimumFBAPrice = @1stLowestFeaturedTotalPrice@;
}
else if (@2ndLowestFeaturedFulfillmentType@ == "FBA")
{
strTrace = strTrace + "MinFBAPrice At 2 -";
dblMinimumFBAPrice = @2ndLowestFeaturedTotalPrice@;
}
else if (@3rdLowestFeaturedFulfillmentType@ == "FBA")
{
strTrace = strTrace + "MinFBAPrice At 3 -";
dblMinimumFBAPrice = @3rdLowestFeaturedTotalPrice@;
}
else if (@4thLowestFeaturedFulfillmentType@ == "FBA")
{
strTrace = strTrace + "MinFBAPrice At 4 -";
dblMinimumFBAPrice = @4thLowestFeaturedTotalPrice@;
}
else if (@5thLowestFeaturedFulfillmentType@ == "FBA")
{
strTrace = strTrace + "MinFBAPrice At 5 -";
dblMinimumFBAPrice = @5thLowestFeaturedTotalPrice@;
}
if (dblMinimumFBAPrice > 0)
{
strTrace = strTrace + "MinFBAPrice:" + dblMinimumFBAPrice.ToString() + "-";
}
//If FBA is within 2%, then match that price
if ((dblMinimumFBAPrice > 0) && (@1stLowestFeaturedTotalPrice@ > 0) && (( (@1stLowestFeaturedTotalPrice@ * 0.92) - dblMinimumFBAPrice) < 0))
{
strTrace = strTrace + "A1-";
@NewPrice@ = dblMinimumFBAPrice - @MyShipping@;
return strTrace + "^" + @NewPrice@.ToString();
}
else
{
strTrace = strTrace + "B11-";
@NewPrice@ = @1stLowestFeaturedTotalPrice@ + (@1stLowestFeaturedTotalPrice@ * 0.0195) - @MyShipping@;;
return strTrace + "^" + @NewPrice@.ToString();
}

Usage-3

Question

I am trying to do this: Reprice 15% below our high if we are the only seller but if anyone jumps into the ASIN then continue repricing with the rules that we have in place and ignore the 15% below our High Setting. Is this possible?

Answer

Please try the following code

strTrace = strTrace + "myTotal:" + @MyTotalPrice@.ToString();

if (@MyTotalPrice@ == 0)

{

strTrace = strTrace + "Missing myTotal";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();

}

else if (@MyShipping@ == 0)

{

strTrace = strTrace + "Missing myShipping";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();

}

if (@1stLowestFeaturedTotalPrice@ == 0)

{

strTrace = strTrace + "Missing 1stLowestFeaturedTotalPrice";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();

}

if (@1stLowestFeaturedSellerName@ == "MyGearStore" && @2ndLowestFeaturedSellerName@ == "") {

strTrace = strTrace + "A1-";
@NewPrice@ = (@RetailPrice@ * 0.85);

}

else

{

//Set to -1 to process normally
strTrace = strTrace + "B1-";
@NewPrice@ = -1;

}

Usage-4

Usage-4

If Amazon.com and myself has the same price, also, if Amazon.com and myself occupy the 1st and 2nd lowest price position in Amazon, also, if the price is at my floor, then set my price at next higher seller. This may cause Amazon to increase the price and in the next repricer, I may get BuyBox.

Answer

You will have to change **YourSellerName** to your seller name.

strTrace = "";
strTrace = strTrace + "1st[" + @1stLowestSellerName@ + " $" + @1stLowestTotalPrice@ + "]-";
strTrace = strTrace + "2nd[" + @2ndLowestSellerName@ + " $" + @2ndLowestTotalPrice@ + "]-";
strTrace = strTrace + "3rd[" + @3rdLowestSellerName@ + " $" + @3rdLowestTotalPrice@ + "]-";
strTrace = strTrace + "Floor[$" + @Floor@ + "]-";
//If myShipping is missing, return 0 so that reprice can work normally
if (@MyShipping@ < 0)
{
strTrace = strTrace + "NoAction[Missing myShipping]-";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();
}
//If lowest price is missing, return 0 so that reprice can work normally
else if (@1stLowestTotalPrice@ == 0)
{
strTrace = strTrace + "NoAction[Missing 1stLowestTotalPrice]-";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();
}
//If 2nd lowest price is missing, return 0 so that reprice can work normally
else if (@2ndLowestTotalPrice@ == 0)
{
strTrace = strTrace + "NoAction[Missing 2ndLowestTotalPrice]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();
}
//if 3rd is lowest is missing, leave
else if (@3rdLowestTotalPrice@ == 0)
{
strTrace = strTrace + "NoAction[Missing 3rdLowestTotalPrice]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();
}
//If 2nd is not me, return 0 so that reprice can work normally
else if ((@2ndLowestSellerName@ != "**YourSellerName**") && (@1stLowestSellerName@ != "**YourSellerName**"))
{
strTrace = strTrace + "NoAction[1st2ndIsNotMe]-";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();
}
//If lowest is Amazon and me and at my floor
else if ((@1stLowestSellerName@ == "Amazon.com") && (@1stLowestTotalPrice@ == @2ndLowestTotalPrice@) && (@1stLowestTotalPrice@ == @Floor@) && (@2ndLowestSellerName@ == "**YourSellerName**"))
{
strTrace = strTrace + "A*AmazonNMeAtFloor-";
@NewPrice@ = @3rdLowestTotalPrice@ - @MyShipping@;
return strTrace + "^" + @NewPrice@.ToString();
}
else if ((@1stLowestSellerName@ == "**YourSellerName**") && (@1stLowestTotalPrice@ == @2ndLowestTotalPrice@) && (@1stLowestTotalPrice@ == @Floor@) && (@2ndLowestSellerName@ == "Amazon.com"))
{
strTrace = strTrace + "B*AmazonNMeAtFloor-";
@NewPrice@ = @3rdLowestTotalPrice@ - @MyShipping@;
return strTrace + "^" + @NewPrice@.ToString();
}
strTrace = strTrace + "NoAction-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();
 
 
Little Different Version
strTrace = "";
strTrace = strTrace + "1st[" + @1stLowestSellerName@ + " #" + @1stLowestTotalPrice@ + "]-";
strTrace = strTrace + "2nd[" + @2ndLowestSellerName@ + " #" + @2ndLowestTotalPrice@ + "]-";
strTrace = strTrace + "3rd[" + @3rdLowestSellerName@ + " #" + @3rdLowestTotalPrice@ + "]-";
strTrace = strTrace + "4th[" + @4thLowestSellerName@ + " #" + @4thLowestTotalPrice@ + "]-";
strTrace = strTrace + "5th[" + @5thLowestSellerName@ + " #" + @5thLowestTotalPrice@ + "]-";
strTrace = strTrace + "Floor[#" + @Floor@ + "]-";
//If myShipping is missing, return -1 so that reprice can work normally
if (@MyShipping@ < 0)
{
strTrace = strTrace + "NoAction[Missing myShipping]-";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();
}
//If lowest price is missing, return -1 so that reprice can work normally
else if (@1stLowestTotalPrice@ == 0)
{
strTrace = strTrace + "NoAction[Missing 1stLowestTotalPrice]-";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();
}
//If 2nd lowest price is missing, return -1 so that reprice can work normally
else if (@2ndLowestTotalPrice@ == 0)
{
strTrace = strTrace + "NoAction[Missing 2ndLowestTotalPrice]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();
}
//Check the Reference price to shoot upto
double dblRefPrice = 0;
if (@5thLowestTotalPrice@ > 0)
{
strTrace = strTrace + "Ref[5th]-";
dblRefPrice = @5thLowestTotalPrice@;
}
else if (@4thLowestTotalPrice@ > 0)
{
strTrace = strTrace + "Ref[4th]-";
dblRefPrice = @4thLowestTotalPrice@;
}
else if (@3rdLowestTotalPrice@ > 0)
{
strTrace = strTrace + "Ref[3rd]-";
dblRefPrice = @3rdLowestTotalPrice@;
}
if (dblRefPrice <= 0)
{
strTrace = strTrace + "NoAction[NoRef]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();
}
//If 2nd is not me, return 0 so that reprice can work normally
else if ((@2ndLowestSellerName@ != "mysellername") && (@1stLowestSellerName@ != "mysellername"))
{
strTrace = strTrace + "NoAction[1st2ndIsNotMe]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();
}
//If lowest is Amazon and me and at my floor
else if ((@1stLowestSellerName@ == "Amazon.de") && (@1stLowestTotalPrice@ == @2ndLowestTotalPrice@) && (@1stLowestTotalPrice@ == @Floor@) && (@2ndLowestSellerName@ == "mysellername"))
{
strTrace = strTrace + "A*AmazonNMeAtFloor-";
@NewPrice@ = dblRefPrice - @MyShipping@;
return strTrace + "^" + @NewPrice@.ToString();
}
else if ((@1stLowestSellerName@ == "mysellername") && (@1stLowestTotalPrice@ == @2ndLowestTotalPrice@) && (@1stLowestTotalPrice@ == @Floor@) && (@2ndLowestSellerName@ == "Amazon.de"))
{
strTrace = strTrace + "B*AmazonNMeAtFloor-";
@NewPrice@ = dblRefPrice - @MyShipping@;
return strTrace + "^" + @NewPrice@.ToString();
}
strTrace = strTrace + "NoAction-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();

Usage-5

Usage-5

Is there a way to set up the repricer that if I'm at my floor and I still don't have the buy box because amazon has it even though my price is less that my price should go back up to the next seller or my ceiling whichever comes first.

Answer

strTrace = ""; strTrace = strTrace + "1st[" + @1stLowestSellerName@ + " $" + @1stLowestTotalPrice@ + "]-";
strTrace = strTrace + "2nd[" + @2ndLowestSellerName@ + " $" + @2ndLowestTotalPrice@ + "]-";
strTrace = strTrace + "3rd[" + @3rdLowestSellerName@ + " $" + @3rdLowestTotalPrice@ + "]-";
strTrace = strTrace + "BBx[" + @BuyBoxSellerName@ + " $" + @BuyBoxTotalPrice@ + "]-";
strTrace = strTrace + "Floor[$" + @Floor@ + "]-";
string strMySellerName = "xyz";
//If myShipping is missing, return -1 so that reprice can work normally
if (@MyShipping@ < 0)
{

strTrace = strTrace + "NoAction[Missing myShipping]-";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();

}
//If lowest price is missing, return -1 so that reprice can work normally
else if (@1stLowestTotalPrice@ == 0)
{

strTrace = strTrace + "NoAction[Missing 1stLowestTotalPrice]-";
@NewPrice@ = 0;
return strTrace + "^" + @NewPrice@.ToString();

}
//If 2nd lowest price is missing, return -1 so that reprice can work normally
else if (@2ndLowestTotalPrice@ == 0)
{

strTrace = strTrace + "NoAction[Missing 2ndLowestTotalPrice]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();

}
//if 3rd is lowest is missing, leave
else if (@3rdLowestTotalPrice@ == 0)
{

strTrace = strTrace + "NoAction[Missing 3rdLowestTotalPrice]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();

}
//If the lowest is not me, then continue asis
else if (@1stLowestSellerName@ != strMySellerName)
{

strTrace = strTrace + "NoAction[1stNotMe]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();

}
//If the 2nd is not Amazon, continue asis
else if (@2ndLowestSellerName@ != "Amazon.com")
{

strTrace = strTrace + "NoAction[2ndNotAmazon]-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();

}
//If BuyBox is Amazon and lowest is me
else if ((@BuyBoxSellerName@ == "Amazon.com") && (@1stLowestTotalPrice@ == @strMySellerName@) && (@2ndLowestSellerName@ == "Amazon.com"))
{

strTrace = strTrace + "A*Met-";
@NewPrice@ = @3rdLowestTotalPrice@ - @MyShipping@;
return strTrace + "^" + @NewPrice@.ToString();

}
strTrace = strTrace + "NoAction-";
@NewPrice@ = -1;
return strTrace + "^" + @NewPrice@.ToString();

Personal tools