---
title: "Retrieve statistics of all invoices"
method: GET
path: "/invoices/statistics"
tags: ["Invoices"]
---

# Retrieve statistics of all invoices

`GET /invoices/statistics`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/invoices/statistics`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/invoices/statistics/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves statistics of all invoices. Returns the statistics of all invoices for successful request.
            <br /><br />Only for providers usage.

## Query parameters

- `daysPeriod` integer
- `approvedInThePastDaysPeriod` integer

## Response `200`

Indicates that the request succeeded and that the requested information is in the response.

- ServiceChannelServicesMessagingInvoicesInvoiceStatisticsResponse: Invoice statistics response class
  - `DaysPeriod` integer: Gets or sets the period in days, last X days for which Invoices statistics was collected
  - `WoReadyForInvoices` integer: Gets or sets the count of Work Orders ready for Invoices
  - `OpenInvoices` integer: Gets or sets the count of open Invoices
  - `ApprovedInvoicesDaysPeriod` integer: Gets or sets the period in days, last X days during which Invoices are approved
  - `ApprovedInvoices` integer: Gets or sets the count of Invoices approved in the past <ApprovedInvoicesDaysPeriod /> days

## Other responses

- `400`: Bad Request - the request could not be understood or was missing required parameters. <br/>Error codes: <br/> 503 - Only for providers usage;
- `401`: Indicates that the requested resource requires authentication. <br/>Error codes: <br/> 504 - API call rejected by security permissions;

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
