Sales Order

Sales Order Object

Sales Order is a transaction involved in the sales cycle.    Like all transactions it is comprised of a Doc portion (Sales Order) and one or more Line Items (SalesOrderLineItem).   

End Point

/salesorder

GET, POST, PUT,  DELETE

GET and DELETE requests expect parameter docNo of type Int32.

Properties - Sales Order

Property Caption Data Type Required Can Update with PUT
CustomerRef Customer EntityRef True False
ShipToRef Ship To EntityRef True
True
DocNo No. Int32 False False
CustomerPO Customer PO String (25) False True
Date Date DateTime True True
PromiseDate Promise Date DateTime True True
StatusRef Status EntityRef False True
ClassRef Class EntityRef False True
ContactRef Contact EntityRef False True
CurrencyRef Currency EntityRef False True
FOB FOB String (50) False True
InternalNotes Internal Notes String (4000) False True
Memo Memo String (4000) False True
ShippingInstructions Shipping Instructions String (4000) False True
LocationRef Location EntityRef False True
ItemSalesTaxRef Sales Tax EntityRef False True
DiscountRef Discount EntityRef False True
DiscountAmount Discount Amount Decimal False True
DiscountSalesTaxCodeRef Discount Tax Code EntityRef False True

AdditionalFeeItemRef


Additional Fee Item


EntityRef
False
True

AdditionalFeeSalesTaxCodeRef


Additional Fee Tax Code


EntityRef
False True

AdditionalFeeAmount


Additional Fee Amount


Decimal False True
ShipMethodRef Shipping Method EntityRef False True
ShipAmount Shipping Amount Decimal False True
ShipSalesTaxCodeRef Shipping Tax Code EntityRef False True
SalesRepRef Sales Rep EntityRef False True
TermRef Terms EntityRef False True
ExchangeRate Exchange Rate Decimal False True
BillAddress Bill Address CustomerAddress False True
ShipAddress Ship Address CustomerAddress False True
AllowShipPartial Allow Ship Partial Boolean True True
LineItems Items Array of SalesOrderLineItem False False
CustomFields Custom Fields Array of CustomFieldData False True

Properties - Sales Order Line Item

Property Caption Data Type Required Read Only
$type This property MUST be included to tell the API what type of item is being added.
The value should be "AOLib7.SalesOrderLineItem, AOLib7"
Id Id Int32 False True
LineNo Line No Int16 False True
ItemRef Item EntityRef True False
Description Description String (4000) False False
LineInstructions Line Instructions String (4000) False False
SalesTaxCodeRef Tax Code EntityRef False False
UomRef UOM EntityRef False False
UomConversionRate UOM Conversion Rate Decimal False False
Price Price Decimal True False
Quantity Quantity Decimal True False
StdCost Std. Cost Decimal False True
StdPrice Std. Price Decimal False True
CustomerPartNo Customer Part No String (50) False False
CustomFields Custom Fields Array of CustomFieldData False False

Json Sample

In order to create a sales order all you really need is the CustomerRef.  To add Line items,  all you need is the ItemRef, Quantity and Price.  Order Time will fill in default customer and item information automatically.  Only include additional properties if you want to override the defaults.   Here are some other rules:

  • In order to override the exchange rate, you must also include a CurrencyRef
  • In order to apply a discount, you must also include a DiscountRef
  • In order to apply shipping, you must also include a ShipMethodRef
  • In order to override the Unit of Measure conversion rate,  you must also include a UomRef. 
{ 
    "CustomerRef": {
        "Id": 21,
        "Name": "Basket Case"
    },
    "ShipToRef": {
        "Id": 2,
        "Name": "Store 56"
    },
	"Date": "2018-10-21T00:00:00",
    "PromiseDate": "2018-10-21T00:00:00",   
    "ShipAddress": {
        
        "Addr1": "Basket Case",
        "Addr2": "764 Harrison St",
        "Addr3": "",
        "Addr4": "",
        "City": "San Francisco",
        "State": "CA",
        "Zip": "94107",
        "Country": "USA",
        "Contact": " ",
        "AltContact": "",
        "Phone": "1025556665",
        "AltPhone": "1015553001",
        "Fax": "",
        "Email": "shop@basketcase.co",
		"Website": "",
        "UpdateCustomerRecord": false
    }, 
    "ShippingInstructions": "Knock on the back door",
    "CustomerPO": "6T56-97",
    "LineItems": [
        {
            "$type": "AOLib7.SalesOrderLineItem, AOLib7",           
            "ItemRef": {
                "Id": 37,
                "Name": "TSS - Grey - SN"
            },           
            "Description": "Company Branded T-Shirt Large GREY Check out our website for other offers!",
            "Price": 42,          
            "SalesTaxCodeRef": {
                "Id": 12,
                "Name": "Non"
            },         
            "Quantity": 12,           
            "CustomFields": [
                {
                    "Name": "SOICust1",
                    "Value": "Valve",
                    "Caption": "H Code"
                }
            ]
        },
        {
            "$type": "AOLib7.SalesOrderLineItem, AOLib7",           
            "ItemRef": {
                "Id": 37,
                "Name": "TSS - Grey - FSN"
            },           
            "Description": "Company Branded T-Shirt XLarge GREY Check out our website for other offers!",
            "Price": 42.5,          
            "SalesTaxCodeRef": {
                "Id": 12,
                "Name": "Non"
            },         
            "Quantity": 6,           
            "CustomFields": [
                {
                    "Name": "SOICust1",
                    "Value": "Dry",
                    "Caption": "H Code"
                }
            ]
        }
    ],  
    "ShipAmount": 15.00,
    "ShipMethodRef": {
                "Id": 12,
                "Name": "UPS"
            },,
    "ShipSalesTaxCodeRef":{
                "Id": 2,
                "Name": "Non"
            },
    "StatusRef": {
        "Id": 8,
        "Name": "Processing"
    },
	"CustomFields": [
        {
            "Name": "SOCust1",
            "Value": "2018-10-24T00:00:00",
            "Caption": "GTD"
        }
    ]
}
Top

Fulfilling a sales order

There are 2 ways to fulfill a sales orders through the API. The simplest method is to call CreateShipDocFromSO which emulates the UI create ship doc function.

Type: Post

End Point: /salesorder/CreateShipDocFromSO

Parameter: docNo Int32


The second way is to create the ship doc through the API will the LinkedLineItemInfo correctly pointing to the sales order to be fulfilled. 

Top