This method deletes an existing product.
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.
See also addProduct, searchProducts
boolean deleteProduct ( ueSecurityToken Token, string ProductRefNum)
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 |
boolean | Returns true if product has been deleted (on error an exception is thrown) |
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 |
For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.
<?php try { $ProductRefNum='919932077432'; $client->deleteProduct($token, $ProductRefNum); } catch(SoapFault $e) { echo $e->getMessage(); } ?>
Dim client As usaepay.usaepayService = New usaepay.usaepayService Dim token As usaepay.ueSecurityToken token = Me.CreateToken("982lz9VsLm87MA54Sv8E582h8OZMArL6", "1234") client.deleteProduct(token, "91284891283");
string RefNum = "900116988"; Boolean response; try { response = client.deleteProduct(token, RefNum); MessageBox.Show(string.Concat(response)); } catch (Exception err) { MessageBox.Show(err.Message); }
Request:
Response:
Version | Change |
---|---|
1.3 | Method added in this release |