# AR Snapshot

**Summary:** Endpoints for AR Snapshot

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

<a id="post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period"></a>
## Generate AR snapshot invoice for a specific period

`POST /api/v1/ar-snapshots/ar-snapshot-invoice-generate-for-period`

Generates AR snapshot invoice for the provided year-month

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `year` (Required) | `number` | Calendar year (4 digits). · `minimum`: `2000`, `maximum`: `9999` |
| `month` (Required) | `number` | Calendar month number (1 = January … 12 = December). Number only. · `minimum`: `1`, `maximum`: `12` |

**Example request body**

`application/json`

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

### Responses

#### 201

#### 400

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

periodAlreadyExists

| 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": [
    {}
  ]
}
```

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/ar-snapshot-invoice-generate-for-period \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "year": 2025,
  "month": 8
}'
```

<a id="post-api-v1-ar-snapshots-ar-snapshot-payment-generate-for-period"></a>
## Generate AR snapshot payment for a specific period

`POST /api/v1/ar-snapshots/ar-snapshot-payment-generate-for-period`

Generates AR snapshot payment for the provided year-month

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Generate AR snapshot invoice for a specific period (Request body)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

**Example request body**

`application/json`

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

### Responses

#### 201

#### 400

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

periodAlreadyExists

Same fields as [Generate AR snapshot invoice for a specific period (400)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

**Example response**

`application/json`

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

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/ar-snapshot-payment-generate-for-period \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "year": 2025,
  "month": 8
}'
```

<a id="post-api-v1-ar-snapshots-unlocked-period"></a>
## Unlock a period (sequential).

`POST /api/v1/ar-snapshots/unlocked-period`

Accepts year & month (1–12). Only the latest locked month can be unlocked. If you try to unlock in the middle, returns a 409 suggesting the month you must unlock first.

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `year` (Required) | `number` | Calendar year (4 digits). · `minimum`: `2000`, `maximum`: `9999` |
| `month` (Required) | `number` | Calendar month number (1 = January … 12 = December). · `minimum`: `1`, `maximum`: `12` |

**Example request body**

`application/json`

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

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `status` (Required) | `string` |   |
| `periodMonth` (Required) | `string` |   |
| `reportingAt` (Required) | `string (date-time)` |   |
| `affected` (Required) | `number` |   |

#### 401

unauthorized

#### 404

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

noLockedPeriodsAvailableToUnlock

Same fields as [Generate AR snapshot invoice for a specific period (400)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

**Example response**

`application/json`

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

#### 409

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

thisPeriodIsAlreadyUnlocked, noLockedPeriodsAvailableToUnlock, lockedPeriodsMustBeUnlockedInOrderMostRecentFirst

Same fields as [Generate AR snapshot invoice for a specific period (400)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/unlocked-period \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "year": 2025,
  "month": 8
}'
```

### Example response

201 · `application/json`

```json
{
  "status": "string",
  "periodMonth": "string",
  "reportingAt": "2019-08-24T14:15:22Z",
  "affected": 0
}
```

<a id="get-api-v1-ar-snapshots-min-allowed-ar-event-date"></a>
## Get earliest selectable date for payments/credit notes/refunds

`GET /api/v1/ar-snapshots/min-allowed-ar-event-date`

Returns minDate as "yyyy-MM-dd". Any earlier date falls in locked months and should be disabled in the UI.

**Authentication:** Bearer token (JWT)

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `minDate` (Required) | `string` |   |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/min-allowed-ar-event-date \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "minDate": "string"
}
```

<a id="get-api-v1-ar-snapshots-trend-open-invoice-outstanding-gross-amount"></a>
## ArSnapshotController\_getOpenInvoiceOutstandingGrossAmountTrend\_v1

`GET /api/v1/ar-snapshots/trend/open-invoice-outstanding-gross-amount`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `months` | query | `string` |   |
| `locale` | query | `string` | Allowed values: `"nb-NO"`, `"en-US"`, `"sv-SE"`, `"da-DK"` |

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].buckets` (Required when parent is present) | `object` | Aging group. |
| `[].label` (Required when parent is present) | `string` | Month label (locale-aware). |
| `[].total` (Required when parent is present) | `number` | Total outstanding amount or open-invoice count for the month. |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/trend/open-invoice-outstanding-gross-amount \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "buckets": "LT_30",
    "label": "January 2025",
    "total": 21900
  }
]
```

<a id="get-api-v1-ar-snapshots-trend-open-invoices-count"></a>
## ArSnapshotController\_getOpenInvoiceCountTrend\_v1

`GET /api/v1/ar-snapshots/trend/open-invoices-count`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `months` | query | `string` |   |
| `locale` | query | `string` | Allowed values: `"nb-NO"`, `"en-US"`, `"sv-SE"`, `"da-DK"` |

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].buckets` (Required when parent is present) | `object` | Aging group. |
| `[].label` (Required when parent is present) | `string` | Month label (locale-aware). |
| `[].total` (Required when parent is present) | `number` | Total outstanding amount or open-invoice count for the month. |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/trend/open-invoices-count \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "buckets": "LT_30",
    "label": "January 2025",
    "total": 21900
  }
]
```

<a id="get-api-v1-ar-snapshots-trend-open-payments-amount"></a>
## ArSnapshotController\_getOpenPaymentAmountTrend\_v1

`GET /api/v1/ar-snapshots/trend/open-payments-amount`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `months` | query | `string` |   |
| `locale` | query | `string` | Allowed values: `"nb-NO"`, `"en-US"`, `"sv-SE"`, `"da-DK"` |

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].buckets` (Required when parent is present) | `object` | Aging group. |
| `[].label` (Required when parent is present) | `string` | Month label (locale-aware). |
| `[].total` (Required when parent is present) | `number` | Total outstanding amount or open-invoice count for the month. |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/trend/open-payments-amount \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "buckets": "LT_30",
    "label": "January 2025",
    "total": 21900
  }
]
```

<a id="get-api-v1-ar-snapshots-trend-open-payments-count"></a>
## ArSnapshotController\_getOpenPaymentCountTrend\_v1

`GET /api/v1/ar-snapshots/trend/open-payments-count`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `months` | query | `string` |   |
| `locale` | query | `string` | Allowed values: `"nb-NO"`, `"en-US"`, `"sv-SE"`, `"da-DK"` |

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].buckets` (Required when parent is present) | `object` | Aging group. |
| `[].label` (Required when parent is present) | `string` | Month label (locale-aware). |
| `[].total` (Required when parent is present) | `number` | Total outstanding amount or open-invoice count for the month. |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/trend/open-payments-count \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "buckets": "LT_30",
    "label": "January 2025",
    "total": 21900
  }
]
```

<a id="post-api-v1-ar-snapshots-lock-and-generate-ar-reports"></a>
## Generate AR invoice + summary reports (locks period once final report completes)

`POST /api/v1/ar-snapshots/lock-and-generate-ar-reports`

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Generate AR snapshot invoice for a specific period (Request body)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

**Example request body**

`application/json`

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

### Responses

#### 201

#### 401

unauthorized

#### 404

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

notFoundTheGivenPeriod

Same fields as [Generate AR snapshot invoice for a specific period (400)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

**Example response**

`application/json`

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

#### 409

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

noOpenOrUnlockedPeriodFoundToLocked, arSnapshotPreviousPeriodNotLocked

Same fields as [Generate AR snapshot invoice for a specific period (400)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

### Example request

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

<a id="get-api-v1-ar-snapshots-ar-report-history"></a>
## Last N months, latest Summary + Final per month

`GET /api/v1/ar-snapshots/ar-report-history`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `months` | query | `string` |   |
| `locale` | query | `string` | Allowed values: `"nb-NO"`, `"en-US"`, `"sv-SE"`, `"da-DK"` |

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].monthLabel` (Required when parent is present) | `string` | The label text for the period month |
| `[].periodMonth` (Required when parent is present) | `string` | The period month in the format "YYYY-MM-01" |
| `[].openInvoiceCount` (Required when parent is present) | `number` | The number of open invoices for the period |
| `[].openInvoiceGrossAmount` (Required when parent is present) | `number` | The total amount of open invoices for the period |
| `[].openPaymentCount` (Required when parent is present) | `number` | The number of open payments for the period |
| `[].openPaymentAmount` (Required when parent is present) | `number` | The total amount of open payments for the period |
| `[].openInvoiceId` (Required when parent is present) | `number` | The latest id for open\_invoice · Can be null |
| `[].openInvoiceSummaryId` (Required when parent is present) | `number` | The latest id for open\_invoice\_summary · Can be null |
| `[].openPaymentId` (Required when parent is present) | `number` | The latest id for open\_payment · Can be null |
| `[].openPaymentSummaryId` (Required when parent is present) | `number` | The latest id for open\_payment\_summary · Can be null |
| `[].isPeriodLocked` (Required when parent is present) | `boolean` | True if this period is locked (snapshot exists with status=LOCKED) |
| `[].isImmediateNextPeriodLocked` (Required when parent is present) | `boolean` | True if the immediate NEXT period that has a snapshot is locked (status=LOCKED) |
| `[].openInvoiceStatus` (Required when parent is present) | `string` | Status of the latest open\_invoice report for this period · Allowed values: `"started"`, `"completed"`, `"failed"`, `"queued"` · Can be null |
| `[].openInvoiceSummaryStatus` (Required when parent is present) | `string` | Status of the latest open\_invoice\_summary report for this period · Allowed values: `"started"`, `"completed"`, `"failed"`, `"queued"` · Can be null |
| `[].openPaymentStatus` (Required when parent is present) | `string` | Status of the latest open\_payment report for this period · Allowed values: `"started"`, `"completed"`, `"failed"`, `"queued"` · Can be null |
| `[].openPaymentSummaryStatus` (Required when parent is present) | `string` | Status of the latest open\_payment\_summary report for this period · Allowed values: `"started"`, `"completed"`, `"failed"`, `"queued"` · Can be null |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/ar-snapshots/ar-report-history \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "monthLabel": "string",
    "periodMonth": "string",
    "openInvoiceCount": 0,
    "openInvoiceGrossAmount": 0,
    "openPaymentCount": 0,
    "openPaymentAmount": 0,
    "openInvoiceId": 0,
    "openInvoiceSummaryId": 0,
    "openPaymentId": 0,
    "openPaymentSummaryId": 0,
    "isPeriodLocked": true,
    "isImmediateNextPeriodLocked": true,
    "openInvoiceStatus": "started",
    "openInvoiceSummaryStatus": "started",
    "openPaymentStatus": "started",
    "openPaymentSummaryStatus": "started"
  }
]
```

<a id="get-api-v1-ar-snapshots-id"></a>
## Get download stream of an export by id

`GET /api/v1/ar-snapshots/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |
| `format` (Required) | query | `string` | Allowed values: `"csv"`, `"xlsx"`, `"xls"`, `"DAT"`, `"pdf"`, `"xml"` |

### Responses

#### 200

#### 401

unauthorized

#### 404

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

notFound,invalidFileUrl

Same fields as [Generate AR snapshot invoice for a specific period (400)](https://www.subrite.no/developers/ar-snapshot?md=true#post-api-v1-ar-snapshots-ar-snapshot-invoice-generate-for-period).

**Example response**

`application/json`

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

### Example request

```bash
curl 'https://api.subrite.no/api/v1/ar-snapshots/{id}?format=csv' \
  --header 'Authorization: Bearer <token>'
```
