This is an old revision of the document!
This method creates a new product category record and returns a ProductCategoryRefNum
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
string addProductCategory ( ueSecurityToken,ProductCategory)
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and retrieve the custom fields. |
string | Returns a ProductCategoryRefNum. |
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. |
For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.
<?php ?>
Dim category As usaepay.ProductCategory = New usaepay.ProductCategory category.Name = "The first" Dim response As String response = client.addProductCategory(token, category) MsgBox(response)
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); }
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">123.123.123.123</ClientIP> <PinHash xsi:type="ns1:ueHash"> <HashValue xsi:type="xsd:string">3b5b90caf934d5f31860db539e397ebb21db1791</HashValue> <Seed xsi:type="xsd:string">1276893378-test</Seed> <Type xsi:type="xsd:string">sha1</Type> </PinHash> <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> </Token> <ProductCategory xsi:nil="true" xsi:type="ns1: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">900100190</ProductCategoryRefNum> </ns1:addProductCategoryResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Version | Change |
---|---|
1.3 | Method added in this release |