# Export

**Summary:** Endpoints for Export

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

<a id="get-api-v1-exports"></a>
## Get all exports of the tenant

`GET /api/v1/exports`

**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"` |

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `items` (Required) | `array of ExportHistoryResponse` |   |
| `items[].fileLink` (Required when parent is present) | `string` |   |
| `items[].fileName` (Required when parent is present) | `string` |   |
| `items[].status` (Required when parent is present) | `string` | Allowed values: `"started"`, `"completed"`, `"failed"`, `"queued"` |
| `items[].exportType` (Required when parent is present) | `string` | Allowed values: `"subscriptions"`, `"subscription_products"`, `"subscription_users"`, `"payments"`, `"invoices"`, `"all_members"`, `"segments"`, `"ledger"`, `"delivery_address"`, `"ar_invoice_report"`, `"ar_invoice_summary_report"`, `"survey_responses"` |
| `items[].systemGenerated` (Required when parent is present) | `boolean` |   |
| `items[].adminUserId` (Required when parent is present) | `number` |   |
| `items[].tenantId` (Required when parent is present) | `number` |   |
| `items[].adminUser` (Required when parent is present) | `User` |   |
| `items[].adminUser.userType` (Required when parent is present) | `string` | Allowed values: `"system_admin"`, `"tenant_admin"`, `"member"`, `"not_set"` |
| `items[].adminUser.tenantId` (Required when parent is present) | `number` |   |
| `items[].adminUser.email` (Required when parent is present) | `string` | Can be null |
| `items[].adminUser.fullName` (Required when parent is present) | `string` |   |
| `items[].adminUser.phone` (Required when parent is present) | `string` |   |
| `items[].adminUser.emailVerified` (Required when parent is present) | `string` | Can be null |
| `items[].adminUser.phoneVerified` (Required when parent is present) | `boolean` |   |
| `items[].adminUser.isOwner` (Required when parent is present) | `boolean` |   |
| `items[].adminUser.isTestUser` (Required when parent is present) | `boolean` |   |
| `items[].adminUser.image` (Required when parent is present) | `string` |   |
| `items[].adminUser.createdInCheckoutUuid` (Required when parent is present) | `string` |   |
| `items[].adminUser.userRoles` | `array of UserRole` | Nested fields omitted: depth limit. |
| `items[].adminUser.notes` (Required when parent is present) | `array of Note` | Nested fields omitted: depth limit. |
| `items[].adminUser.exportHistory` (Required when parent is present) | `array of ExportHistory` | Nested fields omitted: depth limit. |
| `items[].adminUser.userSettings` | `UserSettings` | Nested fields omitted: depth limit. |
| `items[].adminUser.member` | `Member` | Nested fields omitted: depth limit. |
| `items[].adminUser.tenant` (Required when parent is present) | `Tenant` | Nested fields omitted: depth limit. |
| `items[].adminUser.userAccounts` (Required when parent is present) | `array of UserAccount` | Nested fields omitted: depth limit. |
| `items[].adminUser.userSessions` (Required when parent is present) | `array of UserSession` | Nested fields omitted: depth limit. |
| `items[].adminUser.id` (Required when parent is present) | `number` |   |
| `items[].adminUser.createdAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].adminUser.updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].adminUser.deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].adminUser.metaData` (Required when parent is present) | `object` |   |
| `items[].tenant` (Required when parent is present) | `Tenant` | Nested fields omitted: field limit. |
| `items[].id` (Required when parent is present) | `number` |   |
| `items[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].metaData` (Required when parent is present) | `object` |   |
| `items[].createdBy` (Required when parent is present) | `string` |   |
| `items[].refreshStatus` (Required when parent is present) | `boolean` |   |
| `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` |   |

#### 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

| 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 all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

### Example request

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

### Example response

200 · `application/json`

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

<a id="get-api-v1-exports-list-export-fields"></a>
## Get the dynamic fields (custom properties and consents) selectable for list export

`GET /api/v1/exports/list-export-fields`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `customProperties` (Required) | `array of ListExportFieldDto` |   |
| `customProperties[].key` (Required when parent is present) | `string` | Export header key (column id) for this field. |
| `customProperties[].label` (Required when parent is present) | `string` | Human-readable label for the field. |
| `consents` (Required) | `array of ListExportFieldDto` |   |
| `consents[].key` (Required when parent is present) | `string` | Export header key (column id) for this field. |
| `consents[].label` (Required when parent is present) | `string` | Human-readable label for the field. |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/list-export-fields \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "customProperties": [
    {}
  ],
  "consents": [
    {}
  ]
}
```

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

`GET /api/v1/exports/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

#### 400

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

badRequest, exportFormatUnsupported

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"`, `"exportFormatUnsupported"` |
| `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 all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 404

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

exportNotFound

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

#### 409

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

exportNotCompleted, exportFileUnavailable

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 502

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

exportFileDownloadFailed

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

### Example request

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

<a id="post-api-v1-exports-member-package"></a>
## Generate subscription report as a csv file

`POST /api/v1/exports/member-package`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `nextRenewalDateFrom` | query | `string (date-time)` |   |
| `nextRenewalDateTo` | query | `string (date-time)` |   |
| `status` | query | `array of string` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |
| `paymentProvider` | query | `array of string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `subscriptionPlanId` | query | `array of number` |   |
| `productId` | query | `array of number` |   |

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `message` (Required) | `string` | Human-readable confirmation that the export was queued. |
| `exportHistoryId` (Required) | `number` | Id of the export history row tracking this run. |

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/member-package \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-member-package-products"></a>
## Generate subscription products report as a csv file

`POST /api/v1/exports/member-package-products`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `nextRenewalDateFrom` | query | `string (date-time)` |   |
| `nextRenewalDateTo` | query | `string (date-time)` |   |
| `status` | query | `array of string` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |
| `paymentProvider` | query | `array of string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `subscriptionPlanId` | query | `array of number` |   |
| `productId` | query | `array of number` |   |

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/member-package-products \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-payments"></a>
## Generate payment and refund report as a csv file

`POST /api/v1/exports/payments`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `dateFrom` | query | `string (date-time)` |   |
| `dateTo` | query | `string (date-time)` |   |
| `transactionType` | query | `PaymentAndRefundType` | Allowed values: `"payment"`, `"refund"`, `"rounding_adjustment"` |

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/payments \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-invoices"></a>
## Generate invoice report as a csv file

`POST /api/v1/exports/invoices`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `dateFrom` | query | `string (date-time)` |   |
| `dateTo` | query | `string (date-time)` |   |
| `invoiceType` | query | `InvoiceType` | Allowed values: `"invoice"`, `"creditNote"` |
| `accountingDate` | query | `string (date-time)` |   |

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/invoices \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-member-package-users"></a>
## Generate subscription products and group members report as a csv file

`POST /api/v1/exports/member-package-users`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `nextRenewalDateFrom` | query | `string (date-time)` |   |
| `nextRenewalDateTo` | query | `string (date-time)` |   |
| `status` | query | `array of string` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |
| `paymentProvider` | query | `array of string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `subscriptionPlanId` | query | `array of number` |   |
| `productId` | query | `array of number` |   |

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/member-package-users \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-delivery-address"></a>
## Generate delivery address report as a csv file

`POST /api/v1/exports/delivery-address`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `nextRenewalDateFrom` | query | `string (date-time)` |   |
| `nextRenewalDateTo` | query | `string (date-time)` |   |
| `status` | query | `array of string` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |
| `shippingProvider` | query | `array of string` | Allowed values: `"Helthjem"`, `"Bring - Posten"`, `"Distribution Innovation"` |
| `productId` | query | `array of number` |   |

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/delivery-address \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-members"></a>
## Generate all members report as a csv file

`POST /api/v1/exports/members`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `joinedDateFrom` | query | `string (date-time)` |   |
| `joinedDateTo` | query | `string (date-time)` |   |
| `includeRevenue` | query | `boolean` |   |
| `includeActiveDays` | query | `boolean` |   |

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/members \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-segments"></a>
## Generate segment report as a csv file

`POST /api/v1/exports/segments`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `segmentId` (Required) | `number` | `minimum`: `1` |
| `fileName` (Required) | `string` | `maxLength`: `255` |
| `fields` (Required) | `array of string` | Export header keys to include as columns (selected fields). · `minItems`: `1` |

**Example request body**

`application/json`

```json
{
  "segmentId": 1,
  "fileName": "string",
  "fields": [
    "string"
  ]
}
```

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 404

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

segmentNotFound

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/segments \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "segmentId": 1,
  "fileName": "string",
  "fields": [
    "string"
  ]
}'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-ledger"></a>
## Generate ledger report as a csv file

`POST /api/v1/exports/ledger`

**Authentication:** Bearer token (JWT)

### Request body

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

| 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

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl https://api.subrite.no/api/v1/exports/ledger \
  --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

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```

<a id="post-api-v1-exports-survey-responses"></a>
## Generate survey responses report as a csv file

`POST /api/v1/exports/survey-responses`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `surveyId` (Required) | query | `string (uuid)` | UUID of the survey to export responses for |

### Responses

#### 201

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

Same fields as [Generate subscription report as a csv file (201)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

#### 400

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

badRequest

Same fields as [Get all exports of the tenant (400)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

**Example response**

`application/json`

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

#### 404

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

surveyNotFound

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

#### 500

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

internalServerError

Same fields as [Get all exports of the tenant (403)](https://www.subrite.no/developers/export?md=true#get-api-v1-exports).

#### 503

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

exportQueueFailed

Same fields as [Generate subscription report as a csv file (503)](https://www.subrite.no/developers/export?md=true#post-api-v1-exports-member-package).

**Example response**

`application/json`

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

### Example request

```bash
curl 'https://api.subrite.no/api/v1/exports/survey-responses?surveyId=%3CsurveyId%3E' \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "message": "string",
  "exportHistoryId": 0
}
```
