OfficeGest
Sales/Reports/Sales by billing series

Sales by billing series

Returns net sales (credit notes subtracted) grouped by billing series for the requested window, bucketed by day or by month depending on granularity. The window is inclusive on both ends; with granularity=day it defaults to the last 30 days, with granularity=month to the last 12 months. Buckets without sales are returned as zero so the arrays stay index-aligned with the dates array.

GET
/sales/reports/sales-by-billing-series
AuthorizationBearer <token>

In: header

Query Parameters

order?string
sorder?string
Value in"ASC" | "DESC"
sort?string
limit?integer | null
serie?stringDeprecated

Restrict the report to a single billing series.

employee_code?stringDeprecated
vendor_code?stringDeprecated
customer_id?stringDeprecated
customer_tax_id?stringDeprecated
date?stringDeprecated
Formatdate
document_number?stringDeprecated
canceled?stringDeprecated
Value in"T" | "F"
updated_stocks?stringDeprecated
Value in"T" | "F"
updated_current_account?stringDeprecated
Value in"T" | "F"
debit?stringDeprecated
Value in"T" | "F"
credit?stringDeprecated
Value in"T" | "F"
integrated?stringDeprecated
Value in"0" | "1"
start_date?stringDeprecated

First day of the window (inclusive). Defaults to end_date minus 29 days when granularity=day, or to the first day of the month 11 months back when granularity=month.

Formatdate
end_date?stringDeprecated

Last day of the window (inclusive). Defaults to today.

Formatdate
due_date_lt?stringDeprecated
Formatdate
customer_name?stringDeprecated
from_customer?numberDeprecated
to_customer?numberDeprecated
granularity?string

Aggregation bucket: day or month. Defaults to day. When month, start_date/end_date are applied literally (not expanded to full calendar months) and default to the last 12 months (including the current one) when omitted.

Value in"day" | "month"
filter[serie][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[serie][eq]=value

filter[employee_code][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[employee_code][eq]=value

filter[vendor_code][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[vendor_code][eq]=value

filter[customer_id][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[customer_id][eq]=value

filter[customer_tax_id][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[customer_tax_id][eq]=value

filter[date][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[date][eq]=value

Formatdate
filter[document_number][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[document_number][eq]=value

filter[canceled][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[canceled][eq]=value

Value in"T" | "F"
filter[updated_stocks][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[updated_stocks][eq]=value

Value in"T" | "F"
filter[updated_current_account][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[updated_current_account][eq]=value

Value in"T" | "F"
filter[debit][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[debit][eq]=value

Value in"T" | "F"
filter[credit][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[credit][eq]=value

Value in"T" | "F"
filter[integrated][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[integrated][eq]=value

Value in"0" | "1"
filter[start_date][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[start_date][eq]=value

Formatdate
filter[end_date][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[end_date][eq]=value

Formatdate
filter[due_date_lt][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[due_date_lt][eq]=value

Formatdate
filter[customer_name][operator]?string

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[customer_name][eq]=value

filter[from_customer][operator]?number

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[from_customer][eq]=value

filter[to_customer][operator]?number

Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[to_customer][eq]=value

filter?string

Deep object form of the same fields, always with an operator (filter[start_date][gte]=...); the scalar form filter[start_date]=... is rejected with 422. For start_date and end_date the operator is required syntax but is not honoured: only the value is read, and it is always applied as the lower bound for start_date and the upper bound for end_date. Use gte for start_date and lte for end_date; any other operator is accepted and silently treated the same way. Being DocumentSchema-backed, the remaining document filters (employee_code, vendor_code, customer_id, customer_tax_id, document_number, canceled, integrated, ...) are also accepted and narrow the aggregation.

Response Body

curl -X GET "https://og-tenant1.test:8003/api/v2/sales/reports/sales-by-billing-series?order=string&sorder=ASC&sort=string&limit=0&serie=string&employee_code=string&vendor_code=string&customer_id=string&customer_tax_id=string&date=2019-08-24&document_number=string&canceled=T&updated_stocks=T&updated_current_account=T&debit=T&credit=T&integrated=0&start_date=2019-08-24&end_date=2019-08-24&due_date_lt=2019-08-24&customer_name=string&from_customer=0&to_customer=0&granularity=day&filter%5Bserie%5D%5Boperator%5D=string&filter%5Bemployee_code%5D%5Boperator%5D=string&filter%5Bvendor_code%5D%5Boperator%5D=string&filter%5Bcustomer_id%5D%5Boperator%5D=string&filter%5Bcustomer_tax_id%5D%5Boperator%5D=string&filter%5Bdate%5D%5Boperator%5D=2019-08-24&filter%5Bdocument_number%5D%5Boperator%5D=string&filter%5Bcanceled%5D%5Boperator%5D=T&filter%5Bupdated_stocks%5D%5Boperator%5D=T&filter%5Bupdated_current_account%5D%5Boperator%5D=T&filter%5Bdebit%5D%5Boperator%5D=T&filter%5Bcredit%5D%5Boperator%5D=T&filter%5Bintegrated%5D%5Boperator%5D=0&filter%5Bstart_date%5D%5Boperator%5D=2019-08-24&filter%5Bend_date%5D%5Boperator%5D=2019-08-24&filter%5Bdue_date_lt%5D%5Boperator%5D=2019-08-24&filter%5Bcustomer_name%5D%5Boperator%5D=string&filter%5Bfrom_customer%5D%5Boperator%5D=0&filter%5Bto_customer%5D%5Boperator%5D=0&filter=string"
{
  "data": {
    "granularity": "string",
    "start_date": "2019-08-24",
    "end_date": "2019-08-24",
    "days": 0,
    "dates": [
      "2019-08-24"
    ],
    "series": [
      {
        "serie": 0,
        "name": "string",
        "total": 0,
        "daily": [
          0
        ]
      }
    ],
    "totals_by_date": [
      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"
  }
}