---
title: Approve purchases by their amount
project: BPM
version: 1.0
section: recipes
language: en
license: Total.js Enterprise
url: https://totaljs.es/docs/bpm/1-0/recipes/purchase-approval/
updated: 2026-11-20T18:44:32.311Z
---

# Approve purchases by their amount

> A purchase request that goes to one manager or to two people of the management, by its amount.

This recipe builds a purchase request: a request up to 1000 EUR needs the approval of any one manager, a bigger one the approval of two people of the management. Approved and rejected requests are closed with their result.

## 1. Create the process and the forms

**1.** Open **Processes**, select **Create**, enter the **Name** `Purchase request` and select **SUBMIT**. Open its designer.

**2.** Create a form `Purchase request` (see [Forms](../../guides/forms/)) with a **Form** with two fields, **Item** (path `item`, required) and **Amount (EUR)** (path `amount`, type number, required), the button `SEND`, and a Flow Output `Send` for the submit of the form.

**3.** Create a form `Approval` with two **Form** components:
- one with the field **Comment** (path `comment`) and the button `APPROVE`, with a Flow Output `Approve` for its submit,
- one with the field **Reason** (path `comment`) and the button `REJECT`, with a Flow Output `Reject` for its submit.

**4.** Install the **Switch** component. See [Conditions](../../guides/conditions/).

## 2. Draw the process

Drag these nodes onto the canvas and connect them. The form **Approval** is on the canvas twice.

| From | Output | To | Input |
|---|---|---|---|
| **Start** | **Start** | **Purchase request** | **No data** |
| **Purchase request** | **Send** | **Switch** | **Input** |
| **Switch** | **Over 1000** | **Approval** (management) | **No data** |
| **Switch** | **Up to 1000** | **Approval** (manager) | **No data** |
| both **Approval** nodes | **Approve** | **Close** `Approved` | **Payload** |
| both **Approval** nodes | **Reject** | **Close** `Rejected` | **Payload** |

![The purchase request process in the designer](/files/JaulxY1ut61f.webp)

## 3. Configure the nodes

| Node | Settings |
|---|---|
| **Start** | **Name** `Purchase request`, **Permissions** `staff` |
| **Purchase request** | **Workflow action** Create, **Workflow name** `Request`, **Permissions** `staff`, **Template name** `Purchase: {{ value.item }}`, **Template subject** `{{ value.amount }} EUR` |
| **Switch** | **Message data**, path `amount`; conditions `>` Number `1000` named `Over 1000`, and `<=` Number `1000` named `Up to 1000` |
| **Approval** (management) | **Workflow action** Step, **Workflow name** `Management approval`, **Approval by several people** All of them, **Approvers** `mark@example.com, paul@example.com`, **Approve with the button** Approve, **Reject with the button** Reject, **Path of the comment** `comment` |
| **Approval** (manager) | **Workflow action** Step, **Workflow name** `Manager approval`, **Approval by several people** Any one of them, **Approvers** `managers`, the same buttons and path |
| **Close** | **Name** `Approved`, **Template result** `Approved` |
| **Close** | **Name** `Rejected`, **Template result** `Rejected` |

Use the e-mails of your own people and your own permissions. Select **APPLY** in each settings window and in the toolbar. Then select **Publish** in the toolbar, write `First version` and select **PUBLISH**. See [Approvals by several people](../../guides/approvals/) and [Process versions](../../guides/process-versions/).

## 4. Try it

1. In the Inbox, select **Create** > **Purchase request**, enter `Laptops for the new team` and `2400`, and select **SEND**.
2. The task waits at **Management approval** in the Inbox of both approvers. The first one assigns it, writes a comment and selects **APPROVE**. The task leaves their Inbox and waits for the second one.
3. The second approver approves it too. The task is closed with the result **Approved**, and its history shows both decisions with their comments.
4. A request of `300` goes to **Manager approval**, where one decision of any manager is enough.
