> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/b2b/dynamic-settings.md).

# B2B Dynamic Settings

B2B keeps its runtime configuration in its own dynamic settings, separate from the [Commerce dynamic settings](https://docs.akinon.com/technical-guides/commerce/dynamic-settings.md). A change takes effect without a redeploy.

| Key                                                                                                     | Type    | Default       | Purpose                                                                     |
| ------------------------------------------------------------------------------------------------------- | ------- | ------------- | --------------------------------------------------------------------------- |
| [`OMNITRON_API`](#id-1.-omnitron-api)                                                                   | object  | –             | Connection to Omnitron. Saved during installation.                          |
| [`SHOP`](#id-2.-shop)                                                                                   | object  | –             | Connection to the storefront. Saved during installation, except `password`. |
| [`IS_SUB_DIVISION_QUOTATION_APPROVAL_REQUIRED`](#id-3.-sub-division-quotation-approval)                 | boolean | `true`        | Main division approval for sub-division quotations.                         |
| [`ACCEPT_PRICE_CHANGES_AFTER_QUOTATION_APPROVAL`](#id-4.-accept-price-changes-after-quotation-approval) | boolean | `false`       | Automatic retry of orders whose prices changed after approval.              |
| [`QUOTATION_ITEM_EXPORT_FIELDS`](#id-5.-quotation-item-export-fields)                                   | list    | `[]`          | Extra columns in the quotation Excel export.                                |
| [`USER_PHONE_REGEX`](#id-6.-user-phone-regex)                                                           | string  | `^(05)\d{9}$` | Phone number pattern of users and divisions.                                |
| [`USER_PHONE_FORMAT`](#id-7.-user-phone-format)                                                         | string  | `05999999999` | Phone number example in validation errors.                                  |
| [`DEFAULT_CURRENCY`](#id-8.-default-currency)                                                           | string  | `try`         | Default currency.                                                           |
| [`AVAILABLE_CURRENCIES`](#id-9.-available-currencies)                                                   | list    | `["try"]`     | Available currencies.                                                       |

Settings are managed in Omnitron, in **B2B > Settings > Dynamic Settings**, or through the Dynamic Settings endpoints in **API Reference > B2B > B2B API**. Saving a setting replaces its whole value, so when you change one field of an object setting such as `SHOP`, keep its other fields.

### **1. Omnitron API**

Connection details that B2B uses for every call to Omnitron: user lookups, user tokens, products, stock and segments. ACC saves this setting when B2B is installed, so it rarely needs a change.

Key: `OMNITRON_API`\
Type: object (dict)\
Default: none. The installation saves the value; the built-in default is only meant for local development.

**Structure:**

| Field               | Type    | Default | Description                                                                                                                                  |
| ------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `api_url`           | string  | –       | Omnitron API base URL, ending with `/api/v1/`.                                                                                               |
| `token`             | string  | –       | Omnitron user token sent with every request. The user must be able to reach the Commerce sales channel.                                      |
| `channel_id`        | integer | –       | ID of the Commerce sales channel in Omnitron. Products, stock, users and segments are read from this channel.                                |
| `application_id`    | integer | –       | ID of the B2B application in Omnitron.                                                                                                       |
| `request_timeout`   | number  | `60`    | Timeout, in seconds, for each request. The installation saves `30`.                                                                          |
| `max_url_length`    | integer | `2048`  | Maximum URL length when B2B reads many products at once. Product lookups are split into several requests so that no URL exceeds this length. |
| `batch_max_workers` | integer | `4`     | Maximum number of those product requests sent in parallel. Lower it if Commerce returns `502` while large baskets are loaded or validated.   |

**Important behaviour:**

* When this setting is empty, every B2B screen that needs Omnitron fails, including staff login with an Omnitron token.
* `username`, `password` and `user_id` can also appear in the value. B2B doesn't use them.

**Example:**

```json
{
  "api_url": "{omnitron_api_url}",
  "token": "{omnitron_token}",
  "channel_id": 2,
  "application_id": 14,
  "request_timeout": 30.0,
  "max_url_length": 4096,
  "batch_max_workers": 2
}
```

### **2. Shop**

Connection details that B2B uses to create orders in Commerce and to read storefront data, such as addresses and product filters. ACC saves this setting when B2B is installed, except `password`, which must be [added manually](https://docs.akinon.com/technical-guides/b2b/b2b-setup.md#shared-password).

Key: `SHOP`\
Type: object (dict)\
Default: none. The installation saves the value; the built-in default is only meant for local development.

**Structure:**

| Field                  | Type   | Default      | Description                                                                                                                                                                                                         |
| ---------------------- | ------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `url`                  | string | –            | Storefront URL, without a trailing slash.                                                                                                                                                                           |
| `password`             | string | –            | Shared password used to sign orders. Must be the same as `password` in the Commerce `B2B_EXTENSION_CONF` environment variable. The installation doesn't save it, and **orders can't be created until it is added.** |
| `shipping_option_slug` | string | –            | Slug of the Commerce shipping option B2B selects for its orders. The installation saves `b2b`.                                                                                                                      |
| `payment_option_slug`  | string | –            | Slug of the Commerce payment option B2B selects for its orders. The installation saves `b2b`.                                                                                                                       |
| `request_timeout`      | number | `30`         | Timeout, in seconds, for each request to Commerce.                                                                                                                                                                  |
| `session_cookie_name`  | string | `osessionid` | Name of the Commerce session cookie. Change it only if the brand's Commerce uses a different session cookie name.                                                                                                   |

**Important behaviour:**

* When the shipping or payment option with the configured slug is not offered at checkout, order creation fails with `{slug} shipping option is not found` or `{slug} payment option is not found`.
* When `password` does not match Commerce, Commerce does not offer the B2B payment option and does not apply B2B discounts, so order creation fails.

**Example:**

```json
{
  "url": "{shop_url}",
  "password": "{shared_password}",
  "shipping_option_slug": "b2b",
  "payment_option_slug": "b2b",
  "request_timeout": 30.0,
  "session_cookie_name": "osessionid"
}
```

### **3. Sub-Division Quotation Approval**

Controls whether quotations created by sub-division users must be approved by their main division first.

Key: `IS_SUB_DIVISION_QUOTATION_APPROVAL_REQUIRED`\
Type: boolean\
Default:

```json
true
```

**Important behaviour:**

* When `true`, a quotation created by a sub-division user starts as `request_approval` and waits for the main division. After the main division approves it, it becomes `pending`.
* When `false`, it starts directly as `pending`, the same as quotations created by main division users.

**Example:**

```json
false
```

### **4. Accept Price Changes After Quotation Approval**

Controls what happens when a product price changes between quotation approval and order creation.

Key: `ACCEPT_PRICE_CHANGES_AFTER_QUOTATION_APPROVAL`\
Type: boolean\
Default:

```json
false
```

**Important behaviour:**

* When `false`, an order whose Commerce total no longer matches the quotation stays `failed` with an `UnpaidAmountCheck` error.
* When `true`, B2B updates the order with the current prices, recalculates its totals and retries the order creation automatically.

**Example:**

```json
true
```

### **5. Quotation Item Export Fields**

Extra columns added to the Excel export of a quotation's items, in addition to the columns requested by the screen.

Key: `QUOTATION_ITEM_EXPORT_FIELDS`\
Type: list of strings\
Default:

```json
[]
```

**Important behaviour:**

* Nested product data is addressed with `__`, for example `product__attributes__integration_collection` or `product__variants__color`.
* Columns appear in a fixed order: first the requested columns, then these columns in the order listed. A column that is both requested and listed appears once.
* When the list is empty, the export contains only the requested columns.

**Example:**

```json
[
  "product__base_code",
  "product__attributes__integration_color_id",
  "product__attributes__integration_collection"
]
```

### **6. User Phone Regex**

Pattern that phone numbers of B2B users and divisions must match.

Key: `USER_PHONE_REGEX`\
Type: string\
Default:

```json
"^(05)\\d{9}$"
```

**Important behaviour:**

* The phone number of a division is used in the delivery address of its orders. Use a pattern that Commerce also accepts for address phone numbers.
* Change `USER_PHONE_FORMAT` together with this setting so that the error message shows a matching example.

**Example:**

```json
"^(\\+49)\\d{10,11}$"
```

### **7. User Phone Format**

Example phone number shown in the validation error when a phone number does not match `USER_PHONE_REGEX`.

Key: `USER_PHONE_FORMAT`\
Type: string\
Default:

```json
"05999999999"
```

**Example:**

```json
"+4915112345678"
```

### **8. Default Currency**

Default currency code of the B2B application.

Key: `DEFAULT_CURRENCY`\
Type: string\
Default:

```json
"try"
```

**Important behaviour:**

* The value must be one of `AVAILABLE_CURRENCIES`.

**Example:**

```json
"eur"
```

### **9. Available Currencies**

Currency codes available in the B2B application.

Key: `AVAILABLE_CURRENCIES`\
Type: list of strings\
Default:

```json
["try"]
```

**Important behaviour:**

* The list cannot be empty, each currency can appear only once, and it must contain `DEFAULT_CURRENCY`.
* To switch to a currency that is not in the list, add it here first, then change `DEFAULT_CURRENCY`.

**Example:**

```json
["try", "eur", "usd"]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.akinon.com/technical-guides/b2b/dynamic-settings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
