Empower Help

Search:

Display Legacy Contents

IndexBookmarkPrint

Home > Materials > Advanced Topics > Import Export Data > Empower API > Using the API To Retrieve Data > Purchase Orders

Purchase Orders


Purchase Orders can be retrieved through the API using the function calls



1. GetPurchaseOrder(purchaseOrderNumber As String)

This function takes a single argument of data type String and returns the PurchaseOrderComplete if it exists.

<soapenv:Body>
          <web:GetPurchaseOrder>
             <web:purchaseOrderNumber>PURCHASE ORDER NUMBER</web:purchaseOrderNumber>
          </web:GetPurchaseOrder>
</soapenv:Body>


2. GetPurchaseOrderBetweenDates(StartDate,EndDate) 

This function takes a two arguments and returns the list of PurchaseOrderComplete if there are any.

<soapenv:Body>
          <web:GetPurchaseOrderBetweenDates>
           <web:StartDate>START DATE (Format: YYYY-MM-DD)</web:StartDate>
          <web:EndDate>END DATE (Format: YYYY-MM-DD)</web:EndDate>
          </web:GetPurchaseOrderBetweenDates>
</soapenv:Body>


3. GetPurchaseOrderBetweenDatesForSupplier(StartDate,EndDate,SupplierName) 

This function takes a three arguments and returns the list of PurchaseOrderComplete if there are any.

<soapenv:Body>
          <web:GetPurchaseOrderBetweenDates>
           <web:StartDate>START DATE (Format: YYYY-MM-DD)</web:StartDate>
          <web:EndDate>END DATE (Format: YYYY-MM-DD)</web:EndDate>
          <web:SupplierName>SUPPLIER NAME</web:SupplierName>
          </web:GetPurchaseOrderBetweenDates>
</soapenv:Body>


 
The following data types are used

PurchaseOrderComplete

PurchaseOrderHeader As PurchaseOrderData
PurchaseOrderItems As List(Of PurchaseOrderItemData)

PurchaseOrderData
    
PurchaseOrderNumber As String
SupplierName As String
PurchaseOrderDate As String
PurchaseOrderStatus As String
PurchaseOrderOrderedBy As String
PurchaseOrderDescription As String

PurchaseOrderItemData

PurchaseOrderNumber As String
MaterialName As String
PurchaseOrderItemQuantity As String
PurchaseOrderItemUnitOfMeasure As String
PurchaseOrderItemPerUnitCost As String
PurchaseOrderItemRequiredDate As String
PurchaseOrderItemComments As String
PurchaseOrderItemReference As String
    




As a result the request body should be based on the following

Response XML Format,

     <soap:Body>
          <GetPurchaseOrderResponse xmlns="http://empowersoftware.co.nz/WebService">
             <GetPurchaseOrderResult>
                <PurchaseOrderHeader>
                   <PurchaseOrderNumber>PURCHASE ORDER NUMBER</PurchaseOrderNumber>
                   <SupplierName>SUPPLIER NAME</SupplierName>
                   <PurchaseOrderDate>PURCHASE ORDER DATE</PurchaseOrderDate>
                   <PurchaseOrderStatus>PURCHASE ORDER STATUS</PurchaseOrderStatus>
                   <PurchaseOrderOrderedBy>PURCHASE ORDER ORDERED BY</PurchaseOrderOrderedBy>
                   <PurchaseOrderDescription>PURCHASE ORDER DESCRIPTION</PurchaseOrderDescription>
                </PurchaseOrderHeader>
                <PurchaseOrderItems>
                   <!--Zero or more repetitions:-->
                   <PurchaseOrderItemData>
                      <PurchaseOrderNumber>PURCHASE ORDER NUMBER</PurchaseOrderNumber>
                      <MaterialName>MATERIAL NAME</MaterialName>
                      <PurchaseOrderItemQuantity>QUANTITY</PurchaseOrderItemQuantity>
                      <PurchaseOrderItemUnitOfMeasure>UNIT OF MEASURE</PurchaseOrderItemUnitOfMeasure>
                      <PurchaseOrderItemPerUnitCost>ITEM PER UNIT COST</PurchaseOrderItemPerUnitCost>
                      <PurchaseOrderItemRequiredDate>ITEM REQUIRED DATE</PurchaseOrderItemRequiredDate>
                      <PurchaseOrderItemComments>COMMENTS</PurchaseOrderItemComments>
                   </PurchaseOrderItemData>
                </PurchaseOrderItems>
             </GetPurchaseOrderResult>
          </GetPurchaseOrderResponse>
       </soap:Body>







 

For more information see

Example Code
WDSL Schema



 

See also

Purchase Orders

 



 



See also