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.
In: header
Query Parameters
"ASC" | "DESC"Restrict the report to a single billing series.
date"T" | "F""T" | "F""T" | "F""T" | "F""T" | "F""0" | "1"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.
dateLast day of the window (inclusive). Defaults to today.
datedateAggregation 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.
"day" | "month"Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[serie][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[employee_code][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[vendor_code][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[customer_id][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[customer_tax_id][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[date][eq]=value
dateOperators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[document_number][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[canceled][eq]=value
"T" | "F"Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[updated_stocks][eq]=value
"T" | "F"Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[updated_current_account][eq]=value
"T" | "F"Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[debit][eq]=value
"T" | "F"Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[credit][eq]=value
"T" | "F"Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[integrated][eq]=value
"0" | "1"Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[start_date][eq]=value
dateOperators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[end_date][eq]=value
dateOperators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[due_date_lt][eq]=value
dateOperators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[customer_name][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[from_customer][eq]=value
Operators: eq, neq, gt, gte, lt, lte, like, ct, nlike, sw, ew, in, nin. Example: filter[to_customer][eq]=value
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"
}
}