# Ledger

**Summary:** Endpoints for Ledger

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

<a id="post-api-v1-ledger-filter"></a>
## Get ledger of all members

`POST /api/v1/ledger/filter`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `page` | query | `number` | Default: `1` · `minimum`: `1` |
| `take` | query | `number` | Default: `10` · `minimum`: `1`, `maximum`: `50` |
| `orderBy` | query | `string` | Allowed values: `"createdAt"`, `"id"`, `"updatedAt"` · Default: `"createdAt"` |
| `orderDirection` | query | `string` | Allowed values: `"asc"`, `"desc"` · Default: `"desc"` |

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `status` | `string` | Allowed values: `"open"`, `"matched"`, `"ignored"` |
| `types` | `array of TransactionResponseType` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `invoiceStatus` | `array of INVOICE_STATUS` | Allowed values: `"paid"`, `"unpaid"`, `"over-due"`, `"over-paid"`, `"partially-paid"`, `"refunded"`, `"credited"`, `"partially-credited"` |
| `invoiceNumber` | `number` |   |
| `reference` | `string` |   |
| `memberSearch` | `string` | `maxLength`: `120` |
| `memberId` | `string` |   |
| `memberEmail` | `string` | `maxLength`: `120` · Deprecated |
| `dateFrom` | `string (date-time)` |   |
| `dateTo` | `string (date-time)` |   |
| `amountFilter` | `AmountFilter` |   |
| `amountFilter.operator` (Required when parent is present) | `ComparisonOperator` | Allowed values: `"EQUALS"`, `"BETWEEN"`, `"GREATER_THAN"`, `"LESS_THAN"` |
| `amountFilter.amount` (Required when parent is present) | `number` |   |
| `amountFilter.secondAmount` | `number` |   |

**Example request body**

`application/json`

```json
{
  "status": "open",
  "types": [
    "payment"
  ],
  "invoiceStatus": [
    "paid"
  ],
  "invoiceNumber": 0,
  "reference": "string",
  "memberSearch": "string",
  "memberId": "string",
  "memberEmail": "string",
  "dateFrom": "2019-08-24T14:15:22Z",
  "dateTo": "2019-08-24T14:15:22Z",
  "amountFilter": {
    "operator": "EQUALS",
    "amount": 0,
    "secondAmount": 0
  }
}
```

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `items` (Required) | `array of TransactionResponse` |   |
| `items[].transactionGroupId` | `number` |   |
| `items[].transactionId` (Required when parent is present) | `number` |   |
| `items[].memberId` (Required when parent is present) | `string` |   |
| `items[].memberEmail` (Required when parent is present) | `string` |   |
| `items[].memberName` | `string` |   |
| `items[].type` (Required when parent is present) | `TransactionResponseType` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `items[].registrationDate` (Required when parent is present) | `string (date-time)` |   |
| `items[].accountingDate` (Required when parent is present) | `string (date-time)` |   |
| `items[].invoiceNumber` | `number` |   |
| `items[].invoiceStatus` (Required when parent is present) | `INVOICE_STATUS` | Allowed values: `"paid"`, `"unpaid"`, `"over-due"`, `"over-paid"`, `"partially-paid"`, `"refunded"`, `"credited"`, `"partially-credited"` |
| `items[].reference` (Required when parent is present) | `string` |   |
| `items[].amount` (Required when parent is present) | `number` |   |
| `items[].status` (Required when parent is present) | `TRANSACTION_RESPONSE_STATUS` | Allowed values: `"open"`, `"matched"`, `"ignored"` |
| `items[].memberPackageId` (Required when parent is present) | `number` |   |
| `items[].memberNumber` (Required when parent is present) | `number` |   |
| `meta` (Required) | `PageMeta` |   |
| `meta.page` (Required) | `number` |   |
| `meta.take` (Required) | `number` |   |
| `meta.count` (Required) | `number` |   |
| `meta.pageCount` (Required) | `number` |   |
| `meta.hasPreviousPage` (Required) | `boolean` |   |
| `meta.hasNextPage` (Required) | `boolean` |   |

#### 201

#### 401

unauthorized

#### 403

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

forbiddenResource

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

#### 500

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

internalServerError

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/ledger/filter \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "open",
  "types": [
    "payment"
  ],
  "invoiceStatus": [
    "paid"
  ],
  "invoiceNumber": 0,
  "reference": "string",
  "memberSearch": "string",
  "memberId": "string",
  "memberEmail": "string",
  "dateFrom": "2019-08-24T14:15:22Z",
  "dateTo": "2019-08-24T14:15:22Z",
  "amountFilter": {
    "operator": "EQUALS",
    "amount": 0,
    "secondAmount": 0
  }
}'
```

### Example response

200 · `application/json`

```json
{
  "items": [
    {}
  ],
  "meta": {
    "page": 0,
    "take": 0,
    "count": 0,
    "pageCount": 0,
    "hasPreviousPage": true,
    "hasNextPage": true
  }
}
```

<a id="get-api-v1-ledger-memberid"></a>
## Get ledger of a member

`GET /api/v1/ledger/{memberId}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `memberId` (Required) | path | `string` |   |
| `status` | query | `string` | Allowed values: `"open"`, `"matched"`, `"ignored"` |

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].transactionGroupId` | `number` |   |
| `[].transactionId` (Required when parent is present) | `number` |   |
| `[].memberId` (Required when parent is present) | `string` |   |
| `[].memberEmail` (Required when parent is present) | `string` |   |
| `[].memberName` | `string` |   |
| `[].type` (Required when parent is present) | `TransactionResponseType` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `[].registrationDate` (Required when parent is present) | `string (date-time)` |   |
| `[].accountingDate` (Required when parent is present) | `string (date-time)` |   |
| `[].invoiceNumber` | `number` |   |
| `[].invoiceStatus` (Required when parent is present) | `INVOICE_STATUS` | Allowed values: `"paid"`, `"unpaid"`, `"over-due"`, `"over-paid"`, `"partially-paid"`, `"refunded"`, `"credited"`, `"partially-credited"` |
| `[].reference` (Required when parent is present) | `string` |   |
| `[].amount` (Required when parent is present) | `number` |   |
| `[].status` (Required when parent is present) | `TRANSACTION_RESPONSE_STATUS` | Allowed values: `"open"`, `"matched"`, `"ignored"` |
| `[].memberPackageId` (Required when parent is present) | `number` |   |
| `[].memberNumber` (Required when parent is present) | `number` |   |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

### Example request

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

### Example response

200 · `application/json`

```json
[
  {
    "transactionGroupId": 0,
    "transactionId": 0,
    "memberId": "string",
    "memberEmail": "string",
    "memberName": "<memberName>",
    "type": "payment",
    "registrationDate": "2019-08-24T14:15:22Z",
    "accountingDate": "2019-08-24T14:15:22Z",
    "invoiceNumber": 0,
    "invoiceStatus": "paid",
    "reference": "string",
    "amount": 0,
    "status": "open",
    "memberPackageId": 0,
    "memberNumber": 0
  }
]
```

<a id="patch-api-v1-ledger-memberid"></a>
## Match transactions

`PATCH /api/v1/ledger/{memberId}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `transactionIds` (Required) | `array of number` |   |
| `action` (Required) | `TRANSACTION_GROUP_ACTION` | Allowed values: `"match"`, `"open"` · Default: `"match"` |

**Example request body**

`application/json`

```json
{
  "transactionIds": [
    0
  ],
  "action": "match"
}
```

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `uuid` (Required) | `string` |   |
| `isOpen` (Required) | `boolean` |   |
| `isManualMatch` (Required) | `boolean` |   |
| `transactions` (Required) | `array of Transaction` |   |
| `transactions[].transactionGroupId` (Required when parent is present) | `number` |   |
| `transactions[].type` (Required when parent is present) | `string` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `transactions[].memberPackageId` (Required when parent is present) | `number` |   |
| `transactions[].amount` (Required when parent is present) | `number` |   |
| `transactions[].reference` (Required when parent is present) | `string` |   |
| `transactions[].invoiceId` (Required when parent is present) | `number` |   |
| `transactions[].paymentId` (Required when parent is present) | `number` |   |
| `transactions[].refundId` (Required when parent is present) | `number` |   |
| `transactions[].accountingDate` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].status` (Required when parent is present) | `string` | Allowed values: `"ignored"` |
| `transactions[].tenantId` (Required when parent is present) | `number` |   |
| `transactions[].memberId` (Required when parent is present) | `string` |   |
| `transactions[].transactionGroup` (Required when parent is present) | `TransactionGroup` | Recursive schema; nested fields are not repeated. |
| `transactions[].member` (Required when parent is present) | `Member` |   |
| `transactions[].member.userId` (Required when parent is present) | `number` | Can be null |
| `transactions[].member.memberNumber` (Required when parent is present) | `number` | Can be null |
| `transactions[].member.tenantId` (Required when parent is present) | `number` |   |
| `transactions[].member.externalId` (Required when parent is present) | `string` | Can be null |
| `transactions[].member.fullName` (Required when parent is present) | `string` |   |
| `transactions[].member.nickName` (Required when parent is present) | `string` |   |
| `transactions[].member.avatar` (Required when parent is present) | `string` |   |
| `transactions[].member.email` (Required when parent is present) | `string` |   |
| `transactions[].member.birthDate` (Required when parent is present) | `string (date-time)` | Can be null |
| `transactions[].member.phone` (Required when parent is present) | `string` |   |
| `transactions[].member.isCompany` (Required when parent is present) | `boolean` |   |
| `transactions[].member.companyName` (Required when parent is present) | `string` | Can be null |
| `transactions[].member.organizationNo` (Required when parent is present) | `string` | Can be null |
| `transactions[].member.deleteAfterExpiration` (Required when parent is present) | `boolean` |   |
| `transactions[].member.customPropertyValues` (Required when parent is present) | `object` |   |
| `transactions[].member.productRecipients` (Required when parent is present) | `array of MemberPackageProductRecipient` | Nested fields omitted: depth limit. |
| `transactions[].member.id` (Required when parent is present) | `string` |   |
| `transactions[].member.createdAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].member.updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].member.deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].member.metaData` (Required when parent is present) | `object` |   |
| `transactions[].tenant` (Required when parent is present) | `Tenant` | Nested fields omitted: field limit. |
| `transactions[].invoice` (Required when parent is present) | `Invoice` | Nested fields omitted: field limit. |
| `transactions[].payment` (Required when parent is present) | `Payment` | Nested fields omitted: field limit. |
| `transactions[].refund` (Required when parent is present) | `Refund` |   |
| `transactions[].refund.refundNumber` (Required when parent is present) | `number` |   |
| `transactions[].refund.invoiceNumber` (Required when parent is present) | `number` |   |
| `transactions[].refund.invoiceId` (Required when parent is present) | `number` |   |
| `transactions[].refund.memberId` (Required when parent is present) | `string` |   |
| `transactions[].refund.language` (Required when parent is present) | `string` | Allowed values: `"en"`, `"no"`, `"sv"`, `"da"` |
| `transactions[].refund.memberInfo` (Required when parent is present) | `MemberInfo` | Nested fields omitted: depth limit. |
| `transactions[].refund.addressInfo` (Required when parent is present) | `AddressInfo` | Nested fields omitted: depth limit. |
| `transactions[].refund.tenantInfo` (Required when parent is present) | `TenantInfo` | Nested fields omitted: depth limit. |
| `transactions[].refund.paymentProvider` (Required when parent is present) | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `transactions[].refund.amount` (Required when parent is present) | `number` |   |
| `transactions[].refund.accountingDate` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].refund.currency` (Required when parent is present) | `string` |   |
| `transactions[].refund.note` (Required when parent is present) | `string` |   |
| `transactions[].refund.invoice` (Required when parent is present) | `Invoice` | Nested fields omitted: depth limit. |
| `transactions[].refund.member` (Required when parent is present) | `Member` | Nested fields omitted: depth limit. |
| `transactions[].refund.tenant` (Required when parent is present) | `Tenant` | Nested fields omitted: depth limit. |
| `transactions[].refund.id` (Required when parent is present) | `number` |   |
| `transactions[].refund.createdAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].refund.updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].refund.deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].refund.metaData` (Required when parent is present) | `object` |   |
| `transactions[].memberPackage` (Required when parent is present) | `MemberPackage` | Nested fields omitted: field limit. |
| `transactions[].id` (Required when parent is present) | `number` |   |
| `transactions[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `transactions[].metaData` (Required when parent is present) | `object` |   |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `deletedAt` (Required) | `string (date-time)` |   |
| `metaData` (Required) | `object` |   |

#### 400

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

matchWouldOrphanCreditNote

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"matchWouldOrphanCreditNote"` |
| `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": "matchWouldOrphanCreditNote",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

**Example response**

`application/json`

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

#### 409

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

eventDateFallsInLockedPeriod

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

#### 500

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

internalServerError

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/ledger/{memberId}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "transactionIds": [
    0
  ],
  "action": "match"
}'
```

### Example response

200 · `application/json`

```json
{
  "uuid": "string",
  "isOpen": true,
  "isManualMatch": true,
  "transactions": [
    {
      "metaData": {}
    }
  ],
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "deletedAt": "2019-08-24T14:15:22Z",
  "metaData": {}
}
```

<a id="post-api-v1-ledger-memberid-summary"></a>
## Get transaction summary before matching/unmatching transactions

`POST /api/v1/ledger/{memberId}/summary`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Request body

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

Same fields as [Match transactions (Request body)](https://www.subrite.no/developers/ledger?md=true#patch-api-v1-ledger-memberid).

**Example request body**

`application/json`

```json
{
  "transactionIds": [
    0
  ],
  "action": "match"
}
```

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `transactions` (Required) | `array of TransactionWithAmount` |   |
| `transactions[].transactionId` (Required when parent is present) | `number` |   |
| `transactions[].amount` (Required when parent is present) | `number` |   |
| `transactions[].type` (Required when parent is present) | `TransactionResponseType` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `roundingAdjustmentAmount` | `number` |   |
| `transactionGroupId` | `number` |   |

#### 400

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

crossTransactionGroups

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

#### 500

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

internalServerError

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/ledger/{memberId}/summary' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "transactionIds": [
    0
  ],
  "action": "match"
}'
```

### Example response

201 · `application/json`

```json
{
  "transactions": [
    {}
  ],
  "roundingAdjustmentAmount": 0,
  "transactionGroupId": 0
}
```

<a id="patch-api-v1-ledger-memberid-transactionid"></a>
## Update transaction status of a particular transaction

`PATCH /api/v1/ledger/{memberId}/{transactionId}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `memberId` (Required) | path | `string` |   |
| `transactionId` (Required) | path | `number` |   |

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `status` | `TRANSACTION_STATUS` | Allowed values: `"ignored"` · Can be null |

**Example request body**

`application/json`

```json
{
  "status": "ignored"
}
```

### Responses

#### 200

#### 400

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

badRequest

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"` |
| `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": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get ledger of all members (403)](https://www.subrite.no/developers/ledger?md=true#post-api-v1-ledger-filter).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/ledger/{memberId}/{transactionId}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "ignored"
}'
```
