> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# b2b - Business-to-business (B2B)

> B2B-specific shop configuration in WEBSALE: customer groups, permissions and pricing logic for business customers handled by the b2b configuration node.

B2B-specific settings (e.g. groups, permissions, pricing logic).

***

## `b2b*` - Basic structure

The basic structure of the `b2b` node is shown below:

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "b2b": {
    "access": {...},
	"accountVerification": {...},
    "userInvitation": {...}
  }
}
```

#### Parameter overview

| **Parameter**         | **Description**                                                            |
| --------------------- | -------------------------------------------------------------------------- |
| `access`              | Controls access restrictions.                                              |
| `accountVerification` | Controls the invitation email and reminder logic for account verification. |
| `userInvitation`      | Controls the invitation email and the associated reminder logic.           |

***

## `b2b.access` - Access restrictions

Configures the access restrictions for B2B customers, for example after registration but before manual activation by the merchant.

#### Example configuration `b2b.access`

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "accessBeforeVerification": {
    "allowedTemplates": [
      "account/accountManagement.htm"
    ],
    "allowedUrls": [],
    "redirectTarget": "error.htm",
    "restricted": false
  },
  "allowedActions": [],
  "allowedTemplates": [],
  "allowedUrls": [],
  "redirectTarget": "error.htm",
  "restricted": false
}
```

#### Parameter overview

| **Parameter**              | **Type**      | **Description**                                                                                                                                                      |
| -------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accessBeforeVerification` | object        | Controls access restrictions for users who have not yet been verified.                                                                                               |
| `restricted`               | bool          | Turns the access restriction for unverified accounts on (`true`) or off (`false`).    <br />Default: **false**                                                       |
| `redirectTarget`           | string        | Name of the template that the user is redirected to when accessing a page that requires sign-in (e.g. `error.htm`).                                                  |
| `allowedTemplates`         | list (string) | List of templates that may also be called without sign-in (e.g. `account/accountManagement.htm`).                                                                    |
| `allowedUrls`              | list (string) | List of URLs that may also be called without sign-in.                                                                                                                |
| `restricted`               | bool          | Enables manual account verification.<br />The customer / company can register themselves but is restricted until activation by the merchant.<br />Default: **false** |
| `redirectTarget`           | string        | Name of the template the user is redirected to if access is denied (e.g. error.htm).                                                                                 |
| `allowedTemplates`         | list (string) | List of templates that may be called before verification.                                                                                                            |
| `allowedUrls`              | list (string) | List of allowed paths that may be called before verification (e.g. `/login`, `/register`).                                                                           |
| `allowedActions`           | list (string) | List of allowed actions that may be used despite the active restriction (e.g. **login, logout**). <br />If the list is empty, no actions are explicitly allowed.     |

***

## `b2b.userInvitation` - User invitation

Configures the email used to invite a new user to a B2B company account. The email contains an activation link the invited user can use to activate the account. Optionally, a reminder email can be sent as long as the invitation has not yet been accepted.

The invitation link is valid for the duration defined in `invitationLinkValidityInHours`. After expiration the invitation must be sent again. If `reminderActive: true`, a reminder email is sent at the interval defined by `reminderIntervallInDays` for invitations that are still open.

**Example configuration** `b2b.userInvitation`

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "email": {
    "fromAddress": "",
    "fromName": "",
    "subject": "",
    "template": ""
  },
  "invitationLinkValidityInDays": 1,
  "reminderActive": false,
  "reminderEmail": {
    "fromAddress": "",
    "fromName": "",
    "subject": "",
    "template": ""
  },
  "reminderIntervalInDays": 7
}
```

**Parameter overview**

| **Parameter**                  | **Type** | **Description**                                                                                                                                                  |
| ------------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `email`                        | object   | Configuration of the initial invitation email.                                                                                                                   |
| `fromAddress`                  | string   | Sender address used when sending the email (e.g. `noreply@mein-shop.de`).                                                                                        |
| `fromName`                     | string   | Display name of the sender in the email (e.g. "Mein Onlineshop").                                                                                                |
| `subject`                      | string   | Subject line of the email as shown in the customer's inbox.                                                                                                      |
| `template`                     | string   | Name or path of the [email template](/en/konfiguration/messages-ereignisgesteuerte-e-mails) to be used. <br />This controls the content and layout of the email. |
| `invitationLinkValidityInDays` | int      | Validity period of the invitation link in days.                                                                                                                  |
| `reminderActive`               | bool     | Enables (`true`) or disables (`false`) the automatic sending <br />of reminder emails for invitations that have not yet been accepted.                           |
| `reminderEmail`                | object   | Configuration of the reminder email. <br />Only used if `reminderActive: true`.                                                                                  |
| `fromAddress`                  | string   | Email address from which the reminder is sent.                                                                                                                   |
| `fromName`                     | string   | Sender address used when sending the email (e.g. `noreply@mein-shop.de`).                                                                                        |
| `subject`                      | string   | Subject of the reminder email.                                                                                                                                   |
| `template`                     | string   | Content of the reminder email.                                                                                                                                   |
| `reminderIntervalInDays`       | int      | Interval in days at which reminders are sent as long as the invitation is open and still valid.                                                                  |

***

## `b2b.accountVerification` - Account verification

Configures the verification process for B2B accounts. With `requireEmailVerification` and `requireManualVerification` you control which kind of verification is required, while `verificationMerchantEmail` defines the emails sent on activation or revocation of an account. With `permissionsBeforeVerification` you define the permissions a not-yet-verified account has in the shop.

**Example configuration** `b2b.accountVerification`

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "requireEmailVerification": true,
  "requireManualVerification": false,
  "verificationMerchantEmail": {
    "fromAddress": "",
    "fromName": "",
    "subject": "",
    "template": "",
    "subjectForRevocation": "",
    "templateForRevocation": ""
  },
  "permissionsBeforeVerification": {
    "viewProducts": true,
    "viewCategories": true,
    "viewPrices": false,
    "placeOrders": false
  }
}
```

**Parameter overview**

| Parameter                       | Type   | Description                                                                                                                                                                                   |
| :------------------------------ | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `requireEmailVerification`      | bool   | Determines whether an email verification is required for new B2B accounts.                                                                                                                    |
| `requireManualVerification`     | bool   | Determines whether new B2B accounts must additionally be approved manually by the merchant.                                                                                                   |
| `verificationMerchantEmail`     | object | Configuration of the emails for account activation and revocation.                                                                                                                            |
| `fromAddress`                   | string | Sender address used when sending the email (e.g. `noreply@mein-shop.de`).                                                                                                                     |
| `fromName`                      | string | Display name of the sender in the email (e.g. "Mein Onlineshop").                                                                                                                             |
| `subject`                       | string | Subject line of the email as shown in the customer's inbox.                                                                                                                                   |
| `template`                      | string | Name or path of the [email template](https://dokumentation.websale.de/konfiguration/messages-ereignisgesteuerte-e-mails) to be used. <br />This controls the content and layout of the email. |
| `subjectForRevocation`          | string | Subject line of the email when the account activation is revoked.                                                                                                                             |
| `templateForRevocation`         | string | Name or path of the [email template](https://dokumentation.websale.de/konfiguration/messages-ereignisgesteuerte-e-mails) to be used for the revocation email.                                 |
| `permissionsBeforeVerification` | object | Defines which actions a not-yet-verified account may perform in the shop.                                                                                                                     |
| `viewProducts`                  | bool   | Determines whether products are visible to unverified accounts.                                                                                                                               |
| `viewCategories`                | bool   | Determines whether categories are visible to unverified accounts.                                                                                                                             |
| `viewPrices`                    | bool   | Determines whether prices are visible to unverified accounts.                                                                                                                                 |
| `placeOrders`                   | bool   | Determines whether unverified accounts can place orders.<br />If `false`, basket actions are also blocked.                                                                                    |
