Peoplevox

Importing Data

The following article provides information on the two methods used together to import data into the WMS:

API Call

Description

GetSaveTemplate

This API method allows a caller to request the integration template associated with a particular data type, which defines the available columns and their mapped names

SaveData

This API method allows a caller to push CSV data into the WMS


GetSaveTemplate

The GetSaveTemplate method returns the CSV template for use with the SaveData function.


Parameters

  • string: templateName

Please refer to the Templates section to see what Template names can be used.


Return Value

IntegrationResponse object

  • ResponseId: 0 if call has succeeded; -1 if failed.

  • Detail: Contains the template in CSV format if the call has succeeded; otherwise, the error detail is returned.

  • TotalCount: Contains 1 if the authentication succeeded; otherwise, 0.

Note: Placeholders string and int need to be replaced by actual values:


POST /clientid/Resources/IntegrationServicev4.asmx HTTP/1.1
Host: string
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.peoplevox.net/GetSaveTemplate"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
  <UserSessionCredentials xmlns="http://www.peoplevox.net/">
   <UserId>int</UserId>
   <clientId>string</clientId>
   <SessionId>string</SessionId>
  </UserSessionCredentials>
</soap:Header>
<soap:Body>
  <GetSaveTemplate xmlns="http://www.peoplevox.net/">
   <templateName>string</templateName>
  </GetSaveTemplate>
</soap:Body>
</soap:Envelope> 


The WMS sends back a response as follows:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
  <GetSaveTemplateResponse xmlns="http://www.peoplevox.net/">
   <GetSaveTemplateResult>
    <ResponseId>int</ResponseId>
    <TotalCount>int</TotalCount>
    <Detail>string</Detail>
   </GetSaveTemplateResult>
  </GetSaveTemplateResponse>
</soap:Body>
</soap:Envelope> 


C# Example

var result = service.GetSaveTemplate("Item types"); 


SaveData

The SaveData method is used to import data into the Warehouse Management System.


Parameters


Return Value

IntegrationResponse object.

  • Detail: Contains error detail if failed; otherwise, it is empty.

  • TotalCount: Numbers of records saved.

Note: Placeholders string and int need to be replaced by actual values:


POST /clientid/Resources/IntegrationServicev4.asmx HTTP/1.1
Host: string
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.peoplevox.net/SaveData"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
  <UserSessionCredentials xmlns="http://www.peoplevox.net/">
   <UserId>int</UserId>
   <clientId>string</clientId>
   <SessionId>string</SessionId>
  </UserSessionCredentials>
</soap:Header>
<soap:Body>
  <SaveData xmlns="http://www.peoplevox.net/">
   <saveRequest>
    <TemplateName>string</TemplateName>
    <CsvData>string</CsvData>
    <Action>int</Action>
   </saveRequest>
  </SaveData>
</soap:Body>
</soap:Envelope> 


The WMS sends back a response as follows:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
  <SaveDataResponse xmlns="http://www.peoplevox.net/">
   <SaveDataResult>
    <ResponseId>int</ResponseId>
    <TotalCount>int</TotalCount>
    <Detail>string</Detail>
   </SaveDataResult>
  </SaveDataResponse>
</soap:Body>
</soap:Envelope> 


C# Example

// Get carriers template
var csvHeader = service.GetSaveTemplate("Carriers");
var result = service.SaveData(newSaveRequest()

{
    TemplateName = "Carriers",
    /*
    “Name”, “Reference”
    “DHL”, “D0001”
    “FedEx”, “F0002”
    */
    CsvData = csvHeader.Detail + " DHL,D0001 FedEx, F0002",
    Action = 0
});


Deleting Data

SaveData supports both upserts and deletions. The Action property on the request determines which operation runs. Actions 0 and 1 behave the same (legacy distinction), but you should use 0 going forward.


Note: Because each API call applies its Action to all included records—not to individual lines—you may need multiple API calls for a single transaction. For instance, if you swap one product for another on a sales order, make one SaveData call to remove the incorrect item and another to create the new one. Continue to batch calls as recommended in the Best Practices guide: first delete any relevant records, then create or update new ones.


Action 0: Create / Update

The request creates a new record if one with the specified identifier does not exist, or updates the existing record if it does. For example, the following SOAP body adds a sales order line item with a quantity of 1 to the specified sales order. If that item already exists, the request updates its quantity to 1.


<soap:Body>

<peop:SaveData>

<peop:saveRequest>

<peop:TemplateName>Sales order items</peop:TemplateName>

<peop:CsvData>SalesOrderNumber,ItemCode,Line,QuantityOrdered

ExampleOrderNumber,ExampleItemCode,ExampleLine1,1</peop:CsvData>

<peop:Action>0</peop:Action>

</peop:saveRequest>

</peop:SaveData>

</soap:Body>


Action 2: Delete

This request removes the sales order line item identified by the combination of order number, item code and line number. The quantity field is not required, because only the columns needed to identify the record must be provided.


<soap:Body>

<peop:SaveData>

<peop:saveRequest>

<peop:TemplateName>Sales order items</peop:TemplateName>

<peop:CsvData>SalesOrderNumber,ItemCode,Line

ExampleOrderNumber,ExampleItemCode,ExampleLine1</peop:CsvData>

<peop:Action>2</peop:Action>

</peop:saveRequest>

</peop:SaveData>

</soap:Body>


Back to Top