# Update product

Use the **updateProduct** method to update the configuration of a subscription plan/product you already configured for your account.&#x20;

## Request 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> |
| [`Product`](/json-rpc-api-reference/json-rpc-api-6.0/api-requests/product.md) | <p><strong>Required (object)</strong></p><p>Use this object to configure your subscription plans/products.</p><p><strong>You can update/edit all parameters, except the following</strong>:</p><ul><li>AvangateID</li><li>ProductType</li></ul>                                                         |

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$ProductCode = 'NewProdCodeAPI12345';

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

$myProduct = callRPC($jsonRpcRequest, $host);

$myProduct->ProductName = 'Edited_From_API_Again';

var_dump ($myProduct);

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'updateProduct',
'params' => array($sessionID, $myProduct)
);

$updatedProduct = callRPC($jsonRpcRequest, $host);
var_dump ($updatedProduct);

?>
```

## Exceptions <a href="#exceptions" id="exceptions"></a>

When updating a subscription plan/product, you also update its `PricingConfigurations`. However, you cannot modify:

* The pricing configuration `CODE`.
* The `PricingSchema` from DYNAMIC to FLAT or vice versa. &#x20;

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

```php
bool(true)
```


---

# 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/update-product.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.
