Invoice statistics

Description

Allows you to get general statistics on your invoices and payments.

Request

curl -X POST https://api.bitsby.app/statistics/invoices \
  -H "Authorization: Token MSvL2ltaDZdWVjmZURURMVWhqSJLT2NURjhL2Fla1Z1T1IxQTltKs1T3Ay" \
	-F "startDate=2000-01-01" \
	-F "endDate=2030-01-01"

Request parameters

Parameter
Data type
Description
Example
Mandatory?

startDate

String

Start date of invoice creation in Y-m-d format

2000-01-01

no

endDate

String

End date of invoice creation in Y-m-d format

2030-01-01

no

Example answer

{
    "result": "success",
    "data": {
        "invoicesTotalNum": 51,
        "invoicesPaidNum": 24,
        "invoicesTotalUSD": 335.03,
        "invoicesByProjects": {
            "9deea1e2-0c08-41a3-bdc2-a34eada3892d": 335.03
        },
        "invoicesByCurrencies": {
            "USD": 335.03
        },
        "invoicesByMonths": {
            "March-2024": 42,
            "February-2024": 293.03
        },
        "invoicesByDate": {
            "2024-03-04": {
                "date": 1709510400000,
                "value": 21
            },
            "2024-03-03": {
                "date": 1709424000000,
                "value": 10
            },
            "2024-03-01": {
                "date": 1709251200000,
                "value": 11
            },
            "2024-02-27": {
                "date": 1708992000000,
                "value": 12
            },
            "2024-02-26": {
                "date": 1708905600000,
                "value": 38
            }
        }
    }
}

Answer parameters

Parameter
Description

invoicesTotalNum

Total number of invoices

invoicesPaidNum

Number of paid invoices (with status "Paid")

invoicesTotalUSD

Sum of all paid invoices in USD

invoicesByProjects

Sum of all paid invoices by projects in USD

invoicesByCurrencies

Sum of all paid invoices by currency

invoicesByMonths

Sum of all paid invoices by month in USD

invoicesByDate

Sum of all paid invoices by days in USD

invoicesByDate.date

Date in Unix Timestamp format including microseconds

invoicesByDate.value

Sum of all paid invoices for a specific date in USD

Last updated