Api request problem genrate product variations using : generate_product_variations

we try to generate product variations using postman application

POST request : https://example.com/api/product_variations/297/generate_product_variations

product id : 297 “new product with full information”

request body : {“combinations”:[{“548”:1193,“549”:1200},{“548”:1197,“549”:1199}]}

But we get this error :
{
“message”: “Bad Request: Couldn’t generate variations. Please specify the values of features to generate variations.”,
“messages”: [
“Couldn’t generate variations. Please specify the values of features to generate variations.”
],
“status”: 400
}

any one help us to solve this problem

Hi!

Are there features in your store with feature_id == 548 and 549? Do these features have variants with variant_id == 1193, 1200, 1197, 1199? Do these features have purpose Variations as separate products or Variations as one product?

1 Like

We just test Variations as separate products and Variations as one product we get the same error

this json for feature #549
{
“feature_id”: “549”,
“feature_code”: “”,
“company_id”: “0”,
“feature_type”: “S”,
“parent_id”: “0”,
“display_on_product”: “Y”,
“display_on_catalog”: “Y”,
“display_on_header”: “N”,
“description”: “Color”,
“internal_name”: “Color”,
“lang_code”: “en”,
“prefix”: “”,
“suffix”: “”,
“categories_path”: “”,
“full_description”: “”,
“status”: “A”,
“comparison”: “Y”,
“position”: “10”,
“purpose”: “group_catalog_item”,
“feature_style”: “dropdown_images”,
“filter_style”: “checkbox”,
“variants”: {
“1199”: {
“variant_id”: “1199”,
“variant”: “Blue”,
“description”: “”,
“page_title”: “”,
“meta_keywords”: “”,
“meta_description”: “”,
“lang_code”: “en”,
“feature_id”: “549”,
“url”: “”,
“color”: null,
“position”: “2”,
“seo_name”: null,
“seo_path”: null,
“image_pair”: null
},
“1200”: {
“variant_id”: “1200”,
“variant”: “Black”,
“description”: “”,
“page_title”: “”,
“meta_keywords”: “”,
“meta_description”: “”,
“lang_code”: “en”,
“feature_id”: “549”,
“url”: “”,
“color”: null,
“position”: “3”,
“seo_name”: null,
“seo_path”: null,
“image_pair”: null
},
“1201”: {
“variant_id”: “1201”,
“variant”: “White”,
“description”: “”,
“page_title”: “”,
“meta_keywords”: “”,
“meta_description”: “”,
“lang_code”: “en”,
“feature_id”: “549”,
“url”: “”,
“color”: null,
“position”: “4”,
“seo_name”: null,
“seo_path”: null,
“image_pair”: null
}
}
}

and this for #548
{
“feature_id”: “548”,
“feature_code”: “”,
“company_id”: “0”,
“feature_type”: “S”,
“parent_id”: “0”,
“display_on_product”: “Y”,
“display_on_catalog”: “Y”,
“display_on_header”: “N”,
“description”: “Size”,
“internal_name”: “Size”,
“lang_code”: “en”,
“prefix”: “”,
“suffix”: “”,
“categories_path”: “”,
“full_description”: “”,
“status”: “A”,
“comparison”: “Y”,
“position”: “20”,
“purpose”: “group_variation_catalog_item”,
“feature_style”: “dropdown_labels”,
“filter_style”: “checkbox”,
“variants”: {
“1195”: {
“variant_id”: “1195”,
“variant”: “Medium”,
“description”: “”,
“page_title”: “”,
“meta_keywords”: “”,
“meta_description”: “”,
“lang_code”: “en”,
“feature_id”: “548”,
“url”: “”,
“color”: null,
“position”: “3”,
“seo_name”: null,
“seo_path”: null,
“image_pair”: null
},
“1197”: {
“variant_id”: “1197”,
“variant”: “X Large”,
“description”: “”,
“page_title”: “”,
“meta_keywords”: “”,
“meta_description”: “”,
“lang_code”: “en”,
“feature_id”: “548”,
“url”: “”,
“color”: null,
“position”: “5”,
“seo_name”: null,
“seo_path”: null,
“image_pair”: null
},
“1196”: {
“variant_id”: “1196”,
“variant”: “XX Large”,
“description”: “”,
“page_title”: “”,
“meta_keywords”: “”,
“meta_description”: “”,
“lang_code”: “en”,
“feature_id”: “548”,
“url”: “”,
“color”: null,
“position”: “6”,
“seo_name”: null,
“seo_path”: null,
“image_pair”: null
}
}
}
since we create new product via api we just need to generate product variations using “POST” request /api/product_variations/297/generate_product_variations

it the same for us Variations as separate products or Variations as one product
what we need right know to solve json error : Bad Request: Couldn’t generate variations. Please specify the values of features to generate variations

Any one help us to know the problem to generate product variations
json error : “Couldn’t generate variations. Please specify the values of features to generate variations.”
you can check image below to know more information :



Request : “POST”
https://example.com/api/product_variations/297/generate_product_variations
body “json” {“combinations”:[{“548”:1193,“549”:1200},{“548”:1197,“549”:1199}]}
Document we use : Product Variations — CS-Cart 4.17.x documentation

As I can see, there is no feature variant with ID 1193 in your store, please try to replace 1193 with 1195 in the request body that you send:

{“combinations”:[{“548”:1193,“549”:1200},{“548”:1197,“549”:1199}]}