Sales Orders

Creating Orders

Raising a sales order, and the fields that have no equivalent at the POS.

Last updated 2026-10-13

DigitalKey ERP — Docs · digital-key.co/docs/sales-orders/create-order

Requires subscriptionsales_order.basic20,000 IQD / month
  1. 1

    Start a new order

    Go to Sales Orders and choose New Order.

    Sales Orders — New order form
    New order form
    New order form — The empty order form showing customer selection, dates and the item table.
  2. 2

    Choose the customer

    Their current balance and credit limit are shown once selected, so you can see their position before committing to the order. If the customer has sub-customers, a For box lets you mark the order for one of their people.

  3. 3

    Set the price level

    Level 1 uses each product's retail price, level 2 uses the wholesale price. Set it before adding items so lines are priced correctly from the start.

  4. 4

    Add the items

    Add products with quantities. Prices come from the chosen price level and can be overridden per line, along with line discounts — but not below the product's cost. A product sold by the piece asks Piece or Carton, and can sit on two rows of one order.

    Sales Orders — Order lines
    Order lines
    Order lines — The item table with quantities, unit prices, discounts and line totals.
  5. 5

    Set the dates

    Delivery date is when the goods are due to go out; due date is when payment is expected. Both are optional.

  6. 6

    Save

    The order is saved as a draft by default. Creating one directly as completed needs the Complete orders permission, and is checked like any completion.

Order fields

POST /api/v1/sales-orders
ParameterTypeRequiredDescription
customer_idintegerRequiredCustomer the order is for.
sales_rep_idintegerOptionalUser credited with the sale, when that differs from whoever keys it in.
sale_datedateOptionalOrder date. Defaults to today.
delivery_datedateOptionalWhen the goods are due to be delivered.
due_datedateOptionalWhen payment is due.
price_levelinteger= 1Required1 for retail (sell_price1), 2 for wholesale (sell_price2).
payment_typestring= cashRequiredCash or postpaid.
paid_amountdecimalOptionalAmount paid up front, if any.
discount_total_amtdecimalOptionalOrder-level discount as an amount.
discount_total_pctdecimalOptionalOrder-level discount as a percentage.
notesstringOptionalFree text stored on the order and printed on the invoice.
sub_customer_idintegerOptionalThe customer's person this order is for. Ignored without customer.sub_accounts.
initial_statusstring= draftRequiredStatus to create at. completed needs the Complete orders permission.
itemsarrayRequiredThe order lines.
Each entry in items[]
ParameterTypeRequiredDescription
product_idintegerOptionalProduct being ordered. Omitted for a free-text line.
custom_namestringOptionalItem name for a line with no product record.
is_extra_sellboolean= falseOptionalMarks the line as an unregistered item.
qtydecimalRequiredQuantity ordered.
unit_pricedecimalRequiredPrice per unit.
price_levelinteger= 1OptionalPrice level used for this line.
discount_pctdecimalOptionalLine discount as a percentage.
discount_amtdecimalOptionalLine discount as an amount.
line_totaldecimalRequiredLine total after discount. Recomputed server-side.
WarningCreating an order — at any status short of completed — does not reserve stock. Two orders can be raised for the same last item and both will look fine until one of them is completed.
Noteinitial_status is checked against your permissions on the server. A request to create an order directly as completedwithout the “Complete orders” permission is refused with a 403.

Prices on an order

WarningAnyone raising an order may type a price, but a price that is not one of the product's own — its retail, wholesale or carton price — is refused when it is below the product's cost. This is checked when the order is saved, when it is edited, and again at completion, because the cost may have moved in between.

Credit limit

WarningThe order form warns as soon as the customer's current balance plus this order would exceed their credit_limit, and a draft can still be saved. The limit is enforced at completion: an order whose unpaid part would take the customer past the limit cannot be completed until a payment is taken, the limit is raised, or more is paid up front.

Stock

NoteA draft is never refused for stock — it moves none. Completion is refused when any product on the order is short, for everyone, with no override.

Order history

Every status change is logged with who made it, when, and any reason given. The log is available from the order itself and is the record of how it reached its current state.

Related