# Accounting Reports

**Summary:** Endpoints for Accounting Reports

- Role: [Developers](https://www.subrite.no/developers)
- Source: https://www.subrite.no/developers/accounting-reports
- Updated: 2026-10-13
- Markdown index: https://www.subrite.no/developers/llms.txt

<a id="get-api-v1-accounting-reports"></a>
## Get accounting reports summary

`GET /api/v1/accounting-reports`

Returns a list of months with their report availability, latest version, and status.

**Authentication:** Bearer token (JWT)

### Responses

#### 200

Content type: `application/json` · `array of AccountingReportMonthSummaryResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `[].periodMonth` (Required when parent is present) | `string` | Period month (YYYY-MM-DD format) |
| `[].monthLabel` (Required when parent is present) | `string` | Month label for display |
| `[].latestVersion` (Required when parent is present) | `number` | Latest version number (0 if no reports) |
| `[].latestStatus` (Required when parent is present) | `string` | Status of the latest version · Allowed values: `"queued"`, `"processing"`, `"completed"`, `"failed"` · Can be null |
| `[].totalVersions` (Required when parent is present) | `number` | Total number of versions for this period |
| `[].latestId` (Required when parent is present) | `number` | ID of the latest report (0 if none) |
| `[].isGenerating` (Required when parent is present) | `boolean` | Whether there is a report generation in progress |
| `[].isPeriodClosed` (Required when parent is present) | `boolean` | Whether the period is closed |
| `[].totalInvoicedGross` (Required when parent is present) | `number` | Total invoiced gross amount from the latest completed report |
| `[].totalPaymentGross` (Required when parent is present) | `number` | Total payment gross amount from the latest completed report |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/accounting-reports \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "periodMonth": "2025-10-01",
    "monthLabel": "Oktober 2025",
    "latestVersion": 2,
    "latestStatus": "queued",
    "totalVersions": 2,
    "latestId": 123,
    "isGenerating": false,
    "isPeriodClosed": true,
    "totalInvoicedGross": 125000.5,
    "totalPaymentGross": 98500
  }
]
```

<a id="post-api-v1-accounting-reports-generate"></a>
## Generate a new accounting report set

`POST /api/v1/accounting-reports/generate`

Generates a new version of all 4 report files (Invoice Summary PDF, Invoice Details Excel, Payment Summary PDF, Payment Details Excel) for the specified month.

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `AccountingReportGenerateDto`

| Name | Type | Description |
| --- | --- | --- |
| `year` (Required) | `number` | Year of the report period (e.g., 2025) · `minimum`: `2020`, `maximum`: `2100` |
| `month` (Required) | `number` | Month of the report period (1-12) · `minimum`: `1`, `maximum`: `12` |

**Example request body**

`application/json`

```json
{
  "year": 2025,
  "month": 10
}
```

### Responses

#### 201

Content type: `application/json` · `AccountingReportGenerateResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` | ID of the created report |
| `periodMonth` (Required) | `string` | Period month in YYYY-MM-DD format |
| `version` (Required) | `number` | Version number of this report |
| `status` (Required) | `string` | Current status of the report generation · Allowed values: `"queued"`, `"processing"`, `"completed"`, `"failed"` |

#### 401

unauthorized

#### 409

Content type: `application/json` · `ErrorResponse`

reportGenerationAlreadyInProgress

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` |   |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl https://api.subrite.no/api/v1/accounting-reports/generate \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "year": 2025,
  "month": 10
}'
```

### Example response

201 · `application/json`

```json
{
  "id": 123,
  "periodMonth": "2025-10-01",
  "version": 1,
  "status": "queued"
}
```

<a id="get-api-v1-accounting-reports-periodmonth-versions"></a>
## Get all versions for a specific period

`GET /api/v1/accounting-reports/{periodMonth}/versions`

Returns all generated report set versions for a given month.

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `periodMonth` (Required) | path | `string` |   |

### Responses

#### 200

Content type: `application/json` · `array of AccountingReportResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `[].id` (Required when parent is present) | `number` | Report ID |
| `[].periodMonth` (Required when parent is present) | `string` | Period month (YYYY-MM-DD format) |
| `[].version` (Required when parent is present) | `number` | Version number |
| `[].status` (Required when parent is present) | `string` | Current status · Allowed values: `"queued"`, `"processing"`, `"completed"`, `"failed"` |
| `[].totalInvoicedGross` (Required when parent is present) | `number` | Total invoiced amount (gross) |
| `[].totalPaymentGross` (Required when parent is present) | `number` | Total payment amount (gross) |
| `[].invoiceCount` (Required when parent is present) | `number` | Number of invoices in this report |
| `[].paymentCount` (Required when parent is present) | `number` | Number of payments in this report |
| `[].hasInvoiceSummaryPdf` | `boolean` | Invoice summary PDF available |
| `[].hasInvoiceDetailsExcel` | `boolean` | Invoice details Excel available |
| `[].hasPaymentSummaryPdf` | `boolean` | Payment summary PDF available |
| `[].hasPaymentDetailsExcel` | `boolean` | Payment details Excel available |
| `[].createdAt` (Required when parent is present) | `string (date-time)` | Created timestamp |

#### 401

unauthorized

### Example request

```bash
curl 'https://api.subrite.no/api/v1/accounting-reports/{periodMonth}/versions' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "id": 0,
    "periodMonth": "string",
    "version": 0,
    "status": "queued",
    "totalInvoicedGross": 0,
    "totalPaymentGross": 0,
    "invoiceCount": 0,
    "paymentCount": 0,
    "hasInvoiceSummaryPdf": true,
    "hasInvoiceDetailsExcel": true,
    "hasPaymentSummaryPdf": true,
    "hasPaymentDetailsExcel": true,
    "createdAt": "2019-08-24T14:15:22Z"
  }
]
```

<a id="get-api-v1-accounting-reports-id"></a>
## Get a specific report set by ID

`GET /api/v1/accounting-reports/{id}`

Returns details of a specific report set including file availability.

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `AccountingReportResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` | Report ID |
| `periodMonth` (Required) | `string` | Period month (YYYY-MM-DD format) |
| `version` (Required) | `number` | Version number |
| `status` (Required) | `string` | Current status · Allowed values: `"queued"`, `"processing"`, `"completed"`, `"failed"` |
| `totalInvoicedGross` (Required) | `number` | Total invoiced amount (gross) |
| `totalPaymentGross` (Required) | `number` | Total payment amount (gross) |
| `invoiceCount` (Required) | `number` | Number of invoices in this report |
| `paymentCount` (Required) | `number` | Number of payments in this report |
| `hasInvoiceSummaryPdf` | `boolean` | Invoice summary PDF available |
| `hasInvoiceDetailsExcel` | `boolean` | Invoice details Excel available |
| `hasPaymentSummaryPdf` | `boolean` | Payment summary PDF available |
| `hasPaymentDetailsExcel` | `boolean` | Payment details Excel available |
| `createdAt` (Required) | `string (date-time)` | Created timestamp |

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

reportNotFound

Same fields as [Generate a new accounting report set (409)](https://www.subrite.no/developers/accounting-reports?md=true#post-api-v1-accounting-reports-generate).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/accounting-reports/{id}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "periodMonth": "string",
  "version": 0,
  "status": "queued",
  "totalInvoicedGross": 0,
  "totalPaymentGross": 0,
  "invoiceCount": 0,
  "paymentCount": 0,
  "hasInvoiceSummaryPdf": true,
  "hasInvoiceDetailsExcel": true,
  "hasPaymentSummaryPdf": true,
  "hasPaymentDetailsExcel": true,
  "createdAt": "2019-08-24T14:15:22Z"
}
```

<a id="get-api-v1-accounting-reports-id-download"></a>
## Download a file from a report set

`GET /api/v1/accounting-reports/{id}/download`

Downloads one of the 4 files from the report set: invoice\_summary\_pdf, invoice\_details\_excel, payment\_summary\_pdf, payment\_details\_excel.

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |
| `fileType` (Required) | query | `string` | Type of file to download · Allowed values: `"invoice_summary_pdf"`, `"invoice_details_excel"`, `"payment_summary_pdf"`, `"payment_details_excel"` |

### Responses

#### 200

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

reportNotFound,reportIsNotYetCompleted,fileNotFound

Same fields as [Generate a new accounting report set (409)](https://www.subrite.no/developers/accounting-reports?md=true#post-api-v1-accounting-reports-generate).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/accounting-reports/{id}/download?fileType=invoice_summary_pdf' \
  --header 'Authorization: Bearer <token>'
```
