# Payment

**Summary:** Endpoints for Payment

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

<a id="post-api-v1-payment-subscription-external"></a>
## Subscribe a package via external payment

`POST /api/v1/payment/subscription/external`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `packageId` (Required) | `number` |   |
| `paidPaymentProvider` | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `paymentDate` | `string (date-time)` |   |
| `isPaid` | `boolean` |   |
| `note` | `string` |   |
| `optionalProducts` | `array of OptionalProductWithQuantity` |   |
| `optionalProducts[].productId` (Required when parent is present) | `number` | `minimum`: `1` |
| `optionalProducts[].quantity` (Required when parent is present) | `number` | `minimum`: `1` |
| `optionalProducts[].shippingCountry` | `string` | `maxLength`: `64` |
| `optionalProducts[].manualPrice` | `number` |   |
| `mainProductsWithManualPrice` | `array of MainProductWithManualPrice` |   |
| `mainProductsWithManualPrice[].productId` (Required when parent is present) | `number` |   |
| `mainProductsWithManualPrice[].manualPrice` (Required when parent is present) | `number` | `minimum`: `1` |
| `userData` (Required) | `FakturaCheckoutUser` |   |
| `userData.memberId` | `string` |   |
| `userData.email` | `string (email)` |   |
| `userData.fullName` (Required) | `string` |   |
| `userData.phone` | `string` | `maxLength`: `20` |
| `userData.countryCode` | `string` | Allowed values: `"NO"`, `"SE"`, `"DK"`, `"FI"`, `"FO"`, `"GB"` |
| `userData.isCompany` | `boolean` |   |
| `userData.companyName` | `string` |   |
| `userData.organizationNo` | `string` |   |
| `userData.reference` | `string` |   |
| `userData.onCheckoutCompletedUrl` | `string` |   |
| `userData.sourceUrl` | `string` |   |
| `userData.referrerUrl` | `string` |   |
| `billingAddress` | `BillingAddress` |   |
| `billingAddress.address` (Required when parent is present) | `string` |   |
| `billingAddress.addressTwo` | `string` |   |
| `billingAddress.companyName` | `string` |   |
| `billingAddress.organizationNo` | `string` |   |
| `billingAddress.postCode` (Required when parent is present) | `string` |   |
| `billingAddress.city` | `string` |   |
| `billingAddress.country` (Required when parent is present) | `string` |   |
| `billingAddress.invoiceReference` | `string` |   |
| `billingAddress.email` | `string` |   |
| `billingAddress.fullName` | `string` |   |
| `billingAddress.phone` | `string` |   |

**Example request body**

`application/json`

```json
{
  "packageId": 0,
  "paidPaymentProvider": "stripe",
  "paymentDate": "2019-08-24T14:15:22Z",
  "isPaid": true,
  "note": "string",
  "userData": {
    "memberId": "string",
    "email": "user@example.com",
    "fullName": "<fullName>",
    "phone": "<phone>",
    "countryCode": "NO",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "reference": "string",
    "onCheckoutCompletedUrl": "string",
    "sourceUrl": "string",
    "referrerUrl": "string"
  },
  "billingAddress": {
    "address": "<address>",
    "addressTwo": "<addressTwo>",
    "companyName": "string",
    "organizationNo": "string",
    "postCode": "string",
    "city": "string",
    "country": "string",
    "invoiceReference": "string",
    "email": "string",
    "fullName": "<fullName>",
    "phone": "<phone>"
  }
}
```

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `checkoutStateUuid` (Required) | `string` |   |
| `memberPackage` (Required) | `MemberPackage` |   |
| `memberPackage.memberId` (Required) | `string` |   |
| `memberPackage.packageId` (Required) | `number` |   |
| `memberPackage.subscriptionPlanId` (Required) | `number` |   |
| `memberPackage.recurringPrice` (Required) | `number` |   |
| `memberPackage.hasCustomPrice` (Required) | `boolean` |   |
| `memberPackage.currentPrice` (Required) | `number` |   |
| `memberPackage.status` (Required) | `string` | Allowed values: `"active"`, `"inactive"`, `"pending"`, `"paused"`, `"stopped"`, `"expired"`, `"waiting_for_activation"` |
| `memberPackage.autoRenew` (Required) | `boolean` |   |
| `memberPackage.nextRenewal` (Required) | `string (date-time)` |   |
| `memberPackage.renewalAnchorDate` (Required) | `string (date-time)` |   |
| `memberPackage.currentPeriodStart` (Required) | `string (date-time)` |   |
| `memberPackage.forcedStopDate` (Required) | `string (date-time)` |   |
| `memberPackage.cancelledAt` (Required) | `string (date-time)` |   |
| `memberPackage.isCustomized` (Required) | `boolean` |   |
| `memberPackage.paymentProvider` (Required) | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `memberPackage.reference` (Required) | `string` |   |
| `memberPackage.lastActiveAt` (Required) | `string (date-time)` |   |
| `memberPackage.isOnIntroPeriod` (Required) | `boolean` |   |
| `memberPackage.nextOrderDate` (Required) | `string (date-time)` |   |
| `memberPackage.scheduledActivationDate` (Required) | `string (date-time)` | Can be null |
| `memberPackage.package` (Required) | `Package` |   |
| `memberPackage.package.paymentProviders` (Required) | `array of PAYMENT_PROVIDER` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `memberPackage.package.repeatPurchaseControl` (Required) | `RepeatPurchaseControl` | Allowed values: `"allow"`, `"warning"`, `"block_active"`, `"block_forever"`, `"cooldown"` |
| `memberPackage.package.repeatPurchaseCooldownDays` | `number` | Can be null |
| `memberPackage.package.displayOrder` | `number` | Can be null |
| `memberPackage.package.seo` | `Seo` | Can be null · Nested fields omitted: depth limit. |
| `memberPackage.package.salesTitle` (Required) | `string` |   |
| `memberPackage.package.uuid` (Required) | `string` |   |
| `memberPackage.package.subscriptionPlanId` (Required) | `number` |   |
| `memberPackage.package.slug` (Required) | `string` |   |
| `memberPackage.package.image` (Required) | `string` |   |
| `memberPackage.package.name` (Required) | `string` |   |
| `memberPackage.package.description` (Required) | `object` |   |
| `memberPackage.package.billingPeriod` (Required) | `string` | Allowed values: `"monthly"`, `"thirty_days"`, `"quarterly"`, `"half_yearly"`, `"yearly"`, `"custom"` |
| `memberPackage.package.billingPeriodUnit` (Required) | `string` | Allowed values: `"day"`, `"week"`, `"month"`, `"year"` |
| `memberPackage.package.billingPeriodFrequency` (Required) | `number` |   |
| `memberPackage.package.status` (Required) | `string` | Allowed values: `"draft"`, `"published"`, `"archived"` |
| `memberPackage.package.isAvailableOnMyPage` (Required) | `boolean` |   |
| `memberPackage.package.isAvailableViaSlug` (Required) | `boolean` |   |
| `memberPackage.package.isAvailableForManualOrderViaAdmin` (Required) | `boolean` |   |
| `memberPackage.package.allowSameSubscriptionChange` (Required) | `boolean` |   |
| `memberPackage.package.allowDifferentSubscriptionSwitch` (Required) | `boolean` |   |
| `memberPackage.package.tenantId` (Required) | `number` |   |
| `memberPackage.package.onboardingWelcomeRedirectCTAText` (Required) | `Translation` | Nested fields omitted: depth limit. |
| `memberPackage.package.customPeriodText` (Required) | `Translation` | Nested fields omitted: depth limit. |
| `memberPackage.package.orderCtaLabel` (Required) | `Translation` | Nested fields omitted: depth limit. |
| `memberPackage.package.introPeriodFixedEndDate` (Required) | `string (date-time)` |   |
| `memberPackage.package.packageProducts` (Required) | `array of PackageProduct` | Nested fields omitted: depth limit. |
| `memberPackage.package.subscriptionPlan` (Required) | `SubscriptionPlan` | Nested fields omitted: depth limit. |
| `memberPackage.package.payments` (Required) | `array of Payment` | Nested fields omitted: depth limit. |
| `memberPackage.package.memberPackages` (Required) | `array of MemberPackage` | Recursive schema; nested fields are not repeated. |
| `memberPackage.package.id` (Required) | `number` |   |
| `memberPackage.package.createdAt` (Required) | `string (date-time)` |   |
| `memberPackage.package.updatedAt` (Required) | `string (date-time)` |   |
| `memberPackage.package.deletedAt` (Required) | `string (date-time)` |   |
| `memberPackage.package.metaData` (Required) | `object` |   |
| `memberPackage.subscriptionPlan` (Required) | `SubscriptionPlan` | Nested fields omitted: field limit. |
| `memberPackage.member` (Required) | `Member` | Nested fields omitted: field limit. |
| `memberPackage.memberPackageProducts` (Required) | `array of MemberPackageProduct` | Nested fields omitted: field limit. |
| `memberPackage.orders` (Required) | `array of Order` | Nested fields omitted: field limit. |
| `memberPackage.memberPackageProviderPayment` (Required) | `MemberPackageProviderPayment` | Nested fields omitted: field limit. |
| `memberPackage.changes` (Required) | `array of MemberPackageChange` | Nested fields omitted: field limit. |
| `memberPackage.histories` (Required) | `array of MemberPackageHistory` | Nested fields omitted: field limit. |
| `memberPackage.tenantId` (Required) | `number` |   |
| `memberPackage.tenant` (Required) | `Tenant` | Nested fields omitted: field limit. |
| `memberPackage.id` (Required) | `number` |   |
| `memberPackage.createdAt` (Required) | `string (date-time)` |   |
| `memberPackage.updatedAt` (Required) | `string (date-time)` |   |
| `memberPackage.deletedAt` (Required) | `string (date-time)` |   |
| `memberPackage.metaData` (Required) | `object` |   |
| `invoiceNumber` | `number` |   |

#### 400

invalidPackage, badRequest

#### 401

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

unauthorized

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

#### 403

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

forbidden

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

#### 409

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

checkoutPhoneHasAccount

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

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/subscription/external \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "packageId": 0,
  "paidPaymentProvider": "stripe",
  "paymentDate": "2019-08-24T14:15:22Z",
  "isPaid": true,
  "note": "string",
  "optionalProducts": [
    {}
  ],
  "mainProductsWithManualPrice": [
    {}
  ],
  "userData": {
    "memberId": "string",
    "email": "user@example.com",
    "fullName": "<fullName>",
    "phone": "<phone>",
    "countryCode": "NO",
    "isCompany": true,
    "companyName": "string",
    "organizationNo": "string",
    "reference": "string",
    "onCheckoutCompletedUrl": "string",
    "sourceUrl": "string",
    "referrerUrl": "string"
  },
  "billingAddress": {
    "address": "<address>",
    "addressTwo": "<addressTwo>",
    "companyName": "string",
    "organizationNo": "string",
    "postCode": "string",
    "city": "string",
    "country": "string",
    "invoiceReference": "string",
    "email": "string",
    "fullName": "<fullName>",
    "phone": "<phone>"
  }
}'
```

### Example response

200 · `application/json`

```json
{
  "checkoutStateUuid": "string",
  "memberPackage": {
    "memberId": "string",
    "packageId": 0,
    "subscriptionPlanId": 0,
    "recurringPrice": 0,
    "hasCustomPrice": true,
    "currentPrice": 0,
    "status": "active",
    "autoRenew": true,
    "nextRenewal": "2019-08-24T14:15:22Z",
    "renewalAnchorDate": "2019-08-24T14:15:22Z",
    "currentPeriodStart": "2019-08-24T14:15:22Z",
    "forcedStopDate": "2019-08-24T14:15:22Z",
    "cancelledAt": "2019-08-24T14:15:22Z",
    "isCustomized": true,
    "paymentProvider": "stripe",
    "reference": "string",
    "lastActiveAt": "2019-08-24T14:15:22Z",
    "isOnIntroPeriod": true,
    "nextOrderDate": "2019-08-24T14:15:22Z",
    "scheduledActivationDate": "2019-08-24T14:15:22Z",
    "package": {
      "paymentProviders": [],
      "description": {},
      "packageProducts": [],
      "payments": [],
      "memberPackages": [],
      "metaData": {}
    },
    "subscriptionPlan": {
      "paymentProviders": [],
      "entityTags": [],
      "subscriptionPlanProducts": [],
      "packages": [],
      "memberPackages": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "memberPackageProducts": [],
    "orders": [],
    "memberPackageProviderPayment": {
      "paymentInfo": {},
      "cardInfo": {},
      "metaData": {}
    },
    "changes": [],
    "histories": [],
    "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": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "invoiceNumber": 0
}
```

<a id="get-api-v1-payment-external-grace-deactivate"></a>
## deactivate subscriptions for external payment of nth days of being unpaid

`GET /api/v1/payment/external/grace-deactivate`

**Authentication:** Bearer token (JWT)

### Responses

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

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

<a id="post-api-v1-payment-turn-off-inactives"></a>
## Turn off subscriptions with auto renewal turned off

`POST /api/v1/payment/turn-off-inactives`

**Authentication:** Bearer token (JWT)

### Responses

#### 201

#### 401

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

unauthorized

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/turn-off-inactives \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

<a id="post-api-v1-payment-admin-recover-stripe-recurring-invoices"></a>
## Operator-only: re-run the local invoice half of recurrent Stripe charges that succeeded on Stripe but failed locally

`POST /api/v1/payment/admin/recover-stripe-recurring-invoices`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `memberPackageIds` (Required) | `array of number` | `minItems`: `1`, `maxItems`: `200` |

**Example request body**

`application/json`

```json
{
  "memberPackageIds": [
    0
  ]
}
```

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `results` (Required) | `array of RecoverRecurringStripePaymentResultDto` |   |
| `results[].memberPackageId` (Required when parent is present) | `number` |   |
| `results[].status` (Required when parent is present) | `string` | Allowed values: `"succeeded"`, `"already_processed"`, `"skipped"`, `"failed"` |
| `results[].paymentIntentId` | `string` | Can be null |
| `results[].invoiceId` | `number` | Can be null |
| `results[].message` | `string` | Can be null |

#### 401

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

unauthorized

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/admin/recover-stripe-recurring-invoices \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "memberPackageIds": [
    0
  ]
}'
```

### Example response

200 · `application/json`

```json
{
  "results": [
    {}
  ]
}
```

<a id="get-api-v1-payment-enqueue-schedule-activate-subscriptions"></a>
## Activate scheduled subscriptions

`GET /api/v1/payment/enqueue-schedule-activate-subscriptions`

**Authentication:** Bearer token (JWT)

### Responses

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/enqueue-schedule-activate-subscriptions \
  --header 'Authorization: Bearer <token>'
```

<a id="get-api-v1-payment-order-orderid"></a>
## Get order details

`GET /api/v1/payment/order/{orderId}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 401

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

unauthorized

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### default

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

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` |   |
| `orderDate` (Required) | `string (date-time)` |   |
| `orderNumber` (Required) | `number` |   |
| `paymentStatus` (Required) | `PAYMENT_STATUS` | Allowed values: `"pending"`, `"succeeded"`, `"failed"` |
| `amount` (Required) | `number` |   |
| `credit` (Required) | `number` |   |
| `debit` (Required) | `number` |   |
| `packageName` (Required) | `string` |   |
| `planName` (Required) | `string` |   |
| `paymentProvider` (Required) | `PAYMENT_PROVIDER` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `currency` (Required) | `string` |   |
| `billingPeriodInfo` (Required) | `BillingPeriodInfo` |   |
| `billingPeriodInfo.billingPeriod` (Required) | `string` |   |
| `billingPeriodInfo.customBillingPeriod` (Required) | `BillingPeriodDetails` | Nested fields omitted: field limit. |
| `allowedPaymentProviders` (Required) | `array of PAYMENT_PROVIDER` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `tenantId` (Required) | `number` |   |
| `upgradeData` | `MemberPackageChangeData` |   |
| `upgradeData.planChange` (Required when parent is present) | `PlanChange` | Nested fields omitted: field limit. |
| `upgradeData.productChange` (Required when parent is present) | `array of ProductChange` | Nested fields omitted: field limit. |
| `upgradeData.optionalProducts` (Required when parent is present) | `array of OptionalProductWithQuantity` | Nested fields omitted: field limit. |
| `upgradeData.planProductPrices` | `array of PlanProductPriceSnapshot` | Nested fields omitted: field limit. |
| `upgradeData.seatTransferMap` | `array of SeatTransferMappingDto` | Nested fields omitted: field limit. |
| `memberPackageId` (Required) | `number` |   |
| `recurringPriceAtOrder` (Required) | `number` |   |
| `paymentId` (Required) | `number` |   |
| `paymentToken` (Required) | `string` |   |
| `type` (Required) | `string` | Allowed values: `"initial"`, `"recurrent"`, `"upgrade"`, `"credit-note"`, `"standalone"` |
| `orderItems` (Required) | `array of OrderItem` |   |
| `orderItems[].orderId` (Required when parent is present) | `number` |   |
| `orderItems[].productId` (Required when parent is present) | `number` |   |
| `orderItems[].name` (Required when parent is present) | `string` |   |
| `orderItems[].price` (Required when parent is present) | `number` |   |
| `orderItems[].tax` (Required when parent is present) | `number` |   |
| `orderItems[].quantity` (Required when parent is present) | `number` |   |
| `orderItems[].note` (Required when parent is present) | `string` |   |
| `orderItems[].order` (Required when parent is present) | `Order` | Nested fields omitted: field limit. |
| `orderItems[].product` (Required when parent is present) | `Product` | Nested fields omitted: field limit. |
| `orderItems[].id` (Required when parent is present) | `number` |   |
| `orderItems[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `orderItems[].updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `orderItems[].deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `orderItems[].metaData` (Required when parent is present) | `object` |   |
| `payment` (Required) | `Payment` |   |
| `payment.packageId` (Required) | `number` |   |
| `payment.accountingDate` (Required) | `string (date-time)` |   |
| `payment.registrationDate` (Required) | `string (date-time)` |   |
| `payment.paymentProvider` (Required) | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `payment.paymentMethod` (Required) | `string` | Allowed values: `"card"`, `"vipps"`, `"manual_registration"`, `"efaktura"`, `"ehf"`, `"avtalegiro"` |
| `payment.amount` (Required) | `number` |   |
| `payment.currency` (Required) | `string` |   |
| `payment.status` (Required) | `string` | Allowed values: `"pending"`, `"succeeded"`, `"failed"` |
| `payment.note` (Required) | `string` |   |
| `payment.isAdminAction` (Required) | `boolean` |   |
| `payment.memberId` (Required) | `string` |   |
| `payment.stripePayment` (Required) | `StripePayment` | Nested fields omitted: field limit. |
| `payment.vippsPayment` (Required) | `VippsPayment` | Nested fields omitted: field limit. |
| `payment.netsPayment` (Required) | `NetsPayment` | Nested fields omitted: field limit. |
| `payment.eInvoicePayment` (Required) | `EInvoicePayment` | Nested fields omitted: field limit. |
| `payment.swedbankpayPayment` (Required) | `SwedbankpayPayment` | Nested fields omitted: field limit. |
| `payment.package` (Required) | `Package` | Nested fields omitted: field limit. |
| `payment.order` (Required) | `Order` | Nested fields omitted: field limit. |
| `payment.checkoutState` (Required) | `CheckoutState` | Nested fields omitted: field limit. |
| `payment.invoiceId` (Required) | `number` |   |
| `payment.invoice` (Required) | `Invoice` | Nested fields omitted: field limit. |
| `payment.member` (Required) | `Member` | Nested fields omitted: field limit. |
| `payment.updatedBy` (Required) | `number` |   |
| `payment.id` (Required) | `number` |   |
| `payment.createdAt` (Required) | `string (date-time)` |   |
| `payment.updatedAt` (Required) | `string (date-time)` |   |
| `payment.deletedAt` (Required) | `string (date-time)` |   |
| `payment.metaData` (Required) | `object` |   |
| `memberPackage` (Required) | `MemberPackage` | Nested fields omitted: field limit. |
| `invoice` (Required) | `Invoice` | Nested fields omitted: field limit. |
| `tenant` (Required) | `Tenant` | Nested fields omitted: field limit. |
| `memberPackageChange` (Required) | `MemberPackageChange` | Nested fields omitted: field limit. |
| `createdAt` (Required) | `string (date-time)` |   |
| `updatedAt` (Required) | `string (date-time)` |   |
| `deletedAt` (Required) | `string (date-time)` |   |
| `metaData` (Required) | `object` |   |

**Example response**

`application/json`

```json
{
  "id": 0,
  "orderDate": "2019-08-24T14:15:22Z",
  "orderNumber": 0,
  "paymentStatus": "pending",
  "amount": 0,
  "credit": 0,
  "debit": 0,
  "packageName": "string",
  "planName": "string",
  "paymentProvider": "stripe",
  "currency": "string",
  "billingPeriodInfo": {
    "billingPeriod": "string",
    "customBillingPeriod": {}
  },
  "allowedPaymentProviders": [
    "stripe"
  ],
  "tenantId": 0,
  "upgradeData": {
    "planChange": {},
    "productChange": [],
    "optionalProducts": [],
    "planProductPrices": [],
    "seatTransferMap": []
  },
  "memberPackageId": 0,
  "recurringPriceAtOrder": 0,
  "paymentId": 0,
  "paymentToken": "<paymentToken>",
  "type": "initial",
  "orderItems": [
    {
      "metaData": {}
    }
  ],
  "payment": {
    "packageId": 0,
    "accountingDate": "2019-08-24T14:15:22Z",
    "registrationDate": "2019-08-24T14:15:22Z",
    "paymentProvider": "stripe",
    "paymentMethod": "card",
    "amount": 0,
    "currency": "string",
    "status": "pending",
    "note": "string",
    "isAdminAction": true,
    "memberId": "string",
    "stripePayment": {
      "metaData": {}
    },
    "vippsPayment": {
      "metaData": {}
    },
    "netsPayment": {
      "metaData": {}
    },
    "eInvoicePayment": {
      "metaData": {}
    },
    "swedbankpayPayment": {
      "metaData": {}
    },
    "package": {
      "paymentProviders": [],
      "description": {},
      "packageProducts": [],
      "payments": [],
      "memberPackages": [],
      "metaData": {}
    },
    "order": {
      "orderItems": [],
      "metaData": {}
    },
    "checkoutState": {
      "steps": [],
      "paymentData": {},
      "additionalMemberData": [],
      "giftReceiverData": [],
      "metaData": {}
    },
    "invoiceId": 0,
    "invoice": {
      "orderItemInfo": [],
      "taxGroupInfo": [],
      "refunds": [],
      "creditNotes": [],
      "payments": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "updatedBy": 0,
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "memberPackage": {
    "memberId": "string",
    "packageId": 0,
    "subscriptionPlanId": 0,
    "recurringPrice": 0,
    "hasCustomPrice": true,
    "currentPrice": 0,
    "status": "active",
    "autoRenew": true,
    "nextRenewal": "2019-08-24T14:15:22Z",
    "renewalAnchorDate": "2019-08-24T14:15:22Z",
    "currentPeriodStart": "2019-08-24T14:15:22Z",
    "forcedStopDate": "2019-08-24T14:15:22Z",
    "cancelledAt": "2019-08-24T14:15:22Z",
    "isCustomized": true,
    "paymentProvider": "stripe",
    "reference": "string",
    "lastActiveAt": "2019-08-24T14:15:22Z",
    "isOnIntroPeriod": true,
    "nextOrderDate": "2019-08-24T14:15:22Z",
    "scheduledActivationDate": "2019-08-24T14:15:22Z",
    "package": {
      "paymentProviders": [],
      "description": {},
      "packageProducts": [],
      "payments": [],
      "memberPackages": [],
      "metaData": {}
    },
    "subscriptionPlan": {
      "paymentProviders": [],
      "entityTags": [],
      "subscriptionPlanProducts": [],
      "packages": [],
      "memberPackages": [],
      "metaData": {}
    },
    "member": {
      "customPropertyValues": {},
      "productRecipients": [],
      "metaData": {}
    },
    "memberPackageProducts": [],
    "orders": [],
    "memberPackageProviderPayment": {
      "paymentInfo": {},
      "cardInfo": {},
      "metaData": {}
    },
    "changes": [],
    "histories": [],
    "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": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "invoice": {
    "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": {},
    "addressInfo": {},
    "tenantInfo": {},
    "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": {
      "orderItems": [],
      "metaData": {}
    },
    "eInvoicePayment": {
      "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": {}
    },
    "refunds": [],
    "isCreditNote": true,
    "note": "string",
    "referencedInvoiceNumber": 0,
    "referencedInvoiceId": 0,
    "referencedInvoice": {},
    "creditNotes": [],
    "payments": [],
    "transaction": {
      "metaData": {}
    },
    "id": 0,
    "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": {}
  },
  "memberPackageChange": {
    "isImmediate": true,
    "changeInPrice": 0,
    "status": "CREATED",
    "data": {
      "productChange": [],
      "optionalProducts": [],
      "planProductPrices": [],
      "seatTransferMap": []
    },
    "updatedBy": 0,
    "memberPackage": {
      "memberPackageProducts": [],
      "orders": [],
      "changes": [],
      "histories": [],
      "metaData": {}
    },
    "order": {
      "orderItems": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "deletedAt": "2019-08-24T14:15:22Z",
  "metaData": {}
}
```

### Example request

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

<a id="get-api-v1-payment-order-by-token-token"></a>
## Get order details by payment token (no member session required)

`GET /api/v1/payment/order-by-token/{token}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 401

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

unauthorized

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 404

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

orderNotFound

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### default

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

Schema reference could not be resolved.

### Example request

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

<a id="get-api-v1-payment-generate-payment-link-memberpackageid"></a>
## Generate a payment link for a member package

`GET /api/v1/payment/generate-payment-link/{memberPackageId}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

Returns the payment link for the given member package

#### 400

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

memberPackageNotFound

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/payment/generate-payment-link/{memberPackageId}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "paymentLink": "https://subrite.domain.com/pay/{payment-token}"
}
```

<a id="post-api-v1-payment-create"></a>
## Create payment

`POST /api/v1/payment/create`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `paymentDate` (Required) | `string (date-time)` |   |
| `amount` (Required) | `number` |   |
| `paymentProvider` (Required) | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `note` (Required) | `string` |   |
| `invoiceNumber` | `number` |   |
| `memberPackageId` | `number` |   |
| `memberId` (Required) | `string` |   |

**Example request body**

`application/json`

```json
{
  "paymentDate": "2019-08-24T14:15:22Z",
  "amount": 0,
  "paymentProvider": "stripe",
  "note": "string",
  "invoiceNumber": 0,
  "memberPackageId": 0,
  "memberId": "string"
}
```

### Responses

#### 400

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

badRequest

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/create \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "paymentDate": "2019-08-24T14:15:22Z",
  "amount": 0,
  "paymentProvider": "stripe",
  "note": "string",
  "invoiceNumber": 0,
  "memberPackageId": 0,
  "memberId": "string"
}'
```

<a id="patch-api-v1-payment-payment-date"></a>
## Update payment date

`PATCH /api/v1/payment/payment-date`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `paymentId` (Required) | `number` |   |
| `paymentDate` (Required) | `string (date-time)` |   |

**Example request body**

`application/json`

```json
{
  "paymentId": 0,
  "paymentDate": "2019-08-24T14:15:22Z"
}
```

### Responses

#### 400

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

badRequest

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

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

<a id="post-api-v1-payment-refund"></a>
## Create refund

`POST /api/v1/payment/refund`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `invoiceNumber` | `number` |   |
| `amount` (Required) | `number` |   |
| `accountingDate` (Required) | `string (date-time)` |   |
| `paymentProvider` (Required) | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `note` (Required) | `string` |   |
| `memberId` (Required) | `string` |   |

**Example request body**

`application/json`

```json
{
  "invoiceNumber": 0,
  "amount": 0,
  "accountingDate": "2019-08-24T14:15:22Z",
  "paymentProvider": "stripe",
  "note": "string",
  "memberId": "string"
}
```

### Responses

#### 400

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

InvoiceDoeNotBelongToTheMember

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 409

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

eventDateFallsInLockedPeriod

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/refund \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoiceNumber": 0,
  "amount": 0,
  "accountingDate": "2019-08-24T14:15:22Z",
  "paymentProvider": "stripe",
  "note": "string",
  "memberId": "string"
}'
```

<a id="post-api-v1-payment-restart-subscription"></a>
## Restart a stopped/expired/inactive subscription

`POST /api/v1/payment/restart-subscription`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `subscriptionId` (Required) | `number` |   |
| `paymentDate` | `string (date-time)` |   |

**Example request body**

`application/json`

```json
{
  "subscriptionId": 0,
  "paymentDate": "2019-08-24T14:15:22Z"
}
```

### Responses

#### 400

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

alreadyActive

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 404

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

notFound

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/restart-subscription \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "subscriptionId": 0,
  "paymentDate": "2019-08-24T14:15:22Z"
}'
```

<a id="post-api-v1-payment-member-restart-subscription"></a>
## Restart a stopped/expired/inactive subscription as member

`POST /api/v1/payment/member/restart-subscription`

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Restart a stopped/expired/inactive subscription (Request body)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-restart-subscription).

**Example request body**

`application/json`

```json
{
  "subscriptionId": 0,
  "paymentDate": "2019-08-24T14:15:22Z"
}
```

### Responses

#### 400

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

alreadyActive

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 401

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

unauthorized

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 404

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

notFound

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/member/restart-subscription \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "subscriptionId": 0,
  "paymentDate": "2019-08-24T14:15:22Z"
}'
```

<a id="post-api-v1-payment-enqueue-renew-external-subscriptions"></a>
## Enqueue renew external subscriptions

`POST /api/v1/payment/enqueue-renew-external-subscriptions`

**Authentication:** Bearer token (JWT)

### Responses

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/enqueue-renew-external-subscriptions \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

<a id="post-api-v1-payment-subscription-auto-renew-with-payment"></a>
## Subscription auto renew with payment

`POST /api/v1/payment/subscription-auto-renew-with-payment`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `subscriptionId` (Required) | `number` |   |
| `paymentDate` | `string (date-time)` |   |

**Example request body**

`application/json`

```json
{
  "subscriptionId": 0,
  "paymentDate": "2019-08-24T14:15:22Z"
}
```

### Responses

#### 400

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

alreadyChargeIsInProgress

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

**Example response**

`application/json`

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

#### 401

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

unauthorized

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 403

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

forbiddenResource

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 404

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

notFound

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

#### 500

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

internalServerError

Same fields as [Subscribe a package via external payment (401)](https://www.subrite.no/developers/payment?md=true#post-api-v1-payment-subscription-external).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment/subscription-auto-renew-with-payment \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "subscriptionId": 0,
  "paymentDate": "2019-08-24T14:15:22Z"
}'
```
