developer:soap-1.4:methods:getproduct

Soap API v1.4

getProduct

Retrieve all data for a single product

Description

This method retrieves the Product object for the product specified by ProductRefNum. The ProductRefNum is the gateway assigned unique product identifier that was returned by addProduct]. [[searchProducts can be used to find the ProductRefNum for a product if it is not known.

The entire Product object is returned.

See also addProduct, searchProducts

Syntax

Product getProduct ( ueSecurityToken Token,string ProductRefNum)

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.
string ProductRefNum Gateway assigned product ID used to pull product details

Return Value

Product Returns a Product object containing fields and their values.

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.

Examples

PHP

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

<?php 
 
try { 
  $ProductRefNum = '912093987473';	
  $product = $client->getProduct($token, $ProductRefNum); 
 
  print_r($product);
} 
 
catch(SoapFault $e) { 
 
  echo $e->getMessage(); 
 
} 
 
?> 

VB

 Dim prod As usaepay.Product = New usaepay.Product
        Dim refNum As String
        refNum = "9001169811"
 
        prod = client.getProduct(token, refNum)
        MsgBox(prod.Name)

.NET C#

            string RefNum = "900116985";
 
            usaepay.Product response = new usaepay.Product();
 
            try
            {
                response = client.getProduct(token, RefNum);
                MessageBox.Show(string.Concat(response.Price));
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }

XML

Request:

 

Response:

 

Change History

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

Page Tools