> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/ce/core-commerce/customer-management/approvals.md).

# Approvals

Here you can find an overview of the Emporix Approval Service, along with its features and benefits. The approval process is relevant only for the B2B customers.

{% hint style="info" %}

* Looking for Management Dashboard guides? Check out the [System Preferences](/ce/management-dashboard/settings/system-preferences.md) and [Customers](/ce/management-dashboard/customer-management/customers.md) guides.
* Looking for related API documentation? Check out the [Approval Service](/api-references/api-guides/companies-and-customers/approval-service.md) API.
  {% endhint %}

## Purpose

An approval process is necessary for the organization to define the correct purchasing flow and budget limits. Depending on the role of the customer who creates an order, some orders are approved automatically, while others require additional confirmation from eligible users.

The approval flow starts when a customer uses the storefront to add products to the cart. Depending on the customer rights and user group they belong to, they either need or need not an approval for the purchase.

## User groups

To improve management of the approval process, the following roles are introduced:

* Customer Administrator - `Admin`
* Purchaser of the Customer - `Buyer`
* Material Manager - `Requester`

By default, approvers are determined by the customer roles and purchasing limits described in this section.

{% hint style="warning" %}
You can also create an **approval group** for a company in Management Dashboard. When an approval group is defined and has members, it overrides the standard approver roles (`Buyer` and `Admin`). Only approval group members can approve approval requests for that company. Users in the `Buyer` or `Admin` groups who are not approval group members are no longer eligible approvers.

When a customer selects an approver during checkout or quote acceptance, only approval group members appear in the approver list. This applies to both orders and quotes.
{% endhint %}

### Admin

When the customer is assigned to the `Admin` group, the checkout triggers in a standard way. There is no additional step to create an order.

```mermaid
---
config:
  layout: fixed
  theme: base
  look: classic
  themeVariables:
    background: transparent
    lineColor: "#9CBBE3"
    arrowheadColor: "#9CBBE3"
    edgeLabelBackground: "#FFC128" 
    edgeLabelTextColor: "#4C5359"
---
flowchart TD
  A["B2B ADMIN"]-->|Product added to cart| B["CART"]
  B -->|Permission check| C["APPROVAL SERVICE"]
  C-->B
  B-->|Checkout triggered| D["ORDER"]
  
  A@{ shape: rounded}
  B@{ shape: rounded}
  C@{ shape: rounded}
  D@{ shape: rounded}
    
   A:::Class_01
   B:::Class_02
   C:::Class_02
   D:::Class_04
     
  classDef Class_02 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#DDE6EE
  classDef Class_01 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#A1BDDC
  classDef Class_04 stroke-width:1px, stroke-dasharray: 0, fill:#F2FAFE, stroke:#4C5359
```

The quote approval flow doesn't require any additional approvals:

```mermaid
---
config:
  layout: fixed
  theme: base
  look: classic
  themeVariables:
    background: transparent
    lineColor: "#9CBBE3"
    arrowheadColor: "#9CBBE3"
    edgeLabelBackground: "#FFC128"
    edgeLabelTextColor: "#4C5359"
---
flowchart TD
  A["B2B ADMIN"] -->|Generate quote| B["QUOTE"]
  C["EMPLOYEE"]-->|Set price| B
  B -->|Iterate as needed| F["Customer ↔ Employee negotiations"]
  F --> B
  B ---->|Permission check| D["APPROVAL SERVICE"]
  D -->|Authorized customer accepts quote| B
  B ------>|Create order| E["ORDER"]
  
  
 A@{ shape: rounded}
  B@{ shape: rounded}
  C@{ shape: rounded}
  D@{ shape: rounded}
  E@{ shape: rounded}
  F@{ shape: rounded}
  
    
   A:::Class_01
   B:::Class_02
   C:::Class_04
   D:::Class_02
   E:::Class_03
   F:::Class_02
   
     
 classDef Class_02 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#DDE6EE
  classDef Class_01 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#A1BDDC
  classDef Class_03 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#F2FAFE
  classDef Class_04 stroke-width:1px, stroke-dasharray: 0, fill:#99ACBC, stroke:#4C5359
```

### Buyer

When the customer is assigned to the `Buyer` group, the approval service checks if the customer has permission to trigger the checkout or to accept a quote.

* If the cart or quote final price is within the assigned company limit, the customer can finish the order themselves.
* If the cart or quote final price exceeds the company limit, the customer creates the approval request for the customer approver - the approvers list can be fetched from the approval service. When the approval is created, the approver can finish the checkout process or accept the negotiated quote price and create an order.

{% hint style="info" %}
The limit applies to the subtotal gross amount.
{% endhint %}

The flow for checkout is as follows:

```mermaid
---
config:
  layout: fixed
  theme: base
  look: classic
  themeVariables:
    background: transparent
    lineColor: "#9CBBE3"
    arrowheadColor: "#9CBBE3"
    edgeLabelBackground: "#FFC128" 
    edgeLabelTextColor: "#4C5359"
---
flowchart TD
  A["B2B BUYER"]-->|Product added to cart| B["CART"]
  B ---->|Permission check| C["APPROVAL SERVICE"]
  C -->|When the price is within the company limit, the checkout is automatically permitted| B
  C -->|Approval request created for the company approver| E["APPROVER"]
  E -->|The approver accepts the order| B
  B ------>|Checkout triggered| D["ORDER"]
 
  
  A@{ shape: rounded}
  B@{ shape: rounded}
  C@{ shape: rounded}
  D@{ shape: rounded}
  E@{ shape: rounded}
    
   A:::Class_01
   B:::Class_02
   C:::Class_02
   D:::Class_03
   E:::Class_04
     
  classDef Class_02 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#DDE6EE
  classDef Class_01 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#A1BDDC
  classDef Class_03 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#F2FAFE
  classDef Class_04 stroke-width:1px, stroke-dasharray: 0, fill:#99ACBC, stroke:#4C5359
```

For quotes, the flow is as follows:

```mermaid
---
config:
  layout: fixed
  theme: base
  look: classic
  themeVariables:
    background: transparent
    lineColor: "#9CBBE3"
    arrowheadColor: "#9CBBE3"
    edgeLabelBackground: "#FFC128"
    edgeLabelTextColor: "#4C5359"
---
flowchart TD
  A["B2B BUYER"] -->|Generate quote| B["QUOTE"]
  C["EMPLOYEE"]-->|Set price| B
  B -->|Iterate as needed| F["Customer ↔ Employee negotiations"]
  F --> B
  B ---->|Permission check| D["APPROVAL SERVICE"]
  D -->|When the quote price is within the company limit, the quote can be accepted by the Buyer| B
  D --->|Approval request created for the company approver| G["APPROVER"]
  G -->|The approver accepts the quote| E
  B -->|Create order| E["ORDER"]
  
  
 A@{ shape: rounded}
  B@{ shape: rounded}
  C@{ shape: rounded}
  D@{ shape: rounded}
  E@{ shape: rounded}
  F@{ shape: rounded}
  G@{ shape: rounded}
  
    
   A:::Class_01
   B:::Class_02
   C:::Class_04
   D:::Class_02
   E:::Class_03
   F:::Class_02
   G:::Class_04
   
     
 classDef Class_02 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#DDE6EE
    classDef Class_01 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#A1BDDC
    classDef Class_03 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#F2FAFE
    classDef Class_04 stroke-width:1px, stroke-dasharray: 0, fill:#99ACBC, stroke:#4C5359
```

### Requester

The requester is a material manager. When the customer is assigned to the `Requester` group, the Approval Service verifies the level of the customer's permissions. The requester customer cannot trigger checkout or accept quotes on their own, so approval needs to be created.

* If the cart price or quote price exceeds the company limit, the customer can only assign a customer approver, who belongs to the `Admin` group.
* If the cart price or quote price is within the company limit, the customer can only assign a customer approver, who belongs to the `Admin` or `Buyer` groups.

For checkout, the flow is as follows:

```mermaid
---
config:
  layout: fixed
  theme: base
  look: classic
  themeVariables:
    background: transparent
    lineColor: "#9CBBE3"
    arrowheadColor: "#9CBBE3"
    edgeLabelBackground: "#FFC128" 
    edgeLabelTextColor: "#4C5359"
---
flowchart TD
  A["B2B REQUESTER"]--->|Product added to cart| B["CART"]
  B --->|Permission check| C["APPROVAL SERVICE"]
  C --->|Approval created by the company approver| E["APPROVER"]
  E --->|The approver accepts the order| D["ORDER"]
 
  
  A@{ shape: rounded}
  B@{ shape: rounded}
  C@{ shape: rounded}
  D@{ shape: rounded}
  E@{ shape: rounded}
    
   A:::Class_01
   B:::Class_02
   C:::Class_02
   D:::Class_03
   E:::Class_04
     
  classDef Class_02 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#DDE6EE
  classDef Class_01 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#A1BDDC
  classDef Class_03 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#F2FAFE
  classDef Class_04 stroke-width:1px, stroke-dasharray: 0, fill:#99ACBC, stroke:#4C5359
```

For quotes, the flow is as follows:

```mermaid
---
config:
  layout: fixed
  theme: base
  look: classic
  themeVariables:
    background: transparent
    lineColor: "#9CBBE3"
    arrowheadColor: "#9CBBE3"
    edgeLabelBackground: "#FFC128"
    edgeLabelTextColor: "#4C5359"
---
flowchart TD
  A["B2B REQUESTER"] -->|Generate quote| B["QUOTE"]
  C["EMPLOYEE"]-->|Set price| B
  B -->|Iterate as needed| F["Customer ↔ Employee negotiations"]
  F --> B
  B ---->|Permission check| D["APPROVAL SERVICE"]
  D -->|Approval request created for the company approver| G["APPROVER"]
  G -->|The approver accepts the quote| E["ORDER"]
  
  
 A@{ shape: rounded}
  B@{ shape: rounded}
  C@{ shape: rounded}
  D@{ shape: rounded}
  E@{ shape: rounded}
  F@{ shape: rounded}
  G@{ shape: rounded}
  
    
   A:::Class_01
   B:::Class_02
   C:::Class_04
   D:::Class_02
   E:::Class_03
   F:::Class_02
   G:::Class_04
   
     
 classDef Class_02 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#DDE6EE
    classDef Class_01 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#A1BDDC
    classDef Class_03 stroke-width:1px, stroke-dasharray: 0, stroke:#4C5359, fill:#F2FAFE
    classDef Class_04 stroke-width:1px, stroke-dasharray: 0, fill:#99ACBC, stroke:#4C5359
```

{% hint style="warning" %}
The approvers list can be fetched from the Approval Service.
{% endhint %}

## Working with approvals

When the approval is created in the storefront, the approving customer receives an email with a notification that the approval request was created. If any additional comments were provided by the requester, they are also sent to the approver.

After a customer creates an approval, the following data is automatically populated:

* Requester - the value is populated based on a customer token.
* Approver - `firstName` and `lastName` values are populated based on the customer ID.
* Resource - refers to an order or a quote, the value is populated based on cart data.
* Expiry date - by default the expiry date is set to +10 days from the day when the approval was created.
* Approval status - the status is set to `PENDING` by default.

Within the existing approval, the following scenarios are possible:

* A requester can update data from the approval: comments, details, delivery windows, statuses. The update is possible only when the approval status is `PENDING.`
* A requester can change status to `CLOSED.`
* An approver can change status to the `APPROVED` or `DECLINED.`
* After expiry date, the approval status is changed automatically to `EXPIRED.`


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.emporix.io/ce/core-commerce/customer-management/approvals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
