# closeSalesOrder

## Overview

Closes a sales order (受注) once fulfilment is complete, transitioning status to CLOSED. Accepts an optional `closeReason`. Thin wrapper over the native `sales` close command.

Input: `id`, `closeReason?`.

## Modules Commands Used

- [sales] CloseSalesOrder

## Exception Handling

| Error Code | Description |
| --- | --- |
| SALES_SALES_ORDER_NOT_FOUND | The specified sales order does not exist |
| SALES_INVALID_ORDER_STATUS | The sales order is not in a status that allows closing |
| SALES_ORDER_NOT_CLOSABLE | The sales order cannot be closed as-is |
