# setItemValuationPolicy

## Overview

Assigns a valuation policy to an item in a company by creating (or re-pointing) its ItemValuation record, overriding the default policy that a first valuation-affecting movement would otherwise auto-assign. The policy must belong to the assignment's company since it carries the company's posting accounts. Re-assigning the same policy is idempotent and returns the existing record; once the item has inventory ledger history in the company's sites, the policy is frozen. Returns the ItemValuation ID.

## Modules Commands Used

- [inventory] SetItemValuationPolicy

## Exception Handling

| Error Code | Description |
| --- | --- |
| INVENTORY_ITEM_NOT_FOUND | The referenced item does not exist |
| INVENTORY_VALUATION_POLICY_NOT_FOUND | The referenced valuation policy does not exist |
| INVENTORY_VALUATION_POLICY_COMPANY_MISMATCH | The valuation policy belongs to a different company |
| INVENTORY_ITEM_VALUATION_POLICY_CHANGE_NOT_ALLOWED | The valuation policy cannot be changed once the item has inventory ledger history in the company |
