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

PropertyCaptionData TypeRequiredCan Update with PUT
CustomerRefCustomerEntityRefTrueFalse
ShipToRefShip ToEntityRefTrue
True
DocNoNo.Int32FalseFalse
CustomerPOCustomer POString (25)FalseTrue
DateDateDateTimeTrueTrue
PromiseDatePromise DateDateTimeTrueTrue
StatusRefStatusEntityRefFalseTrue
ClassRefClassEntityRefFalseTrue
ContactRefContactEntityRefFalseTrue
CurrencyRefCurrencyEntityRefFalseTrue
FOBFOBString (50)FalseTrue
InternalNotesInternal NotesString (4000)FalseTrue
MemoMemoString (4000)FalseTrue
ShippingInstructionsShipping InstructionsString (4000)FalseTrue
LocationRefLocationEntityRefFalseTrue
ItemSalesTaxRefSales TaxEntityRefFalseTrue
DiscountRefDiscountEntityRefFalseTrue
DiscountAmountDiscount AmountDecimalFalseTrue
DiscountSalesTaxCodeRefDiscount Tax CodeEntityRefFalseTrue

AdditionalFeeItemRef


Additional Fee Item


EntityRef
False
True

AdditionalFeeSalesTaxCodeRef


Additional Fee Tax Code


EntityRef
FalseTrue

AdditionalFeeAmount


Additional Fee Amount


DecimalFalseTrue
ShipMethodRefShipping MethodEntityRefFalseTrue
ShipAmountShipping AmountDecimalFalseTrue
ShipSalesTaxCodeRefShipping Tax CodeEntityRefFalseTrue
SalesRepRefSales RepEntityRefFalseTrue
TermRefTermsEntityRefFalseTrue
ExchangeRateExchange RateDecimalFalseTrue
BillAddressBill AddressCustomerAddressFalseTrue
ShipAddressShip AddressCustomerAddressFalseTrue
AllowShipPartialAllow Ship PartialBooleanTrueTrue
LineItemsItemsArray of SalesOrderLineItemFalseFalse
CustomFieldsCustom FieldsArray of CustomFieldDataFalseTrue

Properties - Sales Order Line Item

PropertyCaptionData TypeRequiredRead Only
$typeThis property MUST be included to tell the API what type of item is being added.
The value should be "AOLib7.SalesOrderLineItem, AOLib7"
IdIdInt32FalseTrue
LineNoLine NoInt16FalseTrue
ItemRefItemEntityRefTrueFalse
DescriptionDescriptionString (4000)FalseFalse
LineInstructionsLine InstructionsString (4000)FalseFalse
SalesTaxCodeRefTax CodeEntityRefFalseFalse
UomRefUOMEntityRefFalseFalse
UomConversionRateUOM Conversion RateDecimalFalseFalse
PricePriceDecimalTrueFalse
QuantityQuantityDecimalTrueFalse
StdCostStd. CostDecimalFalseTrue
StdPriceStd. PriceDecimalFalseTrue
CustomerPartNoCustomer Part NoString (50)FalseFalse
CustomFieldsCustom FieldsArray of CustomFieldDataFalseFalse

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"
        }
    ]
}