API DOCUMENTATION
    Try Unleashed Now Sandbox

    Sales Orders

    The SalesOrders resource allows sales orders to be listed, viewed, and created. An individual sales order’s details can be viewed by appending its identifier (a GUID formatted as XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) to the URI.

    The full range of URIs and HTTP Verbs supported are:

    Operation HTTP Action
    List all Sales Orders GET /SalesOrders
    View the Sales Orders for a specific page GET /SalesOrders/{pageNumber}
    GET /SalesOrders/Page/{pageNumber}
    View a Sales Order with the specified Guid GET /SalesOrders/{orderGuid}
    Create a new Sales Order POST /SalesOrders/{orderGuid}
    Complete a Sales Order POST /SalesOrders/{orderGuid}/Complete
    Update a Sales Order PUT /SalesOrders/{orderGuid}
    Delete a Sales Order DELETE /SalesOrders/{orderGuid}
    Delete a Sales Order Line DELETE /SalesOrders/Lines/{lineGuid}

    GET Sales Orders

    Available Filters for GET Sales Orders
    Filter Description
    completedAfter Returns sales orders completed after the specified date.
    completedBefore Returns sales orders completed before the specified date.
    customerCode Returns orders that start with the specific customer code.
    customerId Only returns orders for a specified Customer GUID. The CustomerId can be specified as a list of comma-separated GUIDs.
    customOrderStatus Returns orders with the specified custom status. Multiple selection can be specified as comma separated. If specified, this filter will override the orderStatus filter.
    endDate Returns orders with order date before the specified date.
    modifiedSince Returns orders created or edited after a specified date, must be UTC format.
    orderNumber Returns a single order with the specified order number. If set, it overrides all other filters.
    orderStatus Returns orders with the specified status. Multiple selection can be specified as comma separated. For example: orderStatus=Completed,Backordered. If no orderStatus filter is specified, then we exclude "Deleted" by default.
    pageSize Specifies the page size for pagination, default is 200 orders.

    Note: Requesting large numbers of orders can be susceptible to poor network performance. Please reduce the page size if you experience delayed requests.
    serialBatch False by default. If set to true then the attributes SerialNumbers and BatchNumbers are displayed.
    sourceId Returns orders with the specified sourceId. If set, it overrides all other filters.
    startDate Returns orders with order date after the specified date.
    warehouseCode Returns sales orders with the specified warehouse code.
    Note: Date filters should be provided in the ISO format YYYY-MM-DD.

    Filters are used by adding the filter and value to the URI:
    • /SalesOrders?customerCode=ACME&startDate=2012-01-01

    Tip: To efficiently retrieve a count of the orders that match a filter, specify a pageSize of 0: /SalesOrders?orderStatus=Parked,Placed&pageSize=0. The default ordering is by LastModifiedOn descending.

    Available Fields for GET Sales Orders
    Property Type Length Notes
    BCSubTotal Nullable Decimal Base Currency SubTotal
    BCTaxTotal Nullable Decimal Base Currency TaxTotal
    BCTotal Nullable Decimal Base Currency Total
    Comments String 2048
    CompletedDate Nullable DateTime UTC timezone only
    CreatedBy String 50
    CreatedOn DateTime
    Currency Currency
    Customer Customer
    CustomerRef String 500
    CustomOrderStatus String 15
    DeliveryCity String 500
    DeliveryContact DeliveryContact
    DeliveryCountry String 500
    DeliveryInstruction String 500
    DeliveryMethod String 50
    DeliveryName String 500
    DeliveryPostCode String 50
    DeliveryRegion String 500
    DeliveryStreetAddress String 500
    DeliveryStreetAddress2 String 500
    DeliverySuburb String 500
    DiscountRate Decimal
    ExchangeRate Nullable Decimal
    Guid Guid
    LastModifiedBy String 50
    LastModifiedOn Nullable DateTime
    OrderDate Nullable DateTime
    OrderNumber String 20
    OrderStatus String 20
    PaymentDueDate Nullable DateTime UTC timezone only
    ReceivedDate Nullable DateTime UTC timezone only
    RequiredDate Nullable DateTime
    CompletedDate Nullable DateTime UTC timezone only
    SalesOrderGroup String 50
    SalesAccount String 50
    SalesOrderLines SalesOrderLine collection
    SalesPerson SalesPerson
    SourceId String 500
    SubTotal Decimal
    Tax Tax
    TaxRate Nullable Decimal
    TaxTotal Decimal
    Total Decimal
    TotalVolume Nullable Decimal
    TotalWeight Nullable Decimal
    Warehouse Warehouse
    XeroTaxCode String 50
    Available Fields for Currency
    Property Type Length
    CurrencyCode String 3
    Description String 200
    DefaultBuyRate Decimal
    DefaultSellRate Decimal
    Guid Guid
    LastModifiedOn DateTime
    Available Fields for Customer
    Property Type Length
    CurrencyId Integer
    CustomerCode String 500
    CustomerName String 500
    Guid Guid
    LastModifiedOn DateTime
    Available Fields for Delivery Contact
    Property Type Length
    EmailAddress String 500
    FirstName String 500
    Guid Guid
    LastName String 500
    MobilePhone String 500
    OfficePhone String 500
    PhoneNumber String 500
    Available Fields for Sales Person
    Property Type Length
    Email String 500
    FullName String 500
    Guid Guid
    Obsolete Boolean
    LastModifiedOn DateTime
    Available Fields for Tax
    Property Type Length
    CanApplyToExpenses Boolean
    CanApplyToRevenue Boolean
    Description String 50
    Guid Guid
    LastModifiedOn DateTime
    Obsolete Boolean
    TaxCode String 25
    TaxRate Decimal
    Available Fields for Warehouse
    Property Type Length
    AddressLine1 String 500
    AddressLine2 String 500
    City String 500
    ContactName String 50
    Country String 500
    DDINumber String 25
    FaxNumber String 25
    Guid Guid
    IsDefault Boolean
    LastModifiedOn DateTime
    MobileNumber String 25
    Obsolete Boolean
    PostCode String 500
    PhoneNumber String 25
    Region String 500
    StreetNo String 500
    Suburb String 500
    WarehouseCode String 15
    WarehouseName String 100
    Available Fields for Sales Order Lines
    Property Type Length Notes
    Assembly Assembly
    BCLineTax Decimal
    BCLineTotal Decimal
    BCUnitPrice Decimal
    Comments String 1024
    CostOfGoodsAccount String 50
    DiscountRate Decimal
    DueDate DateTime This field is deprecated and will be removed in a future version of the API.
    Guid Guid
    LastModifiedOn Nullable DateTime
    LineNumber Integer
    LineType String
    LineTax Decimal
    LineTaxCode String 50
    LineTotal Decimal
    OrderQuantity Decimal
    Product Product
    TaxRate Nullable Decimal
    UnitCost Nullable Decimal
    UnitPrice Decimal
    Volume Nullable Decimal
    Weight Nullable Decimal
    XeroSalesAccount String 500
    XeroTaxCode String 50
    Available Fields for Assembly
    Property Type Length
    Guid Guid
    AssemblyNumber String 15
    AssemblyStatus String 15
    Available Fields for Product
    Property Type Length
    Guid Guid
    ProductCode String 100
    ProductDescription String 500

    Examples for Response GET /SalesOrders

    show xml example
    show json example

    Examples for Response GET /SalesOrders/{orderGuid}

    show xml example
    show json example

    POST / PUT Sales Orders

    Available Filters for POST/PUT Sales Orders
    Filter Description
    saveAddress False by default. If saveAddress=true and there is a delivery name, it will add/update the customer address. If there is no delivery name, the customer address will not be updated.
    sendAccountingJournalOnly When creating a sales order, if you want to pass only a journal and not the invoice into Xero / QuickBooks Online, you can set the parameter to true.
    serialBatch If set to true then the attributes SerialNumbers and BatchNumbers are auto-assigned.
    taxInclusive Order includes sales tax on each of the order lines. Note that Unleashed will re-calculate the order exclusive of tax before saving it.
    Filters are used by adding the filter and value to the URI:
    • /SalesOrders/E6E8163F-6911-40e9-B740-90E5A0A3A996?taxInclusive=true
    • /SalesOrders/E6E8163F-6911-40e9-B740-90E5A0A3A996?SendAccountingJournalOnly=true
    • /SalesOrders/E6E8163F-6911-40e9-B740-90E5A0A3A996?serialBatch=true
    Available Fields for POST/PUT Sales Orders

    Note: If one of the editable fields for PUT is blank, the previous value will be overwritten with the blank value

    Property Type Length POST PUT Notes
    Comments String 2048
    CreatedBy String N/A
    Currency Currency N/A Must match Customer’s currency if specified
    Customer Customer Required N/A
    CustomerRef String 500
    DeliveryCity String 500
    DeliveryCountry String 500 Either CountryCode or CountryName can be provided. 2 character country codes are validated against the ISO 3166 list
    DeliveryInstruction String 500 Null or missing property will not override existing information
    DeliveryMethod String 50
    DeliveryName String 500
    DeliveryPostCode String 50
    DeliveryRegion String 500
    DeliveryStreetAddress String 500
    DeliveryStreetAddress2 String 500
    DeliverySuburb String 500
    DiscountRate Decimal
    ExchangeRate Decimal Required Required
    Guid Guid Required N/A
    OrderDate DateTime N/A
    OrderNumber String 20 N/A
    OrderStatus String 20 Required Required
    ReceivedDate DateTime N/A
    RequiredDate DateTime
    SalesOrderGroup String 50
    SalesOrderLines SalesOrderLine collection Required At least one must be specified.
    SalesPerson SalesPerson
    SourceId String 500
    SubTotal Decimal (2dp) Required N/A SubTotal = Sum of SalesOrderLine Totals
    Tax Tax Required Required
    TaxRate Decimal Required N/A
    TaxTotal Decimal (2dp) Required N/A TaxTotal = Sum of SalesOrderLine Taxes
    Total Decimal (2dp) Required N/A Total = TaxTotal + SubTotal
    Warehouse Warehouse
    Available Fields for Currency

    Note: At a minimum, a valid Guid or CurrencyCode is required.

    Property Type Length POST
    CurrencyCode String 3 Optional
    Guid Guid Optional
    Available Fields for Customer

    Note: At a minimum, a valid Guid or CustomerCode is required.

    Property Type Length POST
    Guid Guid Optional
    CustomerCode String 500 Optional
    Available Fields for Sales Person
    Property Type Length POST
    Email String 256
    FullName String 256
    Guid Guid Required
    Available Fields for Tax

    Note: At a minimum, a valid TaxCode or TaxRate is required.

    Property Type Length POST
    TaxCode String 25 Optional
    TaxRate Decimal Optional
    Available Fields for Warehouse

    Note: At a minimum, a valid Guid or WarehouseCode is required.

    Property Type Length POST
    Guid Guid Optional
    WarehouseCode String 15 Optional
    Available Fields for Sales Order Lines

    Note: Please note that it is not possible to add new lines or amend existing lines to an existing Sales Order via the API

    Property Type Length POST Notes
    BatchNumbers BatchNumber Not supported in PUT
    Comments String 1024
    DiscountRate Decimal Required
    Guid Guid
    LineNumber Integer Required
    LineType String Required Accepts Charge or Null only.
    LineTax Decimal (2dp) Required
    LineTotal Decimal (2dp) Required
    OrderQuantity Decimal Required
    Product Product Required
    SerialNumbers SerialNumber Not supported in PUT
    TaxRate Decimal
    UnitPrice Decimal Required For Charge - this will be rounded to 2 decimal places
    Volume Decimal
    Weight Decimal
    XeroSalesAccount String 500
    XeroTaxCode String 50
    Available Fields for Batch Number

    Note: If not defined OR the batch is not in the selected warehouse, post will succeed and batch numbers will not be allocated.

    Property Type Length POST
    BatchNumber (XML) / Number (JSON) String 50 Required
    Quantity Decimal Required
    ExpiryDate Nullable DateTime
    Available Fields for Product

    Note: At a minimum, a valid Guid or ProductCode is required.

    Property Type Length POST
    Guid Guid Optional
    ProductCode String 100 Optional
    Available Fields for Serial Number

    Note: If not defined OR the serials are not in the selected warehouse, post will succeed and serial numbers will not be allocated.

    Property Type Length POST
    SerialNumber (XML) / Identifier (JSON) String 50 Required

    Examples for Request POST /SalesOrders/{orderGuid}

    show xml example
    show json example

    Use the API Sandbox to see how the object is rendered in JSON or XML.

    Note: An Unleashed account is required before you can use the API Sandbox.

    Trial accounts are also allowed to connect to the API.
    You can register a new account here: Register.