Skip to main content
knowledgecenter.2checkout.com

Retrieve product by ID

Overview

Use getProductById to extract product information using the unique, system-generated ID the 2Checkout 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. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

IdProduct

Required (string)

 

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

Response

Parameter Type/Description

Product

Object

Request

<?php

require ('PATH_TO_AUTH');

$IdProduct = "YOUR_PRODUCT_ID";

try {
    $ProdSearch = $client->getProductById($sessionID, $IdProduct);
}

catch (SoapFault $e) {
    echo "Query: " . $e->getMessage();
    exit;
}

var_dump("Query", $ProdSearch);

?>