# Payment-Provider

**Summary:** Endpoints for Payment-Provider

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

<a id="patch-api-v1-payment-provider-config"></a>
## Update payment provider configuration

`PATCH /api/v1/payment-provider/config`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `config` (Required) | `object` |   |
| `paymentProvider` (Required) | `string` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |

**Example request body**

`application/json`

```json
{
  "config": {},
  "paymentProvider": "stripe"
}
```

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` |   |
| `name` (Required) | `PAYMENT_PROVIDER` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `config` (Required) | `StripeConfig \| VippsConfig \| NetsConfig \| OrbytConfig \| ExternalConfig \| SwedbankpayConfig` |   |
| `webhookEvents` (Required) | `array of string` |   |
| `allowedDaysAfterExpiry` | `number` |   |
| `renewWithoutPayment` | `boolean` |   |
| `eInvoicePaymentPreference` | `EInvoicePaymentPreference` |   |
| `eInvoicePaymentPreference.initialActivation` (Required when parent is present) | `INITIAL_ACTIVATION` | Allowed values: `"ON_PAYMENT"`, `"ON_ORDER"` |
| `eInvoicePaymentPreference.dueDaysAfterOrderForInitial` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.initialDeactivation` (Required when parent is present) | `DEACTIVATION_POLICY` | Allowed values: `"ON_DUE"`, `"ON_RENEWAL"`, `"NEVER"` |
| `eInvoicePaymentPreference.initialOnDueDeactivationBufferDays` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.orderDaysBeforeRenewal` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.dueDaysAfterOrderForRecurring` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.recurringDeactivation` (Required when parent is present) | `DEACTIVATION_POLICY` | Allowed values: `"ON_DUE"`, `"ON_RENEWAL"`, `"NEVER"` |
| `eInvoicePaymentPreference.recurringOnDueDeactivationBufferDays` (Required when parent is present) | `number` |   |

#### 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 [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment-provider/config \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "config": {},
  "paymentProvider": "stripe"
}'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}
```

<a id="post-api-v1-payment-provider-change-external"></a>
## Route to add external as a payment provider to a subscription

`POST /api/v1/payment-provider/change-external`

**Authentication:** Bearer token (JWT)

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `memberPackageId` (Required) | `number` | `minimum`: `1` |
| `invoiceInfo` (Required) | `InvoiceInfo` |   |
| `invoiceInfo.fullName` (Required) | `string` |   |
| `invoiceInfo.address` (Required) | `string` |   |
| `invoiceInfo.city` (Required) | `string` |   |
| `invoiceInfo.postCode` (Required) | `string` |   |
| `invoiceInfo.organizationNo` (Required) | `string` |   |
| `invoiceInfo.companyName` (Required) | `string` |   |
| `invoiceInfo.country` (Required) | `string` |   |

**Example request body**

`application/json`

```json
{
  "memberPackageId": 1,
  "invoiceInfo": {
    "fullName": "<fullName>",
    "address": "<address>",
    "city": "string",
    "postCode": "string",
    "organizationNo": "string",
    "companyName": "string",
    "country": "string"
  }
}
```

### Responses

#### 201

#### 400

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

invalidMemberPackageId

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

#### 401

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

unauthorized

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment-provider/change-external \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "memberPackageId": 1,
  "invoiceInfo": {
    "fullName": "<fullName>",
    "address": "<address>",
    "city": "string",
    "postCode": "string",
    "organizationNo": "string",
    "companyName": "string",
    "country": "string"
  }
}'
```

<a id="post-api-v1-payment-provider-change-external-memberid"></a>
## Route to add external as a payment provider to a subscription by admin

`POST /api/v1/payment-provider/change-external/{memberId}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Request body

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

Same fields as [Route to add external as a payment provider to a subscription (Request body)](https://www.subrite.no/developers/payment-provider?md=true#post-api-v1-payment-provider-change-external).

**Example request body**

`application/json`

```json
{
  "memberPackageId": 1,
  "invoiceInfo": {
    "fullName": "<fullName>",
    "address": "<address>",
    "city": "string",
    "postCode": "string",
    "organizationNo": "string",
    "companyName": "string",
    "country": "string"
  }
}
```

### Responses

#### 201

#### 400

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

invalidMemberPackageId

Same fields as [Route to add external as a payment provider to a subscription (400)](https://www.subrite.no/developers/payment-provider?md=true#post-api-v1-payment-provider-change-external).

**Example response**

`application/json`

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

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/payment-provider/change-external/{memberId}?memberId=%3CmemberId%3E' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "memberPackageId": 1,
  "invoiceInfo": {
    "fullName": "<fullName>",
    "address": "<address>",
    "city": "string",
    "postCode": "string",
    "organizationNo": "string",
    "companyName": "string",
    "country": "string"
  }
}'
```

<a id="get-api-v1-payment-provider"></a>
## Get available payment providers on my page and admin page

`GET /api/v1/payment-provider`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].name` (Required when parent is present) | `string` |   |

#### 401

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

unauthorized

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

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

### Example response

200 · `application/json`

```json
[
  {
    "name": "string"
  }
]
```

<a id="get-api-v1-payment-provider-settings-id"></a>
## Get payment provider settings for admin page by id

`GET /api/v1/payment-provider/settings/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

Same fields as [Update payment provider configuration (200)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 404

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

paymentProviderSettingsNotFound

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

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

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

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}
```

<a id="patch-api-v1-payment-provider-settings-id"></a>
## Update payment provider settings for admin page

`PATCH /api/v1/payment-provider/settings/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Request body

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

| Name | Type | Description |
| --- | --- | --- |
| `id` | `number` |   |
| `name` | `PAYMENT_PROVIDER` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `config` | `StripeConfig \| VippsConfig \| NetsConfig \| OrbytConfig \| ExternalConfig \| SwedbankpayConfig` |   |
| `webhookEvents` | `array of string` |   |
| `allowedDaysAfterExpiry` | `number` |   |
| `renewWithoutPayment` | `boolean` |   |
| `eInvoicePaymentPreference` | `EInvoicePaymentPreference` |   |
| `eInvoicePaymentPreference.initialActivation` (Required when parent is present) | `INITIAL_ACTIVATION` | Allowed values: `"ON_PAYMENT"`, `"ON_ORDER"` |
| `eInvoicePaymentPreference.dueDaysAfterOrderForInitial` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.initialDeactivation` (Required when parent is present) | `DEACTIVATION_POLICY` | Allowed values: `"ON_DUE"`, `"ON_RENEWAL"`, `"NEVER"` |
| `eInvoicePaymentPreference.initialOnDueDeactivationBufferDays` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.orderDaysBeforeRenewal` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.dueDaysAfterOrderForRecurring` (Required when parent is present) | `number` |   |
| `eInvoicePaymentPreference.recurringDeactivation` (Required when parent is present) | `DEACTIVATION_POLICY` | Allowed values: `"ON_DUE"`, `"ON_RENEWAL"`, `"NEVER"` |
| `eInvoicePaymentPreference.recurringOnDueDeactivationBufferDays` (Required when parent is present) | `number` |   |

**Example request body**

`application/json`

```json
{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}
```

### Responses

#### 200

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

Same fields as [Update payment provider configuration (200)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/payment-provider/settings/{id}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}
```

<a id="get-api-v1-payment-provider-settings"></a>
## Get payment provider settings for admin page

`GET /api/v1/payment-provider/settings`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

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

| Name | Type | Description |
| --- | --- | --- |
| `[].id` (Required when parent is present) | `number` |   |
| `[].name` (Required when parent is present) | `PAYMENT_PROVIDER` | Allowed values: `"stripe"`, `"vipps"`, `"external"`, `"nets"`, `"efaktura-avtalegiro-ehf"`, `"swedbankpay"` |
| `[].config` (Required when parent is present) | `StripeConfig \| VippsConfig \| NetsConfig \| OrbytConfig \| ExternalConfig \| SwedbankpayConfig` |   |
| `[].webhookEvents` (Required when parent is present) | `array of string` |   |
| `[].allowedDaysAfterExpiry` | `number` |   |
| `[].renewWithoutPayment` | `boolean` |   |
| `[].eInvoicePaymentPreference` | `EInvoicePaymentPreference` |   |
| `[].eInvoicePaymentPreference.initialActivation` (Required when parent is present) | `INITIAL_ACTIVATION` | Allowed values: `"ON_PAYMENT"`, `"ON_ORDER"` |
| `[].eInvoicePaymentPreference.dueDaysAfterOrderForInitial` (Required when parent is present) | `number` |   |
| `[].eInvoicePaymentPreference.initialDeactivation` (Required when parent is present) | `DEACTIVATION_POLICY` | Allowed values: `"ON_DUE"`, `"ON_RENEWAL"`, `"NEVER"` |
| `[].eInvoicePaymentPreference.initialOnDueDeactivationBufferDays` (Required when parent is present) | `number` |   |
| `[].eInvoicePaymentPreference.orderDaysBeforeRenewal` (Required when parent is present) | `number` |   |
| `[].eInvoicePaymentPreference.dueDaysAfterOrderForRecurring` (Required when parent is present) | `number` |   |
| `[].eInvoicePaymentPreference.recurringDeactivation` (Required when parent is present) | `DEACTIVATION_POLICY` | Allowed values: `"ON_DUE"`, `"ON_RENEWAL"`, `"NEVER"` |
| `[].eInvoicePaymentPreference.recurringOnDueDeactivationBufferDays` (Required when parent is present) | `number` |   |

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

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

### Example response

200 · `application/json`

```json
[
  {
    "id": 0,
    "name": "stripe",
    "config": {},
    "webhookEvents": [],
    "allowedDaysAfterExpiry": 0,
    "renewWithoutPayment": true,
    "eInvoicePaymentPreference": {}
  }
]
```

<a id="post-api-v1-payment-provider-settings"></a>
## Create payment provider settings for admin page

`POST /api/v1/payment-provider/settings`

**Authentication:** Bearer token (JWT)

### Request body

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

Same fields as [Update payment provider settings for admin page (Request body)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-settings-id).

**Example request body**

`application/json`

```json
{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}
```

### Responses

#### 201

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

Same fields as [Update payment provider configuration (200)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

```bash
curl https://api.subrite.no/api/v1/payment-provider/settings \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}'
```

### Example response

201 · `application/json`

```json
{
  "id": 0,
  "name": "stripe",
  "config": {
    "secretKey": "<secretKey>",
    "publishableKey": "<publishableKey>",
    "webhookSecret": "<webhookSecret>"
  },
  "webhookEvents": [
    "string"
  ],
  "allowedDaysAfterExpiry": 0,
  "renewWithoutPayment": true,
  "eInvoicePaymentPreference": {
    "initialActivation": "ON_PAYMENT",
    "dueDaysAfterOrderForInitial": 0,
    "initialDeactivation": "ON_DUE",
    "initialOnDueDeactivationBufferDays": 0,
    "orderDaysBeforeRenewal": 0,
    "dueDaysAfterOrderForRecurring": 0,
    "recurringDeactivation": "ON_DUE",
    "recurringOnDueDeactivationBufferDays": 0
  }
}
```

<a id="get-api-v1-payment-provider-subscription-plan-id"></a>
## Get available payment providers on a subscription plan

`GET /api/v1/payment-provider/subscription-plan/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

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

#### 401

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

unauthorized

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/payment-provider/subscription-plan/{id}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  "string"
]
```

<a id="delete-api-v1-payment-provider-clear-webhook-secret-providername"></a>
## Clear webhook secret for a payment provider

`DELETE /api/v1/payment-provider/clear-webhook-secret/{providerName}`

**Authentication:** Bearer token (JWT)

### Parameters

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

### Responses

#### 200

#### 401

unauthorized

#### 403

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

forbiddenResource

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

**Example response**

`application/json`

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

#### 500

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

internalServerError

Same fields as [Update payment provider configuration (403)](https://www.subrite.no/developers/payment-provider?md=true#patch-api-v1-payment-provider-config).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/payment-provider/clear-webhook-secret/{providerName}' \
  --request DELETE \
  --header 'Authorization: Bearer <token>'
```
