ProductService

To use this service, you need a sessionId from the Authenticate Service under the api.24sevenoffice.com domain.

This service is used to retrieve and save information about products. A product always belongs to a category, so in order to save a new product you need to know which category it should belong to. You can get a complete list of categories by invoking the GetCategories method.

ProductService
ProductService WSDL

Data Types

Guides

Save Products

The minimum required properties for saving a new product are CategoryId and Name as a request to SaveProducts, but you will typically want to include more properties.

Below is a simple XML example for a request to the SaveProducts method:

<?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>
    <SaveProducts xmlns="http://24sevenOffice.com/webservices">
      <products>
        <Product>
          <Name>TestProduct</Name>
          <CategoryId>1</CategoryId>
        </Product>
      </products>
    </SaveProducts>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Retrieve Products

To retrieve products you need to use the GetProducts method. Remember that you need to specify the what in the returnProperties you want to retrieve.

Example of a request:

<?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>
    <GetProducts xmlns="http://24sevenOffice.com/webservices">
      <searchParams>
        <Id>1000</Id>
        <CategoryId>4</CategoryId>
      </searchParams>
      <returnProperties>
        <string>Name</string>
        <string>Price</string>
      </returnProperties>
    </GetProducts>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Delete Products

To delete products you need to use the DeleteProducts method.

<?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>
    <DeleteProducts xmlns="http://24sevenOffice.com/webservices">
      <products>
        <Product>
          <Id>1000</Id>
        </Product>
        </products>
    </DeleteProducts>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8
9
10
11
12

Create Categories

To create a category you need to use the SaveCategories mathod. You can add multiple categories in the request. If you want to update a category you will need to use the Id property.

Example of a request:

<?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>
    <SaveCategories xmlns="http://24sevenOffice.com/webservices">
      <categories>
        <Category>
          <Name>Test Category</Name>
        </Category>
      </categories>
    </SaveCategories>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8
9
10
11
12

Retrieve Categories

To retrieve the categories you need to use the GetCategories method. It will return an array of categories. Please note that you need to specify the return properties.

Example of a request:

<?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>
    <GetCategories xmlns="http://24sevenOffice.com/webservices">
      <returnProperties>
        <string>Name</string>
        <string>Id</string>
      </returnProperties>
    </GetCategories>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8
9
10
11

Set stock quantity

To set the stock quantity of a product you need to use the SetStockQuantity method. The response returns true if no error occured.

Example of a request:

<?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>
    <SetStockQuantity xmlns="http://24sevenOffice.com/webservices">
      <productId>1000</productId>
      <stockQuantity>10</stockQuantity>
    </SetStockQuantity>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8
9

Retrieve Matrix Price Groups

Use the GetDiscountMatrixPriceGroup method to retrieve the matrix price group. Retrives an array of Discount[] which includes the PriceGroupId, CategorId and the value.

Example of a request:

<?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>
    <GetDiscountMatrixPriceGroup xmlns="http://24sevenOffice.com/webservices" />
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6

Retrieve Discount Matrix Categories

Retrieves an array of Discount[] which includes categoryId, customerId and the value.

Example of a request:

<?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>
    <GetDiscountMatrixCategory xmlns="http://24sevenOffice.com/webservices" />
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6

Retrieve Price List

To retrieve the price list you need to use the GetPriceList method. It returns a list of KeyValuePairs.

Example of a request:

<?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>
    <GetPriceList xmlns="http://24sevenOffice.com/webservices">
      <priceListId>1</priceListId>
    </GetPriceList>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8

Retrieve All Price Lists

The method GetAllPriceLists retrives all the price lists. The Id returned can be used by the method GetPriceList to retrive the specified price list.

Example of a request:

<?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>
    <GetAllPriceLists xmlns="http://24sevenOffice.com/webservices" />
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6

Methods

Method Input type Return type Description
GetProducts ProductSearchParameters, returnProperties[] Product[] Returns a list of products based on the given search parameters. Will only return the properties specified in the returnProperties parameter.
SaveProducts Product[] Product[] Saves a list of products
DeleteProducts Product[] Product[] Deletes a list of products
GetCategories returnProperties[] Category[] Returns a list of categories with the return properties specified.
SaveCategories Category[] Category[] Saves a list of categories
SetStockQuantity productId(Int32), stockQuantity(Decimal) Boolean Sets the stock quantity and returns true if no error occured.
GetDiscountMatrixPriceGroup - Discount[]
GetDiscountMatrixCategory - Discount[]
GetPriceList priceListId(Int32) KeyValuePair[] Returns a KeyValuePair array of ProductIDs and Prices that match the specified PriceListId.
Key = ProductId, Value = Price
GetAllPriceLists - ProductPriceList[] Returns a list of product price list data