Home > Materials > Advanced Topics > Import Export Data > Empower API > Using The API To Post Data > Purchase Orders
Purchase Orders
Purchase Orders and Purchase Order Items can be created or modified through the API using the function calls
1. CreateOrModifyPurchaseOrder(purchaseOrder As PurchaseOrderData)
This function takes a single argument of data type PurchaseOrderData and returns the Purchase Order Number if created or updated with a success message.
The following data types and whether they are mandatory or not are used
PurchaseOrderData
PurchaseOrderNumber As String (Mandatory if you want to update an existing purchase order)
SupplierName As String (Mandatory)
PurchaseOrderDate As String (Mandatory)
PurchaseOrderStatus As String (Mandatory)
PurchaseOrderOrderedBy As String (Non Mandatory)
PurchaseOrderDescription As String (Non Mandatory)
As a result the request body should be based on the following
<soapenv:Body>
<web:CreateOrModifyPurchaseOrder>
<web:purchaseOrder>
<web:PurchaseOrderNumber> PURCHASE ORDER NUMBER (FOR UPDATE)</web:PurchaseOrderNumber>
<web:SupplierName>SUPPLIER NAME</web:SupplierName>
<web:PurchaseOrderDate>PURCHASE ORDER DATE (YY-MM-DD)</web:PurchaseOrderDate>
<web:PurchaseOrderStatus>PURCHASE ORDER STATUS</web:PurchaseOrderStatus>
<web:PurchaseOrderOrderedBy>ORDERED BY - USERNAME</web:PurchaseOrderOrderedBy>
<web:PurchaseOrderDescription>PURCHASE ORDER DESCRIPTION</web:PurchaseOrderDescription>
</web:purchaseOrder>
</web:CreateOrModifyPurchaseOrder>
</soapenv:Body>
2. AddPurchaseOrderItem(purchaseOrderItem As PurchaseOrderItemData)
This function takes a single argument of data type PurchaseOrderItemData and returns the Purchase Order Number and Item if created with a success message.
The following data types and whether they are mandatory or not are used
PurchaseOrderItemData
PurchaseOrderNumber As String (Mandatory)
MaterialName As String (Mandatory)
PurchaseOrderItemQuantity As String (Mandatory)
PurchaseOrderItemUnitOfMeasure As String (Mandatory)
PurchaseOrderItemPerUnitCost As String (Mandatory)
PurchaseOrderItemRequiredDate As String (Non Mandatory)
PurchaseOrderItemComments As String (Non Mandatory)
PurchaseOrderItemReference As String (Non Mandatory)
As a result the request body should be based on the following
<soapenv:Body>
<web:AddPurchaseOrderItem>
<web:purchaseOrderItem>
<web:PurchaseOrderNumber>PURCHASE ORDER NUMBER</web:PurchaseOrderNumber>
<web:MaterialName>MATERIAL NAME</web:MaterialName>
<web:PurchaseOrderItemQuantity>QUANTITY TO ORDER</web:PurchaseOrderItemQuantity>
<web:PurchaseOrderItemUnitOfMeasure>UNIT OF MEASURE</web:PurchaseOrderItemUnitOfMeasure>
<web:PurchaseOrderItemPerUnitCost>ITEM PER UNIT COST</web:PurchaseOrderItemPerUnitCost>
<web:PurchaseOrderItemRequiredDate>ITEM REQUIRED DATE</web:PurchaseOrderItemRequiredDate>
<web:PurchaseOrderItemComments>ITEM COMMENTS</web:PurchaseOrderItemComments>
<web:PurchaseOrderItemReference>JOB REFERENCE FOR PURCHASE ORDER ITEM</web:PurchaseOrderItemReference>
</web:purchaseOrderItem>
</web:AddPurchaseOrderItem>
</soapenv:Body>
For more information see
Example Code
WDSL Schema
See also
Purchase Orders
See also
|