# createValuationPolicy

## Overview

Creates a new valuation policy for a company. The costing method is selectable — STANDARD (per-item standard cost with purchase price variance on receipts), FIFO (issues consume cost layers first-in-first-out at actual cost), or AVERAGE (issues valued at a moving average); it defaults to STANDARD when omitted and is validated against the allowed set. The policy carries the company's eight posting accounts used by costing journal entries — inventory, accrual (GR/IR clearing), invoice price variance (the AP-to-inventory clearing), COGS, PPV, adjustment, standard cost adjustment, and consumed price variance — each validated against the company's chart of accounts (FIFO and AVERAGE still require all eight accounts but never post to PPV or standard cost adjustment). An optional isDefault flag marks the policy as the company's default (at most one per company); items without an explicit assignment are auto-assigned the default policy on their first valuation-affecting movement.

## Modules Commands Used

- [inventory] CreateValuationPolicy

## Exception Handling

| Error Code | Description |
| --- | --- |
| INVENTORY_COMPANY_NOT_FOUND | The referenced company 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 default valuation policy |
