Skip to main content
knowledgecenter.avangate.com

Retrieve product info by ID

Overview

Use getProductById to extract product information using the unique, system-generated ID the Avangate system creates automatically when you create products. 

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

IdProduct

Required (string)

 

Unique, system-generated ID the Avangate system creates automatically when you create products.

Request

<?php

require ('PATH_TO_AUTH');

$IdProduct = "YOUR_PRODUCT_ID";

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getProductById',
'params' => array($sessionID, $IdProduct)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

?>

Response

Parameter Type/Description

Product

Object