Generates the variants for a product kit. Identify the kit product and pass the pricing method to use.
Before you begin#
- The API token needs
ProductKit_Generate_Variants, either assigned directly under Functions or through a group. See Create an API token. - Requests must be signed if the token requires it. See Make a signed request with HMAC.
- You need the kit product’s ID, code or SKU.
Example requests#
Generate kit variants#
Generates the variants for product 1 with pricing method 0.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "ProductKit_Generate_Variants",
"Product_ID": 1,
"Pricing_Method": 0
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
product_idEdit_ProductProduct_CodeProduct_SKU |
Number String String String |
ID Number of product Product code string Product code string Product SKU string |
|
pricing_method |
String | Yes | Required. The pricing method: master or 0, specific or 1, sum or 2 |
Example response#
{
"success": 1
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
success |
Boolean | Boolean value indicating if the api request was successful |
Related functions#
| Function | Use it to |
|---|---|
ProductKit_Update_Parts |
Set the parts of a product kit |
ProductKit_Variant_Count |
Count the variants in a product kit |
ProductKitList_Load_Query |
List a kit’s attribute options and their parts |
ProductVariantList_Load_Product |
Load a product’s variants and their parts |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Products > ProductKit_Generate_Variants. See Set Up Postman.