Inventory Integration: Web Services

The GovX inventory web service allows partners to push stock quantity data into the GovX system, thereby keeping inventory levels current. The GovX inventory web service is easy to use from most systems and offers the most complete and seamless inventory integration option. 

 

Web Service Overview

The GovX Web Service is a SOAP based service. There are three methods related to inventory management in the GovX web service. 

MethodDescription
GetProductStock Returns a list of all product SKUs listed in the GovX system for a partner
SetProductStock Update stock quantity for a single product SKU
SetStockForProducts Update stock quantity for multiple product SKUs

 

Getting Started

Step 1 | Create Account

Before calling the GovX web service you will need to have a partner account created in GovX. Your GovX Brand Manager can provide you with the credentials. 

Step 2 | Accessing the Web Service

The Web Service is publicly available on both the staging and production servers using the following URI:

Staging server access is cookie protected. To access the staging server please visit http://staging.govx.com/getcookie.html first.

WSDL: To access the WSDL for these services simply add the query string ?wsdl to the URL.

Step 3 | Coordinate Product Codes

When integrating with GovX it is important to establish the product codes that will be used for integration. Typically, the product codes used for integration are UPC but another unique identifier can also be used (such as SKU). It is important that the GovX Brand Manager knows the product code that will be used in integration as it must be set when loading the products into GovX.

Step 4 | Testing

To test the inventory integration the following steps are required to be completed.

  • Call GetProductStock method which will return all SKUs of listed product variants.
  • To update stock quantity either SetProductStock can be used for each product or all products stock quantities can be passed in SetStockForProducts in one go. Examples of both methods are given in next section.

Note that the item identifier field should match the product codes you specified during product load (either UPC or SKU).

 

Methods

GetProductStock method

GetProductStock returns a dataset that represents the products the partner has listed on the GovX site. The following data dictionary represents a valid GovX Product.

Field NameTypeLengthDescription
SKU CHAR 100 The Partner SKU 
UPC CHAR 100 The Partner UPC

 

GetProductStock Sample Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:govx="http://GovX.Service.Inventory">

     <soapenv:Header/>

        <soapenv:Body>

             <govx:GetProductStock>

                    <govx:username>integrate@abc.com</govx:username>

                    <govx:password>pass123</govx:password>

              </govx:GetProductStock>

        </soapenv:Body>

</soapenv:Envelope>

 

GetProductStock Sample Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

     <s:Body>

          <GetProductStockResponse xmlns="http://GovX.Service.Inventory">

               <GetProductStockResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

                    <ErrorMessage i:nil="true"/>

                    <Products>

                         <Product>

                              <SKU>672052374129</SKU>                                         

                              <Published>true</Published>

                              <UPC i:nil="true"/>

                         </Product>

                         <Product>

                               <SKU>672052374135</SKU>                                         

                               <Published>true</Published>

                               <UPC i:nil="true"/>

                         </Product>

                         <Product>

                               <SKU>672052903121</SKU>

                               <Published>false</Published>

                               <UPC i:nil="true"/>

                         </Product>                                                                             

                    </Products>

               </GetProductStockResult>

          </GetProductStockResponse>

     </s:Body>

</s:Envelope>

 

SetProductStock method

Inventory updates can be provided for each partner SKU on the GovX site. The following data dictionary represents a valid inventory stock level update for a product.

Field NameTypeLengthDescriptionFormat/Value
SKU CHAR 100 The Partner UPC or SKU (depending on partner config)  
InventoryLevel NUMBER 8 The stock quantity on hand for the given SKU/UPC and the given availability date  
AvailabilityDate CHAR 20 The availability date for the stock quantity YYYY-MM-DDT00:00:00
ItemIdentifier CHAR 3 The identifier of the product, either SKU or UPC depending on partner configuration SKU, UPC

 

SetProductStock Sample Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:govx="http://GovX.Service.Inventory">

       <soapenv:Header/>

       <soapenv:Body>

             <govx:SetProductStock>

                    <govx:request>

                            <govx:Username>integrate@abc.com</govx:Username>

                            <govx:Password>pass123</govx:Password>

                            <govx:SKU>648478768093</govx:SKU>

                            <govx:InventoryLevel>50</govx:InventoryLevel>

                            <govx:AvailabilityDate>2016-08-18T00:00:00</govx:AvailabilityDate>

                            <ItemIdentifier>Sku</ItemIdentifier>

                      </govx:request>

              </govx:SetProductStock>

       </soapenv:Body>

</soapenv:Envelope> 

 

SetProductStock Sample Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

     <s:Body>

         <SetProductStockResponse xmlns="http://GovX.Service.Inventory">

               <SetProductStockResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

                        <ErrorMessage i:nil="true"/>

                        <InventoryAdjustment>

                             <Product>

                                    <ID>20787</ID>

                                    <SKU>648478768093</SKU>

                                    <OldStockQuantity>0</OldStockQuantity>

                                    <NewStockQuantity>50</NewStockQuantity>

                                    <ItemIdentifier>Sku</ItemIdentifier>

                             </Product>

                        </InventoryAdjustment>

            </SetProductStockResult>

         </SetProductStockResponse>

     </s:Body>

</s:Envelope> 

 

SetStockForProducts method

The SetStockForProducts method allows partners to push inventory updates for multiple products in a single call. Format of xml to be passed in this method is explained below.

Field Name Type Length Description Format/Value
XML CHAR 21 GovX Inventory XML Format See below
ResultStatus CHAR 21 The results for the inventory loading is successful  
ItemIdentifier CHAR 3 The identifier of the product either SKU or UPC depending on partner configuration SKU, UPC

 

SetStockForProducts Sample Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:govx="http://GovX.Service.Inventory">

   <soapenv:Header/>

   <soapenv:Body>

     <govx:SetStockForProducts>

         <govx:username>integrate@abc.com</govx:username>

         <govx:password>abc123</govx:password>    

<govx:xml>&lt;root>&lt;Products>&lt;Product>&lt;SKU>648478768093&lt;/SKU>&lt;Quantity>100&lt;/Quantity>&lt;/Product>&lt;/Products>&lt;/root></govx:xml>

         <govx:itemIdentifier>Upc</govx:itemIdentifier>

     </govx:SetStockForProducts>

   </soapenv:Body>

</soapenv:Envelope> 

 

SetStockForProduts Sample Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

     <SetStockForProductsResponse xmlns="http://GovX.Service.Inventory">

         <SetStockForProductsResult>OK</SetStockForProductsResult>

     </SetStockForProductsResponse>

   </s:Body>

</s:Envelope> 

 

GovX Inventory XML Format for SetStockForProducts

As mentioned earlier, inventory data may be posted in an XML format that is consistent with the web service. If you already have an inventory feed that is in a different XML format you will need to transform the feed into the format specified below. 

 <?xml version="1.0" encoding="utf-8"?>

<Products>

<Product>

<SKU>ABC123DEF</SKU>

<Quantity>0</Quantity>

</Product>

<Product>

<SKU>BAC321FED</SKU>

<Quantity>15</Quantity>

</Product>

<Products>

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.