OfficeGest
Sales/Reports/Sales summary

Get the sales summary

Returns the four rows of the sales summary dashboard widget over three windows: the current month, the previous month, the monthly average of the year so far and the current-year total. Takes no parameters — the windows are anchored to the server clock, as the legacy widget it replaces is. rows always holds exactly four entries in this order: billing (invoiced amount, aggregated per document), goods and services (aggregated per document line and filtered by article type), and goods_profit (the profit margin of the goods lines, which can be negative). Only cancelled-free, account-updating, non-receipt sales documents are counted; a document that only credits, and any credit note by SAFT type, subtracts. A money value of null means there were no documents in that window at all, while 0 means there were documents and they sum to zero — the two are different and the distinction is part of the contract. Each row carries one series entry per billing series with movement in any of the windows, ordered by series code, and every value of the row is the sum of the same value across its series, up to rounding. Note that billing is a document-level total while goods and services are line-level, so the two do not necessarily add up to it.

GET
/sales/reports/sales-summary
AuthorizationBearer <token>

In: header

Response Body

curl -X GET "https://og-tenant1.test:8003/api/v2/sales/reports/sales-summary"
{
  "data": {
    "as_of": "2019-08-24",
    "current_month": {
      "year": 0,
      "month": 0
    },
    "previous_month": {
      "year": 0,
      "month": 0
    },
    "monthly_average": {
      "year": 0,
      "from_month": 0,
      "to_month": 0,
      "months": 0
    },
    "current_year": 0,
    "rows": [
      {
        "kind": "billing",
        "current_month": 0,
        "previous_month": 0,
        "monthly_average": 0,
        "current_year": 0,
        "series": [
          {
            "serie": 0,
            "name": "string",
            "current_month": 0,
            "previous_month": 0,
            "monthly_average": 0,
            "current_year": 0
          }
        ]
      }
    ]
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}