public String toJSON()
  {
    Map<String,Object> parameters = new LinkedHashMap<String,Object>();
    if (GoCoin.hasValue(getStatus()))
    {
      parameters.put("status",getStatus());
    }
    if (GoCoin.hasValue(getTotal()))
    {
      parameters.put("total",getTotal());
    }
    if (GoCoin.hasValue(getPage()))
    {
      parameters.put("page",getPage());
    }
    if (GoCoin.hasValue(getPerPage()))
    {
      parameters.put("perPage",getPerPage());
    }
    //this one is a little special because we
    //want the invoices to have their parameters ordered how we want em
    Collection<JSONObject> collection = new LinkedList<JSONObject>();
    if (GoCoin.hasValue(getInvoices()))
    {
      for(Invoice i : getInvoices())
      {
        collection.add(new JSON(i.getJSONMap()));
      }
    }
    parameters.put("invoices",collection);
    JSON json = new JSON(parameters);
    return json.toString(2);
  }