# CreateSalesOrderInput input


An order as the external source (for example an e-shop) knows it.

## Input fields

### source

`String!` · required

The code of an external source that is set up in your organisation. The API never creates an
external source.

### externalId

`String!` · required

The order's id in the external source. Together with `source`, it identifies the order, so a
repeat is safe.

### externalNumber

`String`

The order number the customer sees.

### sourceUrl

`String`

A link to the order in the e-shop's administration.

### legalEntity

`String`

The code of the legal entity that sells. If omitted, the organisation's default.

### orderedAt

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

When the customer placed the order, on the external source's clock. Not before 2000 and at
most one day ahead.

### currencyCode

`String!` · required

The ISO 4217 code of the order's currency, for example `"EUR"`. Never converted.

### pricesIncludeVat

`Boolean!` · required

Whether every `unitPrice` and charge `amount` includes VAT. `ROUNDING` always does.

### expectedTotal

[`Decimal`](/chameleoon-max/type/decimal)

The external source's total including VAT. When the MAX total differs by a cent or more, MAX
creates the order with its own sums and blocks it for review with the exception
`TOTAL_MISMATCH`. Send any rounding difference as a `ROUNDING` charge.

### vatTreatment

[`VatTreatment`](/chameleoon-max/type/vat-treatment)

The VAT regime of the sale, for the record and the printed order. If omitted, the regime is not
stated. Every `unitPrice` and charge keeps the rate you sent. MAX never checks or recalculates
it.

### vatDestinationCountry

`String`

The EU state whose VAT was charged. Required with `DESTINATION_VAT` (`EL` is normalised to
`GR`) and refused with any other regime. A value that is not an EU state does not refuse the
order: the order is stored without a stated regime, with the exception
`VAT_DESTINATION_NOT_EU`.

### customer

[`CustomerInput!`](/chameleoon-max/type/customer-input) · required

The customer who ordered.

### billingAddress

[`AddressInput!`](/chameleoon-max/type/address-input) · required

The billing address.

### deliveryAddress

[`AddressInput`](/chameleoon-max/type/address-input)

Where the goods go. If omitted, the goods go to the billing address, unless you send a
`pickupPoint`.

### pickupPoint

[`PickupPointInput`](/chameleoon-max/type/pickup-point-input)

The carrier's collection point the customer chose. Never added to the address book.

### deliveryMethod

[`MethodInput`](/chameleoon-max/type/method-input)

The delivery method as the external source names it.

### carrier

[`CarrierProfileInput`](/chameleoon-max/type/carrier-profile-input)

The Chameleoon carrier and profile that ship the order. Both are identifiers; MAX takes the
names from the synchronised carrier catalogue. If omitted, no Chameleoon route is selected. An
unknown or unverifiable pair is not stored as the order's carrier; see the warnings of
[`createSalesOrder`](/chameleoon-max/mutation/create-sales-order).

### paymentMethod

[`PaymentMethod`](/chameleoon-max/type/payment-method)

How the customer intends to pay. Omit it when the external source's method maps to none of
the MAX methods. MAX then stores `BANK_TRANSFER` as a placeholder and blocks the order for
review with the exception `PAYMENT_METHOD_UNKNOWN`. Send `paymentMethodName` so that a user in MAX
can see what the method was.

### paymentMethodName

[`MethodInput`](/chameleoon-max/type/method-input)

The payment method as the external source names it.

### preferredWarehouseId

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

The MAX id of the warehouse to reserve stock from. If omitted, any of the legal entity's
warehouses. A warehouse that is unknown, archived or another company's is ignored, and the
order is blocked for review with the exception `PREFERRED_WAREHOUSE_IGNORED`.

### note

`String`

What the customer wrote with the order.

### internalNote

`String`

The external source's own remark on the order, never the customer's. MAX keeps it as the
order's internal note, which is shown during packing. At most 4000 characters.

### items

[`[CreateSalesOrderItemInput!]!`](/chameleoon-max/type/create-sales-order-item-input) · required

The goods. At least one item.

### charges

[`[SalesOrderChargeInput!]`](/chameleoon-max/type/sales-order-charge-input)

Everything that is not goods: delivery, payment fees, discounts and rounding.

### paid

[`SalesOrderPaidInput`](/chameleoon-max/type/sales-order-paid-input)

Send it when the order is paid in full. Omit it when the order is not paid yet.

### externalIssue

[`ExternalIssueInput`](/chameleoon-max/type/external-issue-input)

The document with which an externally managed warehouse already took the order's goods off its
stock. MAX records each item's `externallyIssuedQuantity`, or its whole quantity, with the
order, as [`reportExternalIssue`](/chameleoon-max/mutation/report-external-issue) does. Requires the `stock.sync` and
`integration.read` permissions. If omitted, nothing is recorded.

## Used by

- [`createSalesOrder`](/chameleoon-max/mutation/create-sales-order) (mutation)
