# Retrieve product by code

Use **getProductByCode** to extract product information using the unique identifier you assign to subscription plans/products. &#x20;

## Parameters parameters <a href="#parameters" id="parameters"></a>

| Parameters    | Type / Description                                                                                                                                                                                                                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sessionID`   | <p><strong>Required (string)</strong><br>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect.  The <code>sessionID</code> expires in <strong>10 minutes</strong>.</p> |
| `ProductCode` | <p><strong>String</strong><br>The product code that you control.</p>                                                                                                                                                                                                                                    |

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$ProductCode = "subscr1";

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

?>
```

## Response parameters <a href="#response" id="response"></a>

<table><thead><tr><th width="130.800048828125">Parameters</th><th>Type</th></tr></thead><tbody><tr><td><a href="/pages/e18c8c2343ece4047946c0789ca6a3c364341339"><code>Product</code></a></td><td><strong>Object</strong></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/product/retrieve-product-by-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
