Sales Orders Mutations

CreateOrder

Creates a new sales order record from scratch.

Parameters:

ParameterTypeDescription
inputOrderInput!All order data.

Example Query:

mutation CreateOrder($input: OrderInput!) {
  CreateOrder(input: $input) {
    id
    label
    status
    dated_at
  }
}

CreateOrderFrom

Creates a sales order by copying data from existing Estimates.

Parameters:

ParameterTypeDescription
inputOrderFromInput!IDs of source documents.

UpdateOrder

Updates an existing sales order record.

Parameters:

ParameterTypeDescription
idInt!ID of the order document.
inputOrderInput!Fields to update.

DeleteOrder / DeleteOrders

Deletes one or multiple sales orders.


DuplicateOrder

Creates a full copy of an existing sales order.


GenerateOrderNumber

Generates the next available sequence label for a new sales order.

ParameterTypeDescription
location_idIDOptional location to use for sequence prefix.

GenerateOrdersPdfs

Generates PDF documents for multiple sales orders.


TransformIntoShippingOrder

Converts a sales order into a Shipping Order for delivery.


TransformIntoProductReturn

Converts a sales order into a Product Return for goods reversal.


Input Data Types

OrderInput

FieldTypeDescription
idIntID for updates.
labelStringOrder number.
notesStringPublic notes.
statusOrderStatusInitial or updated status.
update_on_handBooleanImpact on-hand stock immediately.
dated_atDateSales order date.
shipping_atDateTarget shipping date.
customerCustomerInputLinked customer.
line_items[LineItemOrderInput]List of items ordered.
shipping_addressAddressInputDelivery address link.
automatically_assign_batch_numbersBooleanAuto-pick batch numbers if applicable.
automatically_assign_serial_numbersBooleanAuto-pick serial numbers if applicable.
total_unitsFloatTotal units for the order.
payment_statusPaymentStatusManual status override.
shipping_statusShippingStatusManual status override.
exchange_rateFloatCurrency exchange rate.
tax_typeTaxType"exclusive" or "inclusive".
internal_notesStringPrivate office notes.
billing_addressAddressInputBilling address link.
pdf_templatePdfTemplateInputPDF template link.
sourceStringOrigin of the order.
account_representativeAccountRepresentativeInputRepresentative link.
external_referenceStringCustomer reference.
for_the_attention_ofStringContact name on PDF.
season_idIntSeason link ID.
seasonSeasonInputSeason link data.
payment_informationPaymentInformationInputBank details link.
default_discountFloatGlobal discount value.
discount_typeDiscountType"percentage" or "amount".
currencyCurrencyInputCurrency link data.
price_levelPriceLevelInputPrice list link.
files[FileInput]Attachments.
custom_fields[EntityCustomFieldInput]Custom fields for this entity.

OrderFromInput

FieldTypeDescription
Estimate[Int]Source Estimate IDs array.
statusOrderStatusStatus for the resulting order.

Enums

OrderStatus

ValueDescription
unpublishedDraft status (hidden).
pending_validationAwaiting approval.
activeConfirmed and in progress.
completedFulfilled and closed.
archivedMoved to history.
cancelledDocument voided.

ShippingStatus

ValueDescription
not_shippedNo goods sent yet.
partially_shippedSome goods documented for shipping.
shippedAll goods documented for shipping.

PaymentStatus

ValueDescription
unpaidNo payment received.
partially_paidPartial payment received.
paidTotal value fully settled.

DiscountType

ValueDescription
amountFixed discount amount.
percentagePercentage-based discount.

TaxType

ValueDescription
exclusiveTax calculated on top of the net price.
inclusiveTax included in the displayed price.