deleteProduct

Parent Previous Next

deleteProduct

This method deletes an existing product.

 

Description

This method removes the specified ProductRefNum from the product database. The product is deleted immediately and this operation can not be undone. The ProductRefNum is the gateway assigned product ID that was returned by addProduct. searchProducts can be used to find the ProductRefNum for a product if it is not known.

 

Syntax

boolean deleteProduct ( ueSecurityToken Token, string ProductRefNum)

 

Arguments

Type

Name

Description

ueSecurityToken

Token

Merchant security token: used to identify merchant and retrieve the custom fields.

string

ProductRefNum

Product reference number used to delete a product

 

Return Value

boolean

Returns true if product has been deleted (on error an exception is thrown)

 

Exceptions

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

Code

Message

Advice

41002

Product Not Found

Product specified by ProductRefNum was not found. Make sure the number stored is not truncated or rounded.

41005

Failed to delete product

A database fault was encountered while deleting product record. Try operation again or contact support

 

Examples

 

PHP

 

<?php

try {

 $ProductRefNum='919932077432';

 $client->deleteProduct($token, $ProductRefNum);

}

catch(SoapFault $e) {

 echo $e->getMessage();

}

?>

 

VB

Dim refNum As String

       refNum = "9001169810"

       Dim response As Boolean

       response = client.deleteProduct(token, refNum)

       MsgBox(response)

 

.NET C#

           string RefNum = "900116982";

           Boolean response;

           try

           {

               response = client.deleteProduct(token, RefNum);

               MessageBox.Show(string.Concat(response));

           }

           catch (Exception err)

           {

               MessageBox.Show(err.Message);

           }

XML

Request:

Response:

: