Purchase Order

Purchase Order Order Object

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

End Point

/purchaseorder

GET, POST, PUT, DELETE

GET and DELETE requests expect parameter docNo of type Int32.

Properties - Purchase Order

PropertyCaptionData TypeRequiredCan Update with PUT
VendorRefVendorEntityRefTrueFalse
BillAddressRef
Bill ToEntityRefFalseTrue
DocNoNo.Int32FalseFalse
DateDateDateTimeTrueTrue
PromiseDatePromise DateDateTimeTrueTrue
StatusRefStatusEntityRefFalseTrue
ClassRefClassEntityRefFalseTrue
CurrencyRefCurrencyEntityRefFalseTrue
FOBFOBString (50)FalseTrue
InternalNotesInternal NotesString (4000)FalseTrue
MemoMemoString (4000)FalseTrue
LocationRefLocationEntityRefTrueTrue
ShipMethodRefShipping MethodEntityRefFalseTrue
TermRefTermsEntityRefFalseTrue
ExchangeRateExchange RateDecimalFalseTrue
AllowShipPartialAllow Ship PartialBooleanTrueTrue
LineItemsItemsArray of PurchaseOrderLineItemFalseFalse
DropShipCustomerRef
CustomerEntityRef
FalseTrue
DropShipAddressRef
Ship ToEntityRef
True if DropShipCustomerRef is setTrue
DropShipAddress
AddressCustomer AddressFalseFalse
DropShipCustomerPO
Customer POString(50)FalseTrue
CustomFieldsCustom FieldsArray of CustomFieldDataFalseTrue

Properties -Purchase 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.PurchaseOrderLineItem, AOLib7"
IdIdInt32FalseTrue
LineNoLine NoInt16FalseTrue
ItemRefItemEntityRefTrueFalse
DescriptionDescriptionString (4000)FalseFalse
LineInstructionsLine InstructionsString (4000)FalseFalse
SalesTaxCodeRefTax CodeEntityRefFalseFalse
UomRefUOMEntityRefFalseFalse
UomConversionRateUOM Conversion RateDecimalFalseFalse
CostCostDecimalTrueFalse
QuantityQuantityDecimalTrueFalse
VendorPartNoPart NoString (50)FalseFalse
CustomFieldsCustom FieldsArray of CustomFieldDataFalseFalse

Json Sample

In order to create a sales order all you really need is the VendorRef and the BillToAddressRef.  To add Line items,  all you need is the ItemRef, Quantity and Cost.  Order Time will fill in default vendor 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 override the Unit of Measure conversion rate,  you must also include a UomRef. 
{ 
    "VendorRef": {
        "Id": 21,
        "Name": "Basket Case"
    },
    "BillAddressRef": {
        "Id": 2,
        "Name": "Main"
    },
	"Date": "2018-10-21T00:00:00",
    "PromiseDate": "2018-10-21T00:00:00",
    "LocationRef": {
        "Id": 10,
        "Name": "HQ"
    },
    "LineItems": [
        {
            "$type": "PurchaseOrderLineItem,, AOLib7",           
            "ItemRef": {
                "Id": 37,
                "Name": "TSS - Grey - SN"
            },           
            "Description": "Company Branded T-Shirt Large GREY Check out our website for other offers!",
            "Cost": 42,                           
            "Quantity": 12,           
            "CustomFields": [
                {
                    "Name": "POICust1",
                    "Value": "Valve",
                    "Caption": "H Code"
                }
            ]
        },
        {
            "$type": "AOLib7.PurchaseOrderLineItem,, AOLib7",           
            "ItemRef": {
                "Id": 37,
                "Name": "TSS - Grey - FSN"
            },           
            "Description": "Company Branded T-Shirt XLarge GREY Check out our website for other offers!",
            "Cost": 42.5,          
                  
            "Quantity": 6,           
            "CustomFields": [
                {
                    "Name": "POICust1",
                    "Value": "Dry",
                    "Caption": "H Code"
                }
            ]
        }
    ],  
   
    "StatusRef": {
        "Id": 8,
        "Name": "Processing"
     },
	"CustomFields": [
        {
            "Name": "POCust1",
            "Value": "2018-10-24T00:00:00",
            "Caption": "GTD"
        }
    ]
}