# updateValuationPolicy

## Overview

Updates an existing valuation policy's name, default flag, and posting accounts. The costing method is intentionally **not** updatable — changing it after movements have posted would invalidate existing valuation, so a new policy must be created instead. Omitted fields are left unchanged. When posting accounts are supplied they are validated against the policy company's chart of accounts. Setting isDefault to true marks the policy as the company's default (at most one per company); if another policy is already the company's default, it is cleared automatically in the same transaction, so the company is never left without a default mid-update. Returns the updated valuation policy ID.

## Modules Commands Used

- [inventory] UpdateValuationPolicy

## Exception Handling

| Error Code | Description |
| --- | --- |
| INVENTORY_VALUATION_POLICY_NOT_FOUND | The valuation policy does not exist |
| INVENTORY_ACCOUNT_NOT_FOUND | A posting account does not exist in the company's chart of accounts |
| INVENTORY_DEFAULT_VALUATION_POLICY_ALREADY_EXISTS | The company already has a different default valuation policy |
