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

/lead

GET, POST,  DELETE

GET and DELETE requests expect parameter docNo of type Int32.

Properties - Sales Order

PropertyCaptionData TypeRequired
CustomerRefCustomerEntityRefTrue
ShipToRefShip ToEntityRefFalse
DocNoNo.Int32False
CustomerPOCustomer POString (25)False
DateDateDateTimeTrue
PromiseDatePromise DateDateTimeTrue
StatusRefStatusEntityRefFalse
ClassRefClassEntityRefFalse
ContactRefContactEntityRefFalse
CurrencyRefCurrencyEntityRefFalse
FOBFOBString (50)False
InternalNotesInternal NotesString (4000)False
MemoMemoString (4000)False
ShippingInstructionsShipping InstructionsString (4000)False
LocationRefLocationEntityRefFalse
ItemSalesTaxRefSales TaxEntityRefFalse
DiscountRefDiscountEntityRefFalse
DiscountAmountDiscount AmountDecimalFalse
DiscountSalesTaxCodeRefDiscount Tax CodeEntityRefFalse
ShipMethodRefShipping MethodEntityRefFalse
ShipAmountShipping AmountDecimalFalse
ShipSalesTaxCodeRefShipping Tax CodeEntityRefFalse
SalesRepRefSales RepEntityRefFalse
TermRefTermsEntityRefFalse
ExchangeRateExchange RateDecimalFalse
BillAddressBill AddressCustomerAddressFalse
ShipAddressShip AddressCustomerAddressFalse
AllowShipPartialAllow Ship PartialBooleanTrue
LineItemsItemsArray of SalesOrderLineItemFalse
CustomFieldsCustom FieldsArray of CustomFieldDataFalse

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