Test the product regeneration endpoint with your data.
Regenerate specific product fields with updated data
The regenerate endpoint allows you to update specific fields of an existing product without recreating it entirely. You can specify which fields to regenerate and provide custom notes for the regeneration process.
This is useful when you want to update product information based on new data or user feedback, or when you need to refresh specific attributes.
POST https://api.commerceclarity.com/api/v1/products/regenerate/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Required | Product ID or code to regenerate |
notes |
string | Optional | Additional notes for product generation |
fields |
object | Optional | Object specifying which fields to regenerate. Keys are field names (e.g., "title", "description", "global_attr.color") and values are the new content or instructions. |
agent_model |
string | Optional | Agent model to use (v1 or v2, default: v2) |
Each API call to the analysis endpoint will consume credits from your account based on the requested services and the selected agent model.
| Component | Credits Used | Description |
|---|---|---|
| Agent Model v2 | 5 Content Credits | Product import with the alternative model |
| Agent Model v1 | 1 content credit | Product import with the basic model |
curl -X POST https://api.commerceclarity.com/api/v1/products/regenerate/product-id-123 \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"notes": "Update product description with new marketing copy",
"fields": {
"description": "New product description"
},
"agent_model": "v2"
}'
curl -X POST https://api.commerceclarity.com/api/v1/products/regenerate/product-id-123 \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"notes": "Update multiple fields based on new product information",
"fields": {
"title": "Updated Product Title",
"description": "Updated product description",
"key_features": "New key features list",
"global_attr.color": "Blue"
},
"agent_model": "v2"
}'
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.commerceclarity.com/api/v1/products/regenerate/product-id-123', [
'headers' => [
'Authorization' => 'Bearer ' . $apiToken,
'Content-Type' => 'application/json',
],
'json' => [
'notes' => 'Update product description',
'fields' => [
'description' => 'New product description'
],
'agent_model' => 'v2'
]
]);
$data = json_decode($response->getBody(), true);
const response = await fetch('https://api.commerceclarity.com/api/v1/products/regenerate/product-id-123', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
notes: 'Update product description',
fields: {
description: 'New product description'
},
agent_model: 'v2'
})
});
const data = await response.json();
{
"status": "success",
"message": "Product regeneration queued successfully",
"data": {
"product_id": "507f1f77bcf86cd799439011",
"status": "queued",
"fields_to_regenerate": [
"description",
"global_attr.color"
]
}
}
{
"status": "error",
"code": "product_not_found",
"message": "The specified product does not exist"
}
{
"status": "error",
"code": "validation_failed",
"errors": {
"fields": [
"At least one field must be specified for regeneration"
]
}
}