Skip to main content

Sales Order Service

Sales Order is a confirmation document a seller sends to a buyer before the goods or services are delivered. Once the order is fulfilled, it can be converted into an invoice for payment. Sales orders let you track product quantities and costs across the fulfillment lifecycle, from open, to partially fulfilled, to fully fulfilled.

SalesOrderRequest Object

Attributes


AttributeTypeDescription
openingSalesOrderbooleanHas the value true if the sales order is an opening sales order or false otherwise.
totalAmountBigDecimalTotal amount of the sales order.
totalAmountInBaseCurrencyBigDecimalTotal amount of the sales order in the tenant's base currency.
payableAccountCodestringAccount code of contact's account payable.
taxAmountBigDecimalTax amount of the sales order.
tcsAmountBigDecimalTCS (Tax Collected at Source) amount of the sales order.
tcsRateIdlongIdentifier of the TCS rate applied to the sales order.
tcsPercentageBigDecimalTCS percentage applied to the sales order.
openingDocumentNumberstringOpening document number of the sales order.
warehouseCodestringWarehouse code.
backOrderbooleanHas the value true if the sales order is backorder or false if the sales order is not backorder.
statusenumStatus of the sales order. Possible values for sales order status.
customFieldlistList of key-value pairs for custom field name and its value.
roundOffAmountInBaseCurrencyBigDecimalRound off amount of the sales order in base currency.
roundOffAmountInDocumentCurrencyBigDecimalRound off amount of the sales order in document currency.
attachmentIdslistList of attachment ids of the sales order.
paymentTermstringPayment term of the sales order.
buyerReferencestringBuyer reference of the sales order.
createdDatestringDate on which the sales order was created.
primaryExchangeRateBigDecimalExchange rate against the tenant's primary currency.
multiApprovalDetailsobjectMulti-level approval details for the sales order.
sequenceFormatstringSequence format id.
fulfillmentTypeenumFulfillment type of the sales order. Possible values for fulfillment type.
salesOrderDatestringSales order date.
salesOrderDueDatestringSales order due date.
shipByDatestringShip by date.
contactCodestringContact code.
linkedQuotationDocumentsarrayArray of linked quotation documents.
linkedSalesInvoiceDocumentsarrayArray of linked sales invoice documents.
linkedSalesInvoiceslistList of sales invoices linked to the sales order.
linkedWorkOrderDocumentsarrayArray of linked work order documents.
purchaseOrderRefNostringPurchase order reference number.
customerOrderNumberstringCustomer order number associated with the sales order.
currencystringCurrency code of the sales order.
exchangeRateBigDecimalExchange rate.
gstExchangeRateBigDecimalGST exchange rate.
memostringMemo of the sales order.
attachmentsarrayArray of file attachments.
unitPriceGstInclusivebooleanHas the value true if the unit price is inclusive of GST or false if the unit price is exclusive of GST.
recurringbooleanHas the value true if the sales order is recurring or false if the sales order is not recurring.
recurringActivatedbooleanHas the value true if the recurring is activated for the sales order or false if the recurring is de-activated.
salesOrderItemslistList of items associated with the sales order. Attributes of Sales Order Item Details.
contactobjectContact information.
shipFromobjectShip from address. Attributes for Address.
shipToobjectShip to address. Attributes for Address.
billToobjectBill to address. Attributes for Address.
fulfillmentStatusenumFulfillment status of the sales order. Possible values for fulfillment status.
draftbooleanHas the value true if the sales order is in draft state or false if the sales order is not in draft state.
draftReferenceIdstringDraft reference identifier of the sales order.
fulfillmentCompletebooleanHas the value true if auto fulfilled is required or false if auto fulfilled is not required.
documentSequenceCodestringUnique code associated with the sales order.
isPartialSalesOrderbooleanHas the value true if the sales order is a partial sales order or false otherwise.
errorslistList of validation error messages.
reservedStockbooleanHas the value true if stock is reserved for the sales order or false otherwise.
approvalStatusenumApproval status of the sales order. Possible values for approval status.
additionalChargesobjectAdditional charges applied to the sales order.
seqCodeAlreadyDumpedbooleanHas the value true if the sequence code is already dumped or false otherwise.
poNumberstringPurchase order number.
requestedBylongIdentifier of the user who requested the sales order.

API


Create Sales Order

Creates a new sales order.

Parameters

Code

  @Autowired
private SalesOrdersApiClient salesOrdersApiClient;

public SalesOrderResponse createSalesOrder(SalesOrderRequest salesOrderRequest, String accessToken){
return this.salesOrdersApiClient.createSalesOrder(salesOrderRequest, accessToken);
}

Retrieve Sales Order

Retrieves the details of an existing sales order. You only need to supply the unique sales order code that was returned upon sales order creation.

Parameters

Code

  @Autowired
private SalesOrdersApiClient salesOrdersApiClient;

public SalesOrderResponse getSalesOrderByCode(String salesOrderCode, String accessToken){
return this.salesOrdersApiClient.getSalesOrderByCode(salesOrderCode, accessToken);
}

List All Sales Orders

Returns a paginated list of sales orders.

Parameters

  • accessToken string
  • search string
  • customfield string
  • sort string
  • sortDir string
  • page int
  • limit int

Code

  @Autowired
private SalesOrdersApiClient salesOrdersApiClient;

public Page<SalesOrderResponse> getSalesOrders(String search, String customfield, String sort, String sortDir,
Integer page, Integer limit, String accessToken){
return this.salesOrdersApiClient.getSalesOrders(search, customfield, sort, sortDir, page, limit, accessToken);
}

Update Sales Order

Updates the details of an existing sales order.

Parameters

Code

  @Autowired
private SalesOrdersApiClient salesOrdersApiClient;

public SalesOrderResponse updateSalesOrder(Long id, SalesOrderRequest salesOrderRequest, String accessToken){
return this.salesOrdersApiClient.updateSalesOrder(id, salesOrderRequest, accessToken);
}

Delete Sales Order

Deletes an existing sales order. You only need to supply the unique identifier that was returned upon sales order creation.

Parameters

Code

  @Autowired
private SalesOrdersApiClient salesOrdersApiClient;

public void deleteSalesOrder(Long id, String accessToken){
this.salesOrdersApiClient.deleteSalesOrder(id, accessToken);
}

Send Sales Order Email

Sends an existing sales order to a contact by email.

Parameters

  • sendSalesOrderEmail SendSalesOrderEmail
  • accessToken string

Code

  @Autowired
private SalesOrdersApiClient salesOrdersApiClient;

public void sendSalesOrderEmail(SendSalesOrderEmail sendSalesOrderEmail, String accessToken){
this.salesOrdersApiClient.sendSalesOrderEmail(sendSalesOrderEmail, accessToken);
}

Objects


SalesOrderResponse

SalesOrderResponse includes all attributes of SalesOrderRequest, plus the following response-only attributes.

AttributeTypeDescription
idlongUnique identifier for the sales order.
salesOrderCodestringUnique code associated with the sales order.
contactDtoobjectFull contact details of the sales order's contact.
attachmentsWithLinklistList of attachment details including download links.
amountPaidBigDecimalAmount already paid against the sales order.
balanceDueBigDecimalBalance amount still due on the sales order.
productionStatusstringProduction status of the sales order.
orderProgresslistList of progress details for the sales order.
emailStatusstringStatus of the last email sent for the sales order.
manuallyClosedbooleanHas the value true if the sales order was manually closed or false otherwise.
shortClosedStatusenumShort-closed status of the sales order. Possible values for short closed status.
cogsAmountBigDecimalCost of goods sold amount for the sales order.
createdBylongIdentifier of the user who created the sales order.
updatedBylongIdentifier of the user who last updated the sales order.
printStatusstringPrint status of the sales order.
revertPrintStatusBylongIdentifier of the user who reverted the print status.
revertPrintStatusOnstringDate on which the print status was reverted.

SalesOrderItemDetails

AttributeTypeDescription
idlongUnique identifier for the item.
productCodestringProduct code of the item.
documentSequenceCodestringProduct Document Sequence Code.
productDescriptionstringProduct description of the item.
productQuantityBigDecimalProduct quantity of the item.
uomQuantityBigDecimalQuantity of the item in its unit of measurement.
uomUnitPriceBigDecimalUnit price of the item in its unit of measurement.
documentUomlongUnit of measurement identifier used on the document.
documentUOMSchemaDefinitionobjectUnit of measurement schema definition used on the document.
unitPriceBigDecimalProduct unit price.
discountBigDecimalDiscount on the item.
discountInPercentbooleanHas the value true if discount is in percentage or false if discount is not in percentage.
preTaxGlobalDiscountBigDecimalPre-tax global discount applied to the item.
taxCodestringTax code of the item.
taxAmountBigDecimalTax amount of the item.
totalAmountBigDecimalTotal amount of the item.
productOrderintProduct view order.
salesOrderItemCodestringSales Order Item Code.
typeenumType of the item. Possible values for ProductType.
availableQuantityBigDecimalAvailable quantity of the item.
productobjectProduct details of the item.
taxobjectTax details of the item.
customFieldlistList of key-value pairs for custom field name and its value.
linkedQuoteItemlongIdentifier of the quote item linked to this item.
linkedQuoteItemCodestringCode of the quote item linked to this item.
isPartialSalesOrderbooleanHas the value true if the item belongs to a partial sales order or false otherwise.
updatedPartialQuantityBigDecimalUpdated quantity for a partial sales order item.
itemFulfillmentStatusenumFulfillment status of the item. Possible values for fulfillment status.
quantityFulfilledBigDecimalTotal quantity fulfilled for the item.
quantityFulfilledByUserBigDecimalQuantity fulfilled manually by the user.
quantityFulfilledByFlowoverBigDecimalQuantity fulfilled automatically via flowover.
fulfillmentByDocarrayArray of fulfillment quantities grouped by document.
errorslistList of error messages associated with the item.
lineNumberintLine number of the item.
taxDetailslistList of tax mapping details for the item.
reservedQuantitiesDatalistList of reserved quantity details for the item.
pendingQuantityBigDecimalQuantity still pending fulfillment.
pendingQtyToConvertBigDecimalQuantity pending conversion (e.g. to a work order).
qtyConvertedToWoBigDecimalQuantity converted to a work order.
allocationTypestringAllocation type of the item.
basePriceBigDecimalBase price of the item.
revRecDocumentItemDetailsobjectRevenue recognition details linked to the item.
itemDiscountMethodenumDiscount method applied to the item.
additionalChargesobjectAdditional charges applied to the item.
lineRefNostringLine reference number of the item.
bomComponentGroupDetailsobjectBill-of-materials component group details for the item.
userSetTaxesbooleanHas the value true if taxes were manually set by the user or false otherwise.
isShortClosedbooleanHas the value true if the item is short closed or false otherwise.
shortClosedQuantityBigDecimalQuantity that was short closed.
shortClosedNotesstringNotes recorded when the item was short closed.
isLocalizedUomQtybooleanHas the value true if the unit of measurement quantity is localized or false otherwise.
localizedBaseQtyDiffBigDecimalDifference in base quantity due to localization.
unlocalizedDocumentUOMSchemaDefinitionobjectUnit of measurement schema definition before localization.
salesOrderLineNumberstringSales order line number of the item.
landedCostWeightBigDecimalLanded cost weight of the item.

Address

AttributeTypeDescription
contactNamestringName of the contact associated with the address.
address1stringAddress line 1.
address2stringAddress line 2.
countrystringCountry.
countryCodestringCountry code.
statestringState.
stateCodestringState code.
citystringCity.
postalCodestringPostal Code.
preferredbooleanHas the value true if the address is default or false if the address is not default address.
placeOfSupplystringPlace of supply.
destinationOfSupplystringDestination of supply.
mobileCountryCodestringCountry code of the mobile number.
mobileNumberstringMobile number.
emailIdstringEmail address.
customFieldslistList of key-value pairs for custom field name and its value.

Enums


SALES_ORDER_STATUS

  • DRAFT
  • OPEN
  • CLOSED
  • ARCHIVED
  • PROCESSED

FULFILLMENT_STATUS

  • UNFULFILLED
  • PARTIAL_FULFILLED
  • FULLY_FULFILLED
  • PENDING_FOR_APPROVAL

FULFILLMENT_TYPE

  • NONE
  • DEFAULT
  • PICK_PACK_SHIP
  • DROP_SHIP

APPROVAL_STATUS

  • APPROVED
  • PENDING_FOR_APPROVAL
  • EDITING
  • REJECTED
  • NOT_REQUIRED
  • PULLED_BACK

SHORT_CLOSED_STATUS

  • NONE
  • PARTIALLY_SHORT_CLOSED
  • FULLY_SHORT_CLOSED

ProductType

  • TRACKED
  • NONTRACKED
  • BILL_OF_MATERIALS