# Product group

## Retrieve product groups

> Extract information about the product groups you created for your account.\
> \
> \*\*\*\
> \
> \*\*Method and URL\*\*\
> \
> \*\*GET\*\* \`<https://api.2checkout.com/rest/6.0/productgroups/\\`\\>
> \
> \*\*\*\
> \
> \*\*Example URL\*\*\
> \
> \`<https://api.2checkout.com/rest/6.0/productgroups/\\`\\>
> \
> \*\*\*\
> \
> \*\*Response\*\*\
> \
> 200 JSON\
> \
> \<table>\
> \<tbody>\
> \<tr>\
> \<td>\
> \<strong>ProductGroup\</strong>\
> \</td>\
> \<td>\
> \<strong>Array of objects\</strong>\
> \</td>\
> \</tr>\
> \</tbody>\
> \</table>

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/productgroups/":{"get":{"tags":["Product group"],"summary":"Retrieve product groups","description":"Extract information about the product groups you created for your account.\n\n***\n\n**Method and URL**\n\n**GET** `https://api.2checkout.com/rest/6.0/productgroups/`\n\n***\n\n**Example URL**\n\n`https://api.2checkout.com/rest/6.0/productgroups/`\n\n***\n\n**Response**\n\n200 JSON\n\n<table>\n<tbody>\n<tr>\n<td>\n<strong>ProductGroup</strong>\n</td>\n<td>\n<strong>Array of objects</strong>\n</td>\n</tr>\n</tbody>\n</table>","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_400"}}}}}}}},"components":{"schemas":{"inline_response_400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Create a product group

> \- Send null for product group Code. 2Checkout ignores any values you send for Code and generates identifiers itself.\
> \
> \- Use unique product group names.\
> \
> \- 2Checkout throws an exception if you send a blank product group.\
> \
> \- If you send only the name of the product group 2Checkout creates the new product group entity.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/productgroups/":{"post":{"tags":["Product group"],"summary":"Create a product group","description":"- Send null for product group Code. 2Checkout ignores any values you send for Code and generates identifiers itself.\n\n- Use unique product group names.\n\n- 2Checkout throws an exception if you send a blank product group.\n\n- If you send only the name of the product group 2Checkout creates the new product group entity.","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product_ProductGroup"}}}},"responses":{"201":{"description":"Created"},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_400"}}}}}}}},"components":{"schemas":{"Product_ProductGroup":{"type":"object","properties":{"Code":{"type":"string","nullable":true},"Description":{"type":"string"},"Name":{"type":"string"},"TemplateName":{"type":"string"}}},"inline_response_400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Retrieve a product group

> Extract information about a specific product group you created for your account.\
> \
> \*\*\*\
> \
> \*\*Method and URL\*\*\
> \
> \*\*GET\*\* \`<https://api.2checkout.com/rest/6.0/productgroups/{PRODUCT\\_GROUP\\_CODE}/\\`\\>
> \
> \*\*\*\
> \
> \*\*URL parameters\*\*\
> \
> \<table>\<thead>\
> \<tr>\
> \<th>\
> Attributes\
> \</th>\
> \<th>\
> Type/Description\
> \</th>\
> \</tr>\
> \</thead>\
> \<tbody>\
> \<tr>\
> \<td>\
> \<strong>ProductGroupCode\</strong>\
> \</td>\
> \<td>\
> \<strong>Required (string)\</strong>\
> \</td>\
> \</tr>\
> \<tr>\
> \<td>\
> \
> \</td>\
> \<td>\
> Unique, system-generated identifier assigned to product groups.\
> \</td>\
> \</tr>\
> \</tbody>\
> \</table>\
> \
> \*\*\*\
> \
> \*\*Example URL\*\*\
> \
> ?<https://api.2checkout.com/rest/6.0/productgroups/96A9F43B1B/\\>
> \
> \*\*\*\
> \
> \*\*Response\*\*\
> \
> 200 JSON\
> \
> \<table>\<thead>\
> \<tr>\
> \<th>\
> Attributes\
> \</th>\
> \<th>\
> Type/Description\
> \</th>\
> \</tr>\
> \</thead>\
> \<tbody>\
> \<tr>\
> \<td>\
> \<strong>ProductGroup\
> \</td>\
> \<td>\
> Object\
> \</td>\
> \</tr>\
> \</tbody>\
> \</table>

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/productgroups/{ProductGroupCode}/":{"get":{"tags":["Product group"],"summary":"Retrieve a product group","description":"Extract information about a specific product group you created for your account.\n\n***\n\n**Method and URL**\n\n**GET** `https://api.2checkout.com/rest/6.0/productgroups/{PRODUCT_GROUP_CODE}/`\n\n***\n\n**URL parameters**\n\n<table><thead>\n<tr>\n<th>\nAttributes\n</th>\n<th>\nType/Description\n</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\n<strong>ProductGroupCode</strong>\n</td>\n<td>\n<strong>Required (string)</strong>\n</td>\n</tr>\n<tr>\n<td>\n\n</td>\n<td>\nUnique, system-generated identifier assigned to product groups.\n</td>\n</tr>\n</tbody>\n</table>\n\n***\n\n**Example URL**\n\n?https://api.2checkout.com/rest/6.0/productgroups/96A9F43B1B/\n\n***\n\n**Response**\n\n200 JSON\n\n<table><thead>\n<tr>\n<th>\nAttributes\n</th>\n<th>\nType/Description\n</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\n<strong>ProductGroup\n</td>\n<td>\nObject\n</td>\n</tr>\n</tbody>\n</table>","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"ProductGroupCode","in":"path","description":"Unique, system-generated identifier assigned to product groups.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_400"}}}}}}}},"components":{"schemas":{"inline_response_400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Get the assigned product group for a product

> Retrieve the name of the product's assigned product group

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/products/{ProductCode}/productgroups/":{"get":{"tags":["Product group"],"summary":"Get the assigned product group for a product","description":"Retrieve the name of the product's assigned product group","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}},{"name":"ProductCode","in":"path","description":"The editable code that you control at product-level, not the unique, system-generated product ID","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_400"}}}}}}}},"components":{"schemas":{"inline_response_400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## 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 product.\
> \
> \*\*\*\
> \
> \*\*Method and URL\*\*\
> \
> \*\*POST\*\* \`<https://api.2checkout.com/rest/6.0/products/{ProductCode}/productgroups/{ProductGroupCode}/\\`\\>
> \
> The name of the product group is case sensitive.\
> \
> \*\*\*\
> \
> \*\*URL parameters\*\*\
> \
> \<table>\<thead>\
> \<tr>\
> \<th>\
> Attributes\
> \</th>\
> \<th>\
> Type/Description\
> \</th>\
> \</tr>\
> \</thead>\
> \<tbody>\
> \<tr>\
> \<td>\
> \<strong>ProductCode\</strong>\
> \</td>\
> \<td>\
> \<strong>Required (string)\</strong>\
> \</td>\
> \</tr>\
> \<tr>\
> \<td>\
> \&nbsp;\
> \</td>\
> \<td>\
> The editable code that you control at product-level, \<strong>not\</strong> the unique, system-generated product ID.\
> \</td>\
> \</tr>\
> \<tr>\
> \<td>\
> \<strong>ProductGroupCode\</strong>\
> \</td>\
> \<td>\
> \<strong>Required (string)\</strong>\
> \</td>\
> \</tr>\
> \<tr>\
> \<td>\
> \
> \</td>\
> \<td>\
> Unique, system-generated identifier assigned to product groups.\
> \</td>\
> \</tr>\
> \</tbody>\
> \</table>\
> \
> \*\*\*\
> \
> \*\*Example URL\*\*\
> \
> \`<https://api.2checkout.com/rest/6.0/products/my\\_subscription/productgroups/96A9F43B1B/\\`\\>
> \
> \*\*\*\
> \
> \*\*Response\*\*\
> \
> 200 JSON

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/products/{ProductCode}/productgroups/{ProductGroupCode}/":{"post":{"tags":["Product group"],"summary":"Assign a product to a product group","description":"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 product.\n\n***\n\n**Method and URL**\n\n**POST** `https://api.2checkout.com/rest/6.0/products/{ProductCode}/productgroups/{ProductGroupCode}/`\n\nThe name of the product group is case sensitive.\n\n***\n\n**URL parameters**\n\n<table><thead>\n<tr>\n<th>\nAttributes\n</th>\n<th>\nType/Description\n</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\n<strong>ProductCode</strong>\n</td>\n<td>\n<strong>Required (string)</strong>\n</td>\n</tr>\n<tr>\n<td>\n&nbsp;\n</td>\n<td>\nThe editable code that you control at product-level, <strong>not</strong> the unique, system-generated product ID.\n</td>\n</tr>\n<tr>\n<td>\n<strong>ProductGroupCode</strong>\n</td>\n<td>\n<strong>Required (string)</strong>\n</td>\n</tr>\n<tr>\n<td>\n\n</td>\n<td>\nUnique, system-generated identifier assigned to product groups.\n</td>\n</tr>\n</tbody>\n</table>\n\n***\n\n**Example URL**\n\n`https://api.2checkout.com/rest/6.0/products/my_subscription/productgroups/96A9F43B1B/`\n\n***\n\n**Response**\n\n200 JSON","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}},{"name":"ProductCode","in":"path","description":"The editable code that you control at product-level, not the unique, system-generated product ID","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"ProductGroupCode","in":"path","description":"Unique, system-generated identifier assigned to product groups.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_400"}}}}}}}},"components":{"schemas":{"inline_response_400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## DELETE /products/{ProductCode}/productgroups/{ProductGroupCode}/

> Unassign a product from a product group

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/products/{ProductCode}/productgroups/{ProductGroupCode}/":{"delete":{"tags":["Product group"],"summary":"Unassign a product from a product group","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"ProductCode","in":"path","description":"The editable code that you control at product-level, not the unique, system-generated product ID","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"ProductGroupCode","in":"path","description":"Unique, system-generated identifier assigned to product groups.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}
```


---

# 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/api-reference/reference/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.
