# Invoice

**Summary:** Endpoints for Invoice

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

<a id="post-api-v1-invoices-filter"></a>
## Get filtered invoices of the tenant

`POST /api/v1/invoices/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 · `InvoiceFilter`

| Name | Type | Description |
| --- | --- | --- |
| `invoiceStatus` | `array of INVOICE_STATUS` | Allowed values: `"paid"`, `"unpaid"`, `"over-due"`, `"over-paid"`, `"partially-paid"`, `"refunded"`, `"credited"`, `"partially-credited"` |
| `invoiceNumber` | `number` |   |
| `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` |   |
| `deliveryStatus` | `array of INVOICE_DELIVERY_STATUS` | Allowed values: `"sent_via_einvoice"`, `"sent_via_email"`, `"sent_via_sms"`, `"sent_via_payment_gateway"`, `"sent_manually"`, `"in_progress"`, `"not_sent"` |
| `types` | `array of TransactionResponseType` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `memberPackageStatus` | `array of MEMBER_PACKAGE_STATUS` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |

**Example request body**

`application/json`

```json
{
  "invoiceStatus": [
    "paid"
  ],
  "invoiceNumber": 0,
  "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
  },
  "deliveryStatus": [
    "sent_via_einvoice"
  ],
  "types": [
    "payment"
  ],
  "memberPackageStatus": [
    "active"
  ]
}
```

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `items` (Required) | `array of InvoiceResponse` |   |
| `items[].id` (Required when parent is present) | `number` |   |
| `items[].type` (Required when parent is present) | `TransactionResponseType` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `items[].invoiceNo` (Required when parent is present) | `number` |   |
| `items[].invoiceDate` (Required when parent is present) | `string (date-time)` |   |
| `items[].packName` (Required when parent is present) | `string` |   |
| `items[].memberPackageId` (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[].totalAmount` (Required when parent is present) | `number` |   |
| `items[].status` (Required when parent is present) | `INVOICE_STATUS` | Allowed values: `"paid"`, `"unpaid"`, `"over-due"`, `"over-paid"`, `"partially-paid"`, `"refunded"`, `"credited"`, `"partially-credited"` |
| `items[].memberPackageStatus` | `MEMBER_PACKAGE_STATUS` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |
| `items[].deliveryStatus` | `INVOICE_DELIVERY_STATUS` | Allowed values: `"sent_via_einvoice"`, `"sent_via_email"`, `"sent_via_sms"`, `"sent_via_payment_gateway"`, `"sent_manually"`, `"in_progress"`, `"not_sent"` |
| `items[].isCreditNote` (Required when parent is present) | `boolean` |   |
| `items[].referencedInvoiceNumber` | `number` |   |
| `items[].kid` (Required when parent is present) | `string` |   |
| `items[].note` (Required when parent is present) | `string` |   |
| `items[].paymentProvider` (Required when parent is present) | `PAYMENT_PROVIDER` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `items[].memberNumber` (Required when parent is present) | `number` |   |
| `items[].invoiceDueDate` | `string (date-time)` |   |
| `items[].orderId` (Required when parent is present) | `number` |   |
| `items[].autoGenerated` (Required when parent is present) | `boolean` |   |
| `items[].creditNoteNumbers` | `array of number` | Numbers of the credit notes referencing this invoice. Only populated by endpoints that load credit notes (currently the member invoice list); undefined elsewhere does not mean nothing was credited. |
| `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 filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/filter \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoiceStatus": [
    "paid"
  ],
  "invoiceNumber": 0,
  "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
  },
  "deliveryStatus": [
    "sent_via_einvoice"
  ],
  "types": [
    "payment"
  ],
  "memberPackageStatus": [
    "active"
  ]
}'
```

### Example response

200 · `application/json`

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

<a id="post-api-v1-invoices-credit-note"></a>
## Create a credit note for a member

`POST /api/v1/invoices/credit-note`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `memberId` (Required) | `string` |   |
| `referenceInvoiceNumber` | `number` |   |
| `orderLines` | `array of CreditNoteOrderItem` |   |
| `orderLines[].productId` | `number` |   |
| `orderLines[].quantity` (Required when parent is present) | `number` |   |
| `orderLines[].amount` (Required when parent is present) | `number` |   |
| `orderLines[].orderItemId` | `number` |   |
| `note` | `string` |   |
| `creditFullAmount` | `boolean` |   |
| `accountingDate` (Required) | `string (date-time)` |   |

**Example request body**

`application/json`

```json
{
  "memberId": "string",
  "referenceInvoiceNumber": 0,
  "note": "string",
  "creditFullAmount": true,
  "accountingDate": "2019-08-24T14:15:22Z"
}
```

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `status` (Required) | `INVOICE_STATUS` | Allowed values: `"paid"`, `"unpaid"`, `"over-due"`, `"over-paid"`, `"partially-paid"`, `"refunded"`, `"credited"`, `"partially-credited"` |
| `deliveryStatus` (Required) | `INVOICE_DELIVERY_STATUS` | Allowed values: `"sent_via_einvoice"`, `"sent_via_email"`, `"sent_via_sms"`, `"sent_via_payment_gateway"`, `"sent_manually"`, `"in_progress"`, `"not_sent"` |
| `remainingAmount` (Required) | `number` |   |
| `totalTaxAmount` (Required) | `number` |   |
| `taxExclusiveAmount` (Required) | `number` |   |
| `invoiceNumber` (Required) | `number` |   |
| `language` (Required) | `string` | Allowed values: `"en"`, `"no"`, `"sv"`, `"da"` |
| `packName` (Required) | `string` |   |
| `planName` (Required) | `string` |   |
| `autoGenerated` (Required) | `boolean` |   |
| `periodStartDate` (Required) | `string (date-time)` |   |
| `periodEndDate` (Required) | `string (date-time)` |   |
| `memberInfo` (Required) | `MemberInfo` |   |
| `memberInfo.fullName` (Required) | `string` |   |
| `memberInfo.email` (Required) | `string` |   |
| `memberInfo.phone` (Required) | `string` |   |
| `memberInfo.isCompany` (Required) | `boolean` |   |
| `memberInfo.companyName` (Required) | `string` |   |
| `memberInfo.organizationNo` (Required) | `string` |   |
| `addressInfo` (Required) | `AddressInfo` |   |
| `addressInfo.line1` (Required) | `string` |   |
| `addressInfo.line2` (Required) | `string` |   |
| `addressInfo.city` (Required) | `string` |   |
| `addressInfo.state` (Required) | `string` |   |
| `addressInfo.postCode` (Required) | `string` |   |
| `addressInfo.country` (Required) | `string` |   |
| `addressInfo.name` | `string` |   |
| `addressInfo.addressType` (Required) | `string` | Allowed values: `"primary"`, `"delivery"`, `"billing"`, `"not_set"` |
| `addressInfo.invoiceReference` (Required) | `string` |   |
| `addressInfo.companyName` (Required) | `string` |   |
| `addressInfo.organizationNo` (Required) | `string` |   |
| `addressInfo.email` (Required) | `string` |   |
| `addressInfo.phone` (Required) | `string` |   |
| `tenantInfo` (Required) | `TenantInfo` | Nested fields omitted: field limit. |
| `orderNumber` (Required) | `number` |   |
| `orderItemInfo` (Required) | `array of OrderItemInfo` |   |
| `orderItemInfo[].name` (Required when parent is present) | `string` |   |
| `orderItemInfo[].price` (Required when parent is present) | `number` |   |
| `orderItemInfo[].tax` (Required when parent is present) | `number` |   |
| `orderItemInfo[].quantity` (Required when parent is present) | `number` |   |
| `taxGroupInfo` (Required) | `array of TaxGroupInfo` |   |
| `taxGroupInfo[].taxRate` (Required when parent is present) | `number` |   |
| `taxGroupInfo[].baseAmount` (Required when parent is present) | `number` |   |
| `taxGroupInfo[].taxAmount` (Required when parent is present) | `number` |   |
| `paymentProvider` (Required) | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `paymentMethod` (Required) | `string` | Allowed values: `"card"`, `"vipps"`, `"manual_registration"`, `"efaktura"`, `"ehf"`, `"avtalegiro"` |
| `amount` (Required) | `number` |   |
| `paidAmount` (Required) | `number` |   |
| `dueDate` (Required) | `string (date-time)` |   |
| `paymentDate` (Required) | `string (date-time)` |   |
| `accountingDate` (Required) | `string (date-time)` |   |
| `currency` (Required) | `string` |   |
| `tenantId` (Required) | `number` |   |
| `order` (Required) | `Order` | Nested fields omitted: field limit. |
| `eInvoicePayment` (Required) | `EInvoicePayment` | Nested fields omitted: field limit. |
| `member` (Required) | `Member` | Nested fields omitted: field limit. |
| `tenant` (Required) | `Tenant` | Nested fields omitted: field limit. |
| `refunds` (Required) | `array of Refund` | Nested fields omitted: field limit. |
| `isCreditNote` (Required) | `boolean` |   |
| `note` (Required) | `string` |   |
| `referencedInvoiceNumber` (Required) | `number` |   |
| `referencedInvoiceId` (Required) | `number` |   |
| `referencedInvoice` (Required) | `Invoice` | Recursive schema; nested fields are not repeated. |
| `creditNotes` (Required) | `array of Invoice` | Recursive schema; nested fields are not repeated. |
| `payments` (Required) | `array of Payment` | Nested fields omitted: field limit. |
| `transaction` (Required) | `Transaction` | Nested fields omitted: field limit. |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `deletedAt` (Required) | `string (date-time)` |   |
| `metaData` (Required) | `object` |   |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 409

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

eventDateFallsInLockedPeriod

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/credit-note \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "memberId": "string",
  "referenceInvoiceNumber": 0,
  "orderLines": [
    {}
  ],
  "note": "string",
  "creditFullAmount": true,
  "accountingDate": "2019-08-24T14:15:22Z"
}'
```

### Example response

201 · `application/json`

```json
{
  "status": "paid",
  "deliveryStatus": "sent_via_einvoice",
  "remainingAmount": 0,
  "totalTaxAmount": 0,
  "taxExclusiveAmount": 0,
  "invoiceNumber": 0,
  "language": "en",
  "packName": "string",
  "planName": "string",
  "autoGenerated": true,
  "periodStartDate": "2019-08-24T14:15:22Z",
  "periodEndDate": "2019-08-24T14:15:22Z",
  "memberInfo": {
    "fullName": "<fullName>",
    "email": "string",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string"
  },
  "addressInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>"
  },
  "tenantInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>",
    "tenantName": "string",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "invoiceLogo": "string"
  },
  "orderNumber": 0,
  "orderItemInfo": [
    {}
  ],
  "taxGroupInfo": [
    {}
  ],
  "paymentProvider": "stripe",
  "paymentMethod": "card",
  "amount": 0,
  "paidAmount": 0,
  "dueDate": "2019-08-24T14:15:22Z",
  "paymentDate": "2019-08-24T14:15:22Z",
  "accountingDate": "2019-08-24T14:15:22Z",
  "currency": "string",
  "tenantId": 0,
  "order": {
    "orderNumber": 0,
    "memberPackageId": 0,
    "recurringPriceAtOrder": 0,
    "paymentId": 0,
    "paymentToken": "<paymentToken>",
    "type": "initial",
    "orderItems": [],
    "payment": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "invoice": {},
    "tenantId": 0,
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "memberPackageChange": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "eInvoicePayment": {
    "kid": "string",
    "status": "PENDING",
    "channel": "Efaktura 2.0",
    "summary": "string",
    "xml": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "member": {
    "userId": 0,
    "memberNumber": 0,
    "tenantId": 0,
    "externalId": "string",
    "fullName": "<fullName>",
    "nickName": "string",
    "avatar": "string",
    "email": "string",
    "birthDate": "<birthDate>",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "deleteAfterExpiration": true,
    "customPropertyValues": {},
    "productRecipients": [],
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "tenant": {
    "market": "NO",
    "productName": "enterprise",
    "additionalFeatures": [],
    "disabledFeatures": [],
    "name": "string",
    "isActive": true,
    "defaultLanguage": "en",
    "hostName": "string",
    "logo": "string",
    "favicon": "string",
    "authLogo": "string",
    "authLogoHeight": 0,
    "siteUrl": "string",
    "termsUrl": "string",
    "privacyUrl": "string",
    "gtm": "string",
    "taxRates": [],
    "smsOtp": true,
    "emailProvider": "brevo",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "defaultLogoutURL": "string",
    "postalAddress": "<postalAddress>",
    "otpTemplateId": {},
    "smsSenderId": 0,
    "emailSenderId": 0,
    "smsSender": {
      "metaData": {}
    },
    "emailSender": {
      "metaData": {}
    },
    "products": [],
    "users": [],
    "members": [],
    "roles": [],
    "subscriptionPlans": [],
    "packages": [],
    "invoices": [],
    "orders": [],
    "paymentProviders": [],
    "newslettersProviderConfig": [],
    "paymentProviderConfigs": [],
    "oidcClients": [],
    "oauthProviders": [],
    "activityLogs": [],
    "m2m_api_clients": [],
    "customProperties": [],
    "consents": [],
    "preference": {
      "inputFieldConfig": [],
      "customFieldsOnMemberCard": [],
      "customFieldsOnInvoice": [],
      "visibleAdditionalFieldsOnMypage": [],
      "metaData": {}
    },
    "settings": {
      "aiResidency": {},
      "metaData": {}
    },
    "communicationTemplates": [],
    "additionalHostnames": [],
    "exportHistory": [],
    "arReportHistory": [],
    "mypageCardsSettings": [],
    "webhooks": [],
    "customOrders": [],
    "customOrderSources": [],
    "brandKits": [],
    "communicationReceivers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "refunds": [
    {
      "metaData": {}
    }
  ],
  "isCreditNote": true,
  "note": "string",
  "referencedInvoiceNumber": 0,
  "referencedInvoiceId": 0,
  "referencedInvoice": {},
  "creditNotes": [
    {}
  ],
  "payments": [
    {
      "metaData": {}
    }
  ],
  "transaction": {
    "transactionGroupId": 0,
    "type": "payment",
    "memberPackageId": 0,
    "amount": 0,
    "reference": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "refundId": 0,
    "accountingDate": "2019-08-24T14:15:22Z",
    "status": "ignored",
    "tenantId": 0,
    "memberId": "string",
    "transactionGroup": {
      "transactions": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "refund": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "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-invoices-create-invoice"></a>
## Create a standalone invoice for a member

`POST /api/v1/invoices/create-invoice`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `memberId` (Required) | `string` |   |
| `orderLines` (Required) | `array of InvoiceOrderItem` |   |
| `orderLines[].productId` (Required when parent is present) | `number` |   |
| `orderLines[].quantity` (Required when parent is present) | `number` |   |
| `orderLines[].amount` (Required when parent is present) | `number` |   |
| `accountingDate` (Required) | `string (date-time)` |   |
| `note` | `string` |   |

### Responses

#### 201

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

Same fields as [Create a credit note for a member (201)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-credit-note).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 409

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

eventDateFallsInLockedPeriod

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/create-invoice \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "memberId": "string",
  "orderLines": [
    {}
  ],
  "accountingDate": "2019-08-24T14:15:22Z",
  "note": "string"
}'
```

### Example response

201 · `application/json`

```json
{
  "status": "paid",
  "deliveryStatus": "sent_via_einvoice",
  "remainingAmount": 0,
  "totalTaxAmount": 0,
  "taxExclusiveAmount": 0,
  "invoiceNumber": 0,
  "language": "en",
  "packName": "string",
  "planName": "string",
  "autoGenerated": true,
  "periodStartDate": "2019-08-24T14:15:22Z",
  "periodEndDate": "2019-08-24T14:15:22Z",
  "memberInfo": {
    "fullName": "<fullName>",
    "email": "string",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string"
  },
  "addressInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>"
  },
  "tenantInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>",
    "tenantName": "string",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "invoiceLogo": "string"
  },
  "orderNumber": 0,
  "orderItemInfo": [
    {}
  ],
  "taxGroupInfo": [
    {}
  ],
  "paymentProvider": "stripe",
  "paymentMethod": "card",
  "amount": 0,
  "paidAmount": 0,
  "dueDate": "2019-08-24T14:15:22Z",
  "paymentDate": "2019-08-24T14:15:22Z",
  "accountingDate": "2019-08-24T14:15:22Z",
  "currency": "string",
  "tenantId": 0,
  "order": {
    "orderNumber": 0,
    "memberPackageId": 0,
    "recurringPriceAtOrder": 0,
    "paymentId": 0,
    "paymentToken": "<paymentToken>",
    "type": "initial",
    "orderItems": [],
    "payment": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "invoice": {},
    "tenantId": 0,
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "memberPackageChange": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "eInvoicePayment": {
    "kid": "string",
    "status": "PENDING",
    "channel": "Efaktura 2.0",
    "summary": "string",
    "xml": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "member": {
    "userId": 0,
    "memberNumber": 0,
    "tenantId": 0,
    "externalId": "string",
    "fullName": "<fullName>",
    "nickName": "string",
    "avatar": "string",
    "email": "string",
    "birthDate": "<birthDate>",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "deleteAfterExpiration": true,
    "customPropertyValues": {},
    "productRecipients": [],
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "tenant": {
    "market": "NO",
    "productName": "enterprise",
    "additionalFeatures": [],
    "disabledFeatures": [],
    "name": "string",
    "isActive": true,
    "defaultLanguage": "en",
    "hostName": "string",
    "logo": "string",
    "favicon": "string",
    "authLogo": "string",
    "authLogoHeight": 0,
    "siteUrl": "string",
    "termsUrl": "string",
    "privacyUrl": "string",
    "gtm": "string",
    "taxRates": [],
    "smsOtp": true,
    "emailProvider": "brevo",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "defaultLogoutURL": "string",
    "postalAddress": "<postalAddress>",
    "otpTemplateId": {},
    "smsSenderId": 0,
    "emailSenderId": 0,
    "smsSender": {
      "metaData": {}
    },
    "emailSender": {
      "metaData": {}
    },
    "products": [],
    "users": [],
    "members": [],
    "roles": [],
    "subscriptionPlans": [],
    "packages": [],
    "invoices": [],
    "orders": [],
    "paymentProviders": [],
    "newslettersProviderConfig": [],
    "paymentProviderConfigs": [],
    "oidcClients": [],
    "oauthProviders": [],
    "activityLogs": [],
    "m2m_api_clients": [],
    "customProperties": [],
    "consents": [],
    "preference": {
      "inputFieldConfig": [],
      "customFieldsOnMemberCard": [],
      "customFieldsOnInvoice": [],
      "visibleAdditionalFieldsOnMypage": [],
      "metaData": {}
    },
    "settings": {
      "aiResidency": {},
      "metaData": {}
    },
    "communicationTemplates": [],
    "additionalHostnames": [],
    "exportHistory": [],
    "arReportHistory": [],
    "mypageCardsSettings": [],
    "webhooks": [],
    "customOrders": [],
    "customOrderSources": [],
    "brandKits": [],
    "communicationReceivers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "refunds": [
    {
      "metaData": {}
    }
  ],
  "isCreditNote": true,
  "note": "string",
  "referencedInvoiceNumber": 0,
  "referencedInvoiceId": 0,
  "referencedInvoice": {},
  "creditNotes": [
    {}
  ],
  "payments": [
    {
      "metaData": {}
    }
  ],
  "transaction": {
    "transactionGroupId": 0,
    "type": "payment",
    "memberPackageId": 0,
    "amount": 0,
    "reference": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "refundId": 0,
    "accountingDate": "2019-08-24T14:15:22Z",
    "status": "ignored",
    "tenantId": 0,
    "memberId": "string",
    "transactionGroup": {
      "transactions": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "refund": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "deletedAt": "2019-08-24T14:15:22Z",
  "metaData": {}
}
```

<a id="get-api-v1-invoices-invoicenumber-member-memberid"></a>
## Get an invoice of a member by invoiceNumber

`GET /api/v1/invoices/{invoiceNumber}/member/{memberId}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

Same fields as [Create a credit note for a member (201)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-credit-note).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

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

### Example response

200 · `application/json`

```json
{
  "status": "paid",
  "deliveryStatus": "sent_via_einvoice",
  "remainingAmount": 0,
  "totalTaxAmount": 0,
  "taxExclusiveAmount": 0,
  "invoiceNumber": 0,
  "language": "en",
  "packName": "string",
  "planName": "string",
  "autoGenerated": true,
  "periodStartDate": "2019-08-24T14:15:22Z",
  "periodEndDate": "2019-08-24T14:15:22Z",
  "memberInfo": {
    "fullName": "<fullName>",
    "email": "string",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string"
  },
  "addressInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>"
  },
  "tenantInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>",
    "tenantName": "string",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "invoiceLogo": "string"
  },
  "orderNumber": 0,
  "orderItemInfo": [
    {}
  ],
  "taxGroupInfo": [
    {}
  ],
  "paymentProvider": "stripe",
  "paymentMethod": "card",
  "amount": 0,
  "paidAmount": 0,
  "dueDate": "2019-08-24T14:15:22Z",
  "paymentDate": "2019-08-24T14:15:22Z",
  "accountingDate": "2019-08-24T14:15:22Z",
  "currency": "string",
  "tenantId": 0,
  "order": {
    "orderNumber": 0,
    "memberPackageId": 0,
    "recurringPriceAtOrder": 0,
    "paymentId": 0,
    "paymentToken": "<paymentToken>",
    "type": "initial",
    "orderItems": [],
    "payment": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "invoice": {},
    "tenantId": 0,
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "memberPackageChange": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "eInvoicePayment": {
    "kid": "string",
    "status": "PENDING",
    "channel": "Efaktura 2.0",
    "summary": "string",
    "xml": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "member": {
    "userId": 0,
    "memberNumber": 0,
    "tenantId": 0,
    "externalId": "string",
    "fullName": "<fullName>",
    "nickName": "string",
    "avatar": "string",
    "email": "string",
    "birthDate": "<birthDate>",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "deleteAfterExpiration": true,
    "customPropertyValues": {},
    "productRecipients": [],
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "tenant": {
    "market": "NO",
    "productName": "enterprise",
    "additionalFeatures": [],
    "disabledFeatures": [],
    "name": "string",
    "isActive": true,
    "defaultLanguage": "en",
    "hostName": "string",
    "logo": "string",
    "favicon": "string",
    "authLogo": "string",
    "authLogoHeight": 0,
    "siteUrl": "string",
    "termsUrl": "string",
    "privacyUrl": "string",
    "gtm": "string",
    "taxRates": [],
    "smsOtp": true,
    "emailProvider": "brevo",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "defaultLogoutURL": "string",
    "postalAddress": "<postalAddress>",
    "otpTemplateId": {},
    "smsSenderId": 0,
    "emailSenderId": 0,
    "smsSender": {
      "metaData": {}
    },
    "emailSender": {
      "metaData": {}
    },
    "products": [],
    "users": [],
    "members": [],
    "roles": [],
    "subscriptionPlans": [],
    "packages": [],
    "invoices": [],
    "orders": [],
    "paymentProviders": [],
    "newslettersProviderConfig": [],
    "paymentProviderConfigs": [],
    "oidcClients": [],
    "oauthProviders": [],
    "activityLogs": [],
    "m2m_api_clients": [],
    "customProperties": [],
    "consents": [],
    "preference": {
      "inputFieldConfig": [],
      "customFieldsOnMemberCard": [],
      "customFieldsOnInvoice": [],
      "visibleAdditionalFieldsOnMypage": [],
      "metaData": {}
    },
    "settings": {
      "aiResidency": {},
      "metaData": {}
    },
    "communicationTemplates": [],
    "additionalHostnames": [],
    "exportHistory": [],
    "arReportHistory": [],
    "mypageCardsSettings": [],
    "webhooks": [],
    "customOrders": [],
    "customOrderSources": [],
    "brandKits": [],
    "communicationReceivers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "refunds": [
    {
      "metaData": {}
    }
  ],
  "isCreditNote": true,
  "note": "string",
  "referencedInvoiceNumber": 0,
  "referencedInvoiceId": 0,
  "referencedInvoice": {},
  "creditNotes": [
    {}
  ],
  "payments": [
    {
      "metaData": {}
    }
  ],
  "transaction": {
    "transactionGroupId": 0,
    "type": "payment",
    "memberPackageId": 0,
    "amount": 0,
    "reference": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "refundId": 0,
    "accountingDate": "2019-08-24T14:15:22Z",
    "status": "ignored",
    "tenantId": 0,
    "memberId": "string",
    "transactionGroup": {
      "transactions": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "refund": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "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-invoices-batch-download-initiate"></a>
## Initiate a batch download of invoices

`POST /api/v1/invoices/batch-download/initiate`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `invoiceNumbers` | `array of number` |   |
| `filter` | `InvoiceFilter` |   |
| `filter.invoiceStatus` | `array of INVOICE_STATUS` | Allowed values: `"paid"`, `"unpaid"`, `"over-due"`, `"over-paid"`, `"partially-paid"`, `"refunded"`, `"credited"`, `"partially-credited"` |
| `filter.invoiceNumber` | `number` |   |
| `filter.memberSearch` | `string` | `maxLength`: `120` |
| `filter.memberId` | `string` |   |
| `filter.memberEmail` | `string` | `maxLength`: `120` · Deprecated |
| `filter.dateFrom` | `string (date-time)` |   |
| `filter.dateTo` | `string (date-time)` |   |
| `filter.amountFilter` | `AmountFilter` |   |
| `filter.amountFilter.operator` (Required when parent is present) | `ComparisonOperator` | Allowed values: `"EQUALS"`, `"BETWEEN"`, `"GREATER_THAN"`, `"LESS_THAN"` |
| `filter.amountFilter.amount` (Required when parent is present) | `number` |   |
| `filter.amountFilter.secondAmount` | `number` |   |
| `filter.deliveryStatus` | `array of INVOICE_DELIVERY_STATUS` | Allowed values: `"sent_via_einvoice"`, `"sent_via_email"`, `"sent_via_sms"`, `"sent_via_payment_gateway"`, `"sent_manually"`, `"in_progress"`, `"not_sent"` |
| `filter.types` | `array of TransactionResponseType` | Allowed values: `"payment"`, `"refund"`, `"invoice"`, `"credit_note"`, `"rounding_adjustment"` |
| `filter.memberPackageStatus` | `array of MEMBER_PACKAGE_STATUS` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |
| `selectAll` | `boolean` |   |
| `invoiceNumbersToUpdate` | `array of number` |   |

**Example request body**

`application/json`

```json
{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}
```

### Responses

#### 201

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/batch-download/initiate \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "amountFilter": {},
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}'
```

<a id="get-api-v1-invoices-batch-download-progress-jobid"></a>
## Get the progress of a batch download of invoices

`GET /api/v1/invoices/batch-download/progress/{jobId}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `progress` (Required) | `number` |   |
| `isDone` (Required) | `boolean` |   |
| `isFailed` (Required) | `boolean` |   |
| `errorMessage` (Required) | `string` |   |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/invoices/batch-download/progress/{jobId}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "progress": 0,
  "isDone": true,
  "isFailed": true,
  "errorMessage": "string"
}
```

<a id="get-api-v1-invoices-batch-download-stream-jobid"></a>
## Redirect to a temporary download link from S3

`GET /api/v1/invoices/batch-download/stream/{jobId}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/invoices/batch-download/stream/{jobId}' \
  --header 'Authorization: Bearer <token>'
```

<a id="patch-api-v1-invoices-invoicenumber-due-date"></a>
## InvoiceController\_updateDueDate\_v1

`PATCH /api/v1/invoices/{invoiceNumber}/due-date`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `dueDate` (Required) | `string (date-time)` |   |

**Example request body**

`application/json`

```json
{
  "dueDate": "2019-08-24T14:15:22Z"
}
```

### Responses

#### 200

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/invoices/{invoiceNumber}/due-date' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "dueDate": "2019-08-24T14:15:22Z"
}'
```

<a id="patch-api-v1-invoices-batch-mark-as-sent"></a>
## InvoiceController\_batchMarkAsSent\_v1

`PATCH /api/v1/invoices/batch-mark-as-sent`

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Initiate a batch download of invoices (Request body)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-batch-download-initiate).

**Example request body**

`application/json`

```json
{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}
```

### Responses

#### 200

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/batch-mark-as-sent \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "amountFilter": {},
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}'
```

<a id="post-api-v1-invoices-batch-create-credit-notes"></a>
## Create credit notes for a batch of invoices

`POST /api/v1/invoices/batch-create-credit-notes`

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Initiate a batch download of invoices (Request body)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-batch-download-initiate).

**Example request body**

`application/json`

```json
{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}
```

### Responses

#### 201

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/batch-create-credit-notes \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "amountFilter": {},
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}'
```

<a id="post-api-v1-invoices-validate-batch-create-credit-notes"></a>
## Validate which invoices can be credited in a batch operation

`POST /api/v1/invoices/validate-batch-create-credit-notes`

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Initiate a batch download of invoices (Request body)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-batch-download-initiate).

**Example request body**

`application/json`

```json
{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}
```

### Responses

#### 201

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

| Name | Type | Description |
| --- | --- | --- |
| `validInvoiceNumbers` (Required) | `array of string` |   |
| `invalidInvoiceNumbers` (Required) | `array of string` |   |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/validate-batch-create-credit-notes \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "amountFilter": {},
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}'
```

### Example response

201 · `application/json`

```json
{
  "validInvoiceNumbers": [
    "string"
  ],
  "invalidInvoiceNumbers": [
    "string"
  ]
}
```

<a id="post-api-v1-invoices-validate-batch-mark-as-sent"></a>
## Validate which invoices can be marked as sent in a batch operation

`POST /api/v1/invoices/validate-batch-mark-as-sent`

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Initiate a batch download of invoices (Request body)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-batch-download-initiate).

**Example request body**

`application/json`

```json
{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}
```

### Responses

#### 201

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

Same fields as [Validate which invoices can be credited in a batch operation (201)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-validate-batch-create-credit-notes).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/validate-batch-mark-as-sent \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoiceNumbers": [
    0
  ],
  "filter": {
    "invoiceStatus": [],
    "invoiceNumber": 0,
    "memberSearch": "string",
    "memberId": "string",
    "memberEmail": "string",
    "dateFrom": "2019-08-24T14:15:22Z",
    "dateTo": "2019-08-24T14:15:22Z",
    "amountFilter": {},
    "deliveryStatus": [],
    "types": [],
    "memberPackageStatus": []
  },
  "selectAll": true,
  "invoiceNumbersToUpdate": [
    0
  ]
}'
```

### Example response

201 · `application/json`

```json
{
  "validInvoiceNumbers": [
    "string"
  ],
  "invalidInvoiceNumbers": [
    "string"
  ]
}
```

<a id="get-api-v1-invoices-extension-summary-for-over-payment-invoicenumber"></a>
## Get the summary of the invoice for over payment

`GET /api/v1/invoices/extension-summary-for-over-payment/{invoiceNumber}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

Same fields as [Create a credit note for a member (201)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-credit-note).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/invoices/extension-summary-for-over-payment/{invoiceNumber}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "status": "paid",
  "deliveryStatus": "sent_via_einvoice",
  "remainingAmount": 0,
  "totalTaxAmount": 0,
  "taxExclusiveAmount": 0,
  "invoiceNumber": 0,
  "language": "en",
  "packName": "string",
  "planName": "string",
  "autoGenerated": true,
  "periodStartDate": "2019-08-24T14:15:22Z",
  "periodEndDate": "2019-08-24T14:15:22Z",
  "memberInfo": {
    "fullName": "<fullName>",
    "email": "string",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string"
  },
  "addressInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>"
  },
  "tenantInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>",
    "tenantName": "string",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "invoiceLogo": "string"
  },
  "orderNumber": 0,
  "orderItemInfo": [
    {}
  ],
  "taxGroupInfo": [
    {}
  ],
  "paymentProvider": "stripe",
  "paymentMethod": "card",
  "amount": 0,
  "paidAmount": 0,
  "dueDate": "2019-08-24T14:15:22Z",
  "paymentDate": "2019-08-24T14:15:22Z",
  "accountingDate": "2019-08-24T14:15:22Z",
  "currency": "string",
  "tenantId": 0,
  "order": {
    "orderNumber": 0,
    "memberPackageId": 0,
    "recurringPriceAtOrder": 0,
    "paymentId": 0,
    "paymentToken": "<paymentToken>",
    "type": "initial",
    "orderItems": [],
    "payment": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "invoice": {},
    "tenantId": 0,
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "memberPackageChange": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "eInvoicePayment": {
    "kid": "string",
    "status": "PENDING",
    "channel": "Efaktura 2.0",
    "summary": "string",
    "xml": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "member": {
    "userId": 0,
    "memberNumber": 0,
    "tenantId": 0,
    "externalId": "string",
    "fullName": "<fullName>",
    "nickName": "string",
    "avatar": "string",
    "email": "string",
    "birthDate": "<birthDate>",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "deleteAfterExpiration": true,
    "customPropertyValues": {},
    "productRecipients": [],
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "tenant": {
    "market": "NO",
    "productName": "enterprise",
    "additionalFeatures": [],
    "disabledFeatures": [],
    "name": "string",
    "isActive": true,
    "defaultLanguage": "en",
    "hostName": "string",
    "logo": "string",
    "favicon": "string",
    "authLogo": "string",
    "authLogoHeight": 0,
    "siteUrl": "string",
    "termsUrl": "string",
    "privacyUrl": "string",
    "gtm": "string",
    "taxRates": [],
    "smsOtp": true,
    "emailProvider": "brevo",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "defaultLogoutURL": "string",
    "postalAddress": "<postalAddress>",
    "otpTemplateId": {},
    "smsSenderId": 0,
    "emailSenderId": 0,
    "smsSender": {
      "metaData": {}
    },
    "emailSender": {
      "metaData": {}
    },
    "products": [],
    "users": [],
    "members": [],
    "roles": [],
    "subscriptionPlans": [],
    "packages": [],
    "invoices": [],
    "orders": [],
    "paymentProviders": [],
    "newslettersProviderConfig": [],
    "paymentProviderConfigs": [],
    "oidcClients": [],
    "oauthProviders": [],
    "activityLogs": [],
    "m2m_api_clients": [],
    "customProperties": [],
    "consents": [],
    "preference": {
      "inputFieldConfig": [],
      "customFieldsOnMemberCard": [],
      "customFieldsOnInvoice": [],
      "visibleAdditionalFieldsOnMypage": [],
      "metaData": {}
    },
    "settings": {
      "aiResidency": {},
      "metaData": {}
    },
    "communicationTemplates": [],
    "additionalHostnames": [],
    "exportHistory": [],
    "arReportHistory": [],
    "mypageCardsSettings": [],
    "webhooks": [],
    "customOrders": [],
    "customOrderSources": [],
    "brandKits": [],
    "communicationReceivers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "refunds": [
    {
      "metaData": {}
    }
  ],
  "isCreditNote": true,
  "note": "string",
  "referencedInvoiceNumber": 0,
  "referencedInvoiceId": 0,
  "referencedInvoice": {},
  "creditNotes": [
    {}
  ],
  "payments": [
    {
      "metaData": {}
    }
  ],
  "transaction": {
    "transactionGroupId": 0,
    "type": "payment",
    "memberPackageId": 0,
    "amount": 0,
    "reference": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "refundId": 0,
    "accountingDate": "2019-08-24T14:15:22Z",
    "status": "ignored",
    "tenantId": 0,
    "memberId": "string",
    "transactionGroup": {
      "transactions": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "refund": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "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-invoices-create-invoice-for-over-payment"></a>
## Create an invoice for over payment and extend the subscription

`POST /api/v1/invoices/create-invoice-for-over-payment`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `orderLines` (Required) | `array of CreditNoteOrderItem` |   |
| `orderLines[].productId` | `number` |   |
| `orderLines[].quantity` (Required when parent is present) | `number` |   |
| `orderLines[].amount` (Required when parent is present) | `number` |   |
| `orderLines[].orderItemId` | `number` |   |
| `referenceInvoiceNumber` (Required) | `number` |   |
| `periodStartDate` (Required) | `string (date-time)` |   |
| `periodEndDate` (Required) | `string (date-time)` |   |
| `amount` (Required) | `number` |   |
| `note` | `string` |   |

### Responses

#### 201

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

Same fields as [Create a credit note for a member (201)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-credit-note).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Get filtered invoices of the tenant (403)](https://www.subrite.no/developers/invoice?md=true#post-api-v1-invoices-filter).

### Example request

```bash
curl https://api.subrite.no/api/v1/invoices/create-invoice-for-over-payment \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "orderLines": [
    {}
  ],
  "referenceInvoiceNumber": 0,
  "periodStartDate": "2019-08-24T14:15:22Z",
  "periodEndDate": "2019-08-24T14:15:22Z",
  "amount": 0,
  "note": "string"
}'
```

### Example response

201 · `application/json`

```json
{
  "status": "paid",
  "deliveryStatus": "sent_via_einvoice",
  "remainingAmount": 0,
  "totalTaxAmount": 0,
  "taxExclusiveAmount": 0,
  "invoiceNumber": 0,
  "language": "en",
  "packName": "string",
  "planName": "string",
  "autoGenerated": true,
  "periodStartDate": "2019-08-24T14:15:22Z",
  "periodEndDate": "2019-08-24T14:15:22Z",
  "memberInfo": {
    "fullName": "<fullName>",
    "email": "string",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string"
  },
  "addressInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>"
  },
  "tenantInfo": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postCode": "string",
    "country": "string",
    "name": "string",
    "addressType": "primary",
    "invoiceReference": "string",
    "companyName": "string",
    "organizationNo": "string",
    "email": "string",
    "phone": "<phone>",
    "tenantName": "string",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "invoiceLogo": "string"
  },
  "orderNumber": 0,
  "orderItemInfo": [
    {}
  ],
  "taxGroupInfo": [
    {}
  ],
  "paymentProvider": "stripe",
  "paymentMethod": "card",
  "amount": 0,
  "paidAmount": 0,
  "dueDate": "2019-08-24T14:15:22Z",
  "paymentDate": "2019-08-24T14:15:22Z",
  "accountingDate": "2019-08-24T14:15:22Z",
  "currency": "string",
  "tenantId": 0,
  "order": {
    "orderNumber": 0,
    "memberPackageId": 0,
    "recurringPriceAtOrder": 0,
    "paymentId": 0,
    "paymentToken": "<paymentToken>",
    "type": "initial",
    "orderItems": [],
    "payment": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "invoice": {},
    "tenantId": 0,
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "memberPackageChange": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "eInvoicePayment": {
    "kid": "string",
    "status": "PENDING",
    "channel": "Efaktura 2.0",
    "summary": "string",
    "xml": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "member": {
    "userId": 0,
    "memberNumber": 0,
    "tenantId": 0,
    "externalId": "string",
    "fullName": "<fullName>",
    "nickName": "string",
    "avatar": "string",
    "email": "string",
    "birthDate": "<birthDate>",
    "phone": "<phone>",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "deleteAfterExpiration": true,
    "customPropertyValues": {},
    "productRecipients": [],
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "tenant": {
    "market": "NO",
    "productName": "enterprise",
    "additionalFeatures": [],
    "disabledFeatures": [],
    "name": "string",
    "isActive": true,
    "defaultLanguage": "en",
    "hostName": "string",
    "logo": "string",
    "favicon": "string",
    "authLogo": "string",
    "authLogoHeight": 0,
    "siteUrl": "string",
    "termsUrl": "string",
    "privacyUrl": "string",
    "gtm": "string",
    "taxRates": [],
    "smsOtp": true,
    "emailProvider": "brevo",
    "tenantContact": "string",
    "registeredBusinessNo": "string",
    "bankAccountNo": "string",
    "swiftCode": "string",
    "iban": "<iban>",
    "defaultLogoutURL": "string",
    "postalAddress": "<postalAddress>",
    "otpTemplateId": {},
    "smsSenderId": 0,
    "emailSenderId": 0,
    "smsSender": {
      "metaData": {}
    },
    "emailSender": {
      "metaData": {}
    },
    "products": [],
    "users": [],
    "members": [],
    "roles": [],
    "subscriptionPlans": [],
    "packages": [],
    "invoices": [],
    "orders": [],
    "paymentProviders": [],
    "newslettersProviderConfig": [],
    "paymentProviderConfigs": [],
    "oidcClients": [],
    "oauthProviders": [],
    "activityLogs": [],
    "m2m_api_clients": [],
    "customProperties": [],
    "consents": [],
    "preference": {
      "inputFieldConfig": [],
      "customFieldsOnMemberCard": [],
      "customFieldsOnInvoice": [],
      "visibleAdditionalFieldsOnMypage": [],
      "metaData": {}
    },
    "settings": {
      "aiResidency": {},
      "metaData": {}
    },
    "communicationTemplates": [],
    "additionalHostnames": [],
    "exportHistory": [],
    "arReportHistory": [],
    "mypageCardsSettings": [],
    "webhooks": [],
    "customOrders": [],
    "customOrderSources": [],
    "brandKits": [],
    "communicationReceivers": [],
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "refunds": [
    {
      "metaData": {}
    }
  ],
  "isCreditNote": true,
  "note": "string",
  "referencedInvoiceNumber": 0,
  "referencedInvoiceId": 0,
  "referencedInvoice": {},
  "creditNotes": [
    {}
  ],
  "payments": [
    {
      "metaData": {}
    }
  ],
  "transaction": {
    "transactionGroupId": 0,
    "type": "payment",
    "memberPackageId": 0,
    "amount": 0,
    "reference": "string",
    "invoiceId": 0,
    "paymentId": 0,
    "refundId": 0,
    "accountingDate": "2019-08-24T14:15:22Z",
    "status": "ignored",
    "tenantId": 0,
    "memberId": "string",
    "transactionGroup": {
      "transactions": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "invoice": {},
    "payment": {
      "metaData": {}
    },
    "refund": {
      "metaData": {}
    },
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "deletedAt": "2019-08-24T14:15:22Z",
  "metaData": {}
}
```
