OfficeGest
Sales/Reports/Sales by year

Get net sales value per year

Returns the net sales value (VAT excluded, credit notes subtracted) aggregated by calendar year, ordered by year ascending. Covers the whole document history: this endpoint has no date window, mirroring the legacy dashboard widget it replaces. Only cancelled-free documents whose type is a recapitulative, account-updating, non-receipt sales type are counted. Pass customer_id to narrow the aggregation to a single customer.

GET
/sales/reports/sales-by-year
AuthorizationBearer <token>

In: header

Query Parameters

customer_id?integer

Narrows the aggregation to a single customer. Omit to cover every customer.

Response Body

curl -X GET "https://og-tenant1.test:8003/api/v2/sales/reports/sales-by-year?customer_id=0"
{
  "data": [
    {
      "year": 0,
      "total": 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"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}