Empower Help

Search:

Display Legacy Contents

IndexBookmarkPrint

Home > Factory Productivity and Scheduling > Advanced Topics > Import Export Data > Empower API > Using The API To Post Data > Customers

Customers


Customers can be created or modified through the API using the function calls


1.  
CreateNewCustomer(CustomerData as NewCustomer)


This function takes a single argument of data type NewCustomer and returns the CustomerId if created with a success message.

If there is an error it returns a CustomerId of 0.

2. To create or modify a customer

CreateOrModifyCustomer(CustomerData As NewCustomer)

If the Customer is not available, it will create a new Customer with the details.  




The following data types and whether they are mandatory or not are used

NewCustomer

Public CustomerName As String (mandatory)
Public CustomerPhone As String (non mandatory)
Public CustomerEmail As String (non mandatory)
Public CustomerWebsite As String (non mandatory)
Public CustomerStatus As String (mandatory)
Public CustomerAddressLine1 As String (non mandatory)
Public CustomerAddressLine2 As String (non mandatory)
Public CustomerCity As String (non mandatory)
Public CustomerState As String (non mandatory)
Public CustomerPostalCode As String (non mandatory)
Public CustomerCountry As String (non mandatory)
Public CustomerDlyAddressLine1 As String (non mandatory)
Public CustomerDlyAddressLine2 As String (non mandatory)
Public CustomerDlyCity As String (non mandatory)
Public CustomerDlyState As String (non mandatory)
Public CustomerDlyPostalCode As String (non mandatory)
Public CustomerDlyCountry As String (non mandatory)
Public CustomerNotes As String (non mandatory)
Public CustomerCode As String (non mandatory)
   
As a result the request body should be based on the following

<soap:Body>
      <web:CreateNewCustomer>
         <web:CustomerData>
            <web:CustomerName>CUSTOMER NAME</web:CustomerName>
            <web:CustomerPhone>CUSTOMER PHONE</web:CustomerPhone>
            <web:CustomerEmail>CUSTOMER EMAIL</web:CustomerEmail>
            <web:CustomerWebsite>CUSTOMER WEBSITE</web:CustomerWebsite>
            <web:CustomerStatus>Current/Non Current</web:CustomerStatus>
            <web:CustomerAddressLine1>CUSTOMER ADDRESSLINE1</web:CustomerAddressLine1>
            <web:CustomerAddressLine2>CUSTOMER ADDRESSLINE2</web:CustomerAddressLine2>
            <web:CustomerCity>CUSTOMER CITY</web:CustomerCity>
            <web:CustomerState>CUSTOMER STATE</web:CustomerState>
            <web:CustomerPostalCode>CUSTOMER POSTALCODE</web:CustomerPostalCode>
            <web:CustomerCountry>CUSTOMER COUNTRY</web:CustomerCountry>
            <web:CustomerDlyAddressLine1>CUSTOMER DELIVERY ADDRESSLINE1</web:CustomerDlyAddressLine1>
            <web:CustomerDlyAddressLine2>CUSTOMER DELIVERY ADDRESSLINE 2</web:CustomerDlyAddressLine2>
            <web:CustomerDlyCity>CUSTOMER DELIVERY CITY</web:CustomerDlyCity>
            <web:CustomerDlyState>CUSTOMER DELIVERY STATE</web:CustomerDlyState>
            <web:CustomerDlyPostalCode>CUSTOMER DELIVERY POSTALCODE</web:CustomerDlyPostalCode>
            <web:CustomerDlyCountry>CUSTOMER DELIVERY COUNTRY</web:CustomerDlyCountry>
            <web:CustomerNotes>CUSTOMER NOTES</web:CustomerNotes>
            <web:CustomerCode>CUSTOMER CODE</web:CustomerCode>
         </web:CustomerData>
      </web:CreateNewCustomer>
   </soap:Body>

The following example may aid in understanding

<soap:Body>
      <web:CreateNewCustomer>
         <web:CustomerData>
            <web:CustomerName>Arrow Ltd</web:CustomerName>
            <web:CustomerPhone>123456789</web:CustomerPhone>
            <web:CustomerEmail>xyx@xyx.com</web:CustomerEmail>
            <web:CustomerWebsite>xyz.com</web:CustomerWebsite>
            <web:CustomerStatus>Current</web:CustomerStatus>
            <web:CustomerAddressLine1>15 The Plaza</web:CustomerAddressLine1>
            <web:CustomerAddressLine2>Plaza Street</web:CustomerAddressLine2>
            <web:CustomerCity>Plaza City</web:CustomerCity>
            <web:CustomerState>Plaza State</web:CustomerState>
            <web:CustomerPostalCode>1234</web:CustomerPostalCode>
            <web:CustomerCountry>New Zealand</web:CustomerCountry>
            <web:CustomerDlyAddressLine1>15 The Plaza</web:CustomerDlyAddressLine1>
            <web:CustomerDlyAddressLine2>Plaza Street</web:CustomerDlyAddressLine2>
            <web:CustomerDlyCity>Plaza City</web:CustomerDlyCity>
            <web:CustomerDlyState>Plaza State</web:CustomerDlyState>
            <web:CustomerDlyPostalCode>1234</web:CustomerDlyPostalCode>
            <web:CustomerDlyCountry>New Zealand</web:CustomerDlyCountry>
            <web:CustomerNotes>This is a test info</web:CustomerNotes>
            <web:CustomerCode>ABC123</web:CustomerCode>
         </web:CustomerData>
      </web:CreateNewCustomer>
   </soap:Body>





For more information see
Example Code
WDSL Schema



 

See also
Setting Up Customers

 



 



See also