developer:soap-1.4:methods:addproductcategory

Soap API v1.4

addProductCategory

This method creates a new product category record and returns a ProductCategoryRefNum

Description

The addProductCategory method creates a new product category record. If successful, a ProductCategoryRefNum will be returned. The ProductCategoryRefNum is a gateway assigned product category identifier. This product category identifier should be stored and is needed for updating and deleting product categories. The product database is an optional feature and may not be supported by all merchants. The merchant should check their gateway package to determine if this feature is available to them.

See also updateProductCategory, deleteProductCategory

Syntax

string addProductCategory ( ueSecurityToken,ProductCategory)

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.

Return Value

string Returns a ProductCategoryRefNum.

Exceptions

The following exceptions (errors) are applicable to this method.

Code Message Advice
41001 Unable to create product database Merchant does not have a product database. The feature not be enabled for merchant. Contact customer service and make sure product database feature is enabled.

Examples

PHP

For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.

<?php 
 
 
 
?> 

VB

Dim category As usaepay.ProductCategory = New usaepay.ProductCategory
        category.Name = "The first"
        Dim response As String
 
        response = client.addProductCategory(token, category)
        MsgBox(response)

.NET C#

            usaepay.ProductCategory category = new usaepay.ProductCategory();
            category.Name = "The first";
            string response;
 
            try
            {
                response = client.addProductCategory(token, category);
                MessageBox.Show(string.Concat(response));
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }

XML

Request:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="urn:usaepay" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:addProductCategory>
<Token xsi:type="ns1:ueSecurityToken">
<ClientIP xsi:type="xsd:string">192.168.0.1</ClientIP>
<PinHash xsi:type="ns1:ueHash">
<HashValue xsi:type="xsd:string">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>
<Seed xsi:type="xsd:string">12678150211876663375</Seed>
<Type xsi:type="xsd:string">sha1</Type>
</PinHash>
<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
</Token>
 <ProductCategory xsi:type="ns1:ProductCategory">
  <Name xsi:type="xsd:string">Example Category</Name>
 </ProductCategory>
</ns1:addProductCategory>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="urn:usaepay" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:addProductCategoryResponse>
 <ProductCategoryRefNum xsi:type="xsd:string">90117806146</ProductCategoryRefNum>
</ns1:addProductCategoryResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Change History

Version Change
1.3 Method added in this release
developer/soap-1.4/methods/addproductcategory.txt · Last modified: 2010/09/07 13:36 by irina

Page Tools