deleteProductCategory

This method deletes an existing product category.

Description

This method removes the specified ProductCategoryRefNum from the product database. The product category is deleted immediately and this operation can not be undone. The ProductCategoryRefNum is the gateway assigned product Category ID that was returned by addProductCategory.

See also addProductCategory

Syntax

boolean deleteProductCategory ( ueSecurityToken Token, string ProductCategoryRefNum)

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.
string ProductCategoryRefNum Product category reference number used to delete a product category

Return Value

| Type | Description | | ---- | ---- | -----------
| boolean | Returns true if product category has been deleted (on error an exception is thrown) |

Exceptions

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

Code Message Advice
41008 Failed to delete product category Product category specified by ProductCategoryRefNum was not found. Make sure the number stored is not truncated or rounded.

Examples

VB

            Dim catRefNum As String
            catRefNum = "9001169811"
            Dim response As Boolean

            response = client.deleteProductCategory(token, catRefNum)
            MsgBox(response)

.NET C

                string catRefNum = "900116983";

                Boolean response;

                try
                {
                    response = client.deleteProductCategory(token, catRefNum);
                    MessageBox.Show(string.Concat(response));
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }