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
Property | Caption | Data Type | Required | Can Update with PUT |
VendorRef | Vendor | EntityRef | True | False |
BillAddressRef | Bill To | EntityRef | False | True |
DocNo | No. | Int32 | False | False |
Date | Date | DateTime | True | True |
PromiseDate | Promise Date | DateTime | True | True |
StatusRef | Status | EntityRef | False | True |
ClassRef | Class | 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 |
LocationRef | Location | EntityRef | True | True |
ShipMethodRef | Shipping Method | EntityRef | False | True |
TermRef | Terms | EntityRef | False | True |
ExchangeRate | Exchange Rate | Decimal | False | True |
AllowShipPartial | Allow Ship Partial | Boolean | True | True |
LineItems | Items | Array of PurchaseOrderLineItem | False | False |
DropShipCustomerRef | Customer | EntityRef | False | True |
DropShipAddressRef | Ship To | EntityRef | True if DropShipCustomerRef is set | True |
DropShipAddress | Address | Customer Address | False | False |
DropShipCustomerPO | Customer PO | String(50) | False | True |
CustomFields | Custom Fields | Array of CustomFieldData | False | True |
Properties -Purchase 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.PurchaseOrderLineItem, 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 |
Cost | Cost | Decimal | True | False |
Quantity | Quantity | Decimal | True | False |
VendorPartNo | 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 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" } ] }