Wildfire APIs

Understanding merchant categories

2min
wildfire offers a json feed that provides a comprehensive merchant category tree this article will describe how to navigate this tree to find the top level categories additionally, we will explore how this category tree relates to our merchant json feed each merchant in our feed is associated with one or more categories, including a primary category to better understand this concept, let's look at an example of each json file for your application, you can find the merchant json file at https //wildlink me/data/\[\[application id]]/merchant/1 https //wildlink me/data/\[\[application id]]/merchant/1 and the merchant category tree json at https //wildlink me/data/\[\[application id]]/category/1 https //wildlink me/data/\[\[application id]]/category/1 example merchant json excerpt \[ { "id" 7146, "name" "ecco bella", "paysnewcustomersonly" false, "shareandearndisabled" false, "serpinjectiondisabled" false, "browserextensiondisabled" false, "categories" \[ { "id" 178, "name" "fragrance & cologne", "parentid" 22 }, { "id" 22, "name" "health & beauty", "parentid" 0 } ], "primarycategoryid" 22, "url" "http //www eccobella com/" }, in this excerpt, we can see that the merchant named ecco bella has two categories fragrance & cologne and also health & beauty additionally, we can see that it has a primary category of 22, which is health & beauty example merchant category json excerpt \[ { "id" 1, "name" "clothing & apparel", "parentid" 0 }, { "id" 44, "name" "baby & kids", "parentid" 1 }, in this example, we can see that baby & kids is a child category of clothing & apparel if we wanted to get all top level categories, we would select every category that has a parentid equal to 0 (which indicates it has no parent category)