# Assign to product group

Use the **assignProductGroup** method to assign a product to a product group. Following the assignation, the 2Checkout system uses the shopping cart template associated with the product group as the default cart design when shoppers purchase a subscription plan/product.

## Request parameters

<table><thead><tr><th width="139.3333740234375">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><p><strong>Required (string)</strong></p><p>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></td></tr><tr><td><code>productCode</code></td><td><p><strong>Required (string)</strong></p><p>The code of the product you wish assigned to the group.</p></td></tr><tr><td><code>groupCode</code></td><td><p><strong>Required (string)</strong></p><p>Unique, system-generated identifier assigned to product groups.</p></td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$productCode = "YOUR_PRODUCT_CODE";
$groupCode = "YOUR_PRODUCT_GROUP_CODE";

$jsonRpcRequest = array (
  'jsonrpc' => '2.0',
  'id' => $i++,
  'method' => 'assignProductGroup',
  'params' => array($sessionID, $productCode, $groupCode)
);

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

?>
```

## Response

```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-group/assign-to-product-group.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.
