无法读取属性api Rest

I have a problem with this api.

This is in html

<div id="summary"></div>

This is in JS

var consuKey = "ck_b04aa6f288ee9a5495dee9c5db0a6b136350e005";
var consuSecr = "cs_1f98d389d0f9b47cd3200023864cf9b7cba50574";

function callurl() {
$.ajax({
   url: 'https://test.juand.org/wc-api/v2/reports/sales?',
   data:{
        filter: {period: "last_week"},
        consumer_key: consuKey,
        consumer_secret: consuSecr
    },
type: "GET",
dataType: "json"
})
.done(function(data){
JsonpCallback(data.reports)
})
.fail(function(data){
console.log("no");
})
}

function JsonpCallback(json) {
for (var i = 0; i < json.length; i++) {
$('#summary').append('<b>Descripción:</b> ' + json[i].total_sales + '<br />');
$('#summary').append('<hr />');
}
}

callurl();

I have the following error

Uncaught TypeError: Cannot read property 'length' of undefined
    at JsonpCallback (VM2284:68)
    at Object.<anonymous> (VM2284:60)
    at fire (VM2283 jquery-2.2.4.js:3187)
    at Object.fireWith [as resolveWith] (VM2283 jquery-2.2.4.js:3317)
    at done (VM2283 jquery-2.2.4.js:8757)
    at XMLHttpRequest.<anonymous> (VM2283 jquery-2.2.4.js:9123)

The idea is that of the result of json (total_sales) but I still do not understand why it gives me the error, if I call JsonpCallback (data.reports) if I use

JsonpCallback (data.sales)

Does not give any results

Can you help me find a solution, Thanks !!

You can see my code here

Https://jsfiddle.net/JDLA1/a84v2x9w/2/

The JSON you have isn't an array and thus has no .length. You can remove the loop

function JsonpCallback(json) {
  $('#summary').append('<b>Descripción:</b> ' + json.total_sales + '<br />');
  $('#summary').append('<hr />');
}

Further, it's sales and not reports

.done(function(data){
    JsonpCallback(data.sales)
})

On the other hand, json.totals is an array, so if you'd like to iterate over it, you would do it like this:

for (var key in json.totals) {
    console.log("key:", key, "value:", json.totals[key])
}