# ExternalIssueInput input


The document with which an externally managed warehouse already took the order's goods off its
stock, such as an invoice that issues stock, recorded together with the order in
[`createSalesOrder`](/chameleoon-max/mutation/create-sales-order). MAX records each item's `externallyIssuedQuantity`, or its whole
quantity, as [`reportExternalIssue`](/chameleoon-max/mutation/report-external-issue) does, under the same rules and caller contract.

- Requires the `stock.sync` and `integration.read` permissions in addition to `order.write`.
- A repeat of [`createSalesOrder`](/chameleoon-max/mutation/create-sales-order) records nothing again.
- `CONFLICT` with `extensions.reason` `STOCK_NOT_MASTERED` (field `externalIssue.warehouseId`)
  means that no external system manages the warehouse.
- A refusal reason of [`reportExternalIssue`](/chameleoon-max/mutation/report-external-issue) is returned on
  `items[i].externallyIssuedQuantity`.
- `VALIDATION` is returned on `externalIssue.*` or `items[i].externallyIssuedQuantity`.
- After any of these refusals, nothing is created.

## Input fields

### warehouseId

[`UUID!`](/chameleoon-max/type/uuid) · required

The warehouse's MAX id. An external system must manage the warehouse (see
[`syncStockLevels`](/chameleoon-max/mutation/sync-stock-levels)).

### effectiveAt

[`Time!`](/chameleoon-max/type/time) · required

When the document took the goods off stock, on the external system's clock, which is the
clock of `asOf` in [`syncStockLevels`](/chameleoon-max/mutation/sync-stock-levels). At most 15 minutes ahead of the MAX clock.

### documentExternalId

`String!` · required

The document's id in the external system, for example the invoice's. 1 to 128 bytes, trimmed.

## Used by

- [`CreateSalesOrderInput`](/chameleoon-max/type/create-sales-order-input)
