Restricting purchases for specific products

  • Updated

Setting up a validation rule for purchase orders

This guide explains how to configure a validation rule that issues a warning when purchase orders contain specific products. The warning does not prevent order creation.

Add an assortment code

  1. Navigate to Config > Products > Purchase Orders > Non-purchasable assortment codes.
  2. Enter the assortment code for the product that should trigger validation.

  1. If no assortment codes exist, add them under Products > Properties tab > Assortment codes.

Configure the connector

  1. Go to Config > Advanced > Connector.
     
  2. Add the following configuration:
     
{
    "name": "assortmentCodeValidator",
    "isAuthenticatedManually": false,
    "timeOut": "00:00:00",
    "implementations": [
        "IPurchaseOrderValidator"
    ],
    "properties": [],
    "disableStandardErrorPolicy": false,
    "enabledForMarkets": [],
    "disabledForMarkets": []
}

Assign non-purchasable assortment codes to products

  1. Select the product.
     


 

  1. Add the assortment code to the product.

Add validation to workflow

  • Add purchase order validation to relevant workflow steps.

Validate the Purchase Order

  • If a purchase order includes a restricted product, a validation warning appears.
  • The order can still be processed without removing the product.

Expected behavior

  • A validation message displays when restricted products are included in a purchase order.
  • The purchase order can be completed despite the warning.

This setup ensures that users receive warnings for specific products without blocking order creation.

 

Was this article helpful?