I am having hard time to access the particular json data. Here`s my json file

{
"id": "72",
"title": "Item Category Product Level Average Price Comparison",
"xLabel": null,
"yLabel": "Average Price",
"zLabel": null,
"data": [{
"avgPrice": "87",
"categoryID": "152b7934dd7e4fbeac56f825b5deaebd",
"categoryName": "Coffee Makers",
"merchantID": "99a8cd5687d245f8bff2152fec710973",
"merchantName": "A",
"numProducts": "85"
}, {
"avgPrice": "60",
"categoryID": "152b7934dd7e4fbeac56f825b5deaebd",
"categoryName": "Coffee Makers",
"merchantID": "6ee163f4f236466289fae97bb40351b7",
"merchantName": "B",
"numProducts": "49"
}, {
"avgPrice": "59",
"categoryID": "50215adc9ef64f91b4f4898fda7cf0b5",
"categoryName": "Dishwashers",
"merchantID": "99a8cd5687d245f8bff2152fec710973",
"merchantName": "A",
"numProducts": "65"
}
I want to take the value of avgPrice and numProducts of the unique values first corresponding to the merchant name. For example In the json data, First and last merchantName is same(i.e "merchantName" : "A") . So I want to take the value of Merchant A first, and Merchant B(if it is repeated I want to complete that first and then go for the another Merchant.

var mn = [];
$.each(returnedData.data, function (index, value) {
if($.inArray(value.merchantName, mn) == -1) {
mn.push(value.merchantName);
}
});
//all the merchants name stored in mn[]

function get_items_by_merchant(merchant_name) {
var items = new Array();
$.each(returnedData.data, function (index, item) {
if(returnedData.merchantName == merchant_name)
items.push(item);
});
return items;
}
var CB_items = [];
for(var i = 0; i < mn.length; i++) {
CB_items[i] = get_items_by_merchant(mn[i]);
$.each(CB_items, function (index, item) {
var avgpricve = parseFloat(response.data[i].avgPrice);
var numproducts = parseFloat(response.data[i].numProducts);
datajson = {
x: avgpricve,
y: numproducts
}
result_data.push(datajson)
});
}
response is the data in json file, I am getting it using $.getJSON . In the above code I want to access merchant name line response.data[i].mn[i].avgPrice.. Since that I am unable to.. Is there any way that I can do?