getProduct

Parent Previous Next

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.

 

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

 

<?php

try {

 $ProductRefNum = '912093987473';        

 $product = $client->getProduct($token, $ProductRefNum);

 print_r($product);

}

catch(SoapFault $e) {

 echo $e->getMessage();

}

?>

 

 

VB

Dim prod As eBizCharge.Product = New eBizCharge.Product

       Dim refNum As String

       refNum = "9001169811"

       prod = client.getProduct(token, refNum)

       MsgBox(prod.Name)

 

 

.NET C#

           string RefNum = "900116985";

           eBizCharge.Product response = new eBizCharge.Product();

           try

           {

               response = client.getProduct(token, RefNum);

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

           }

           catch (Exception err)

           {

               MessageBox.Show(err.Message);

           }

 

 

XML

Request:

Response:

: