Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs

Retrieves the attribute options of a product kit and the parts in each one.


Retrieves the kit setup for a product: one record per attribute option, each with the part products and quantities it includes. Use it to check a kit’s parts before you change them with ProductKit_Update_Parts.

Before you begin#

  • The API token needs ProductKitList_Load_Query, 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#

Retrieve a kit’s parts#

Returns up to 39 kit records for product 1, sorted by display order.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "ProductKitList_Load_Query",
    "Product_ID": 1,
    "Filter": "",
    "Sort": "disp_order"
}

Request parameters#

Parameter Type Required Description
product_id
Edit_Product
Product_Code
Product_SKU
Number
String
String
String
ID Number of product
Product code string
Product code string
Product SKU string
filter String No A string for filtering returned data
sort String No The order for sorting returned data

Example response#

The response to the example, shortened to one record. Every record has the same fields.

{
    "success": 1,
    "data": {
        "data": [
            {
                "attr_id": 49,
                "attr_type": "select",
                "attr_code": "color",
                "attr_prompt": "Choose Color",
                "attmpat_id": 0,
                "option_id": 75,
                "option_code": "RED",
                "option_prompt": "RED",
                "option_disp_order": 75,
                "parts": [
                    {
                        "product_id": 21799,
                        "product_code": "testtest_red",
                        "product_name": "testtest color:red",
                        "quantity": 2
                    },
                    {
                        "product_id": 21799,
                        "product_code": "sugar_10",
                        "product_name": "Sugar size:10",
                        "quantity": 1
                    }
                ]
            }
        ],
        "start_offset": 0,
        "total_count": 10
    }
}
Full response
{
    "success": 1,
    "data": {
        "data": [
            {
                "attr_id": 49,
                "attr_type": "select",
                "attr_code": "color",
                "attr_prompt": "Choose Color",
                "attmpat_id": 0,
                "option_id": 75,
                "option_code": "RED",
                "option_prompt": "RED",
                "option_disp_order": 75,
                "parts": [
                    {
                        "product_id": 21799,
                        "product_code": "testtest_red",
                        "product_name": "testtest color:red",
                        "quantity": 2
                    },
                    {
                        "product_id": 21799,
                        "product_code": "sugar_10",
                        "product_name": "Sugar size:10",
                        "quantity": 1
                    }
                ]
            },
            {
                "attr_id": 49,
                "attr_type": "select",
                "attr_code": "color",
                "attr_prompt": "Choose Color",
                "attmpat_id": 0,
                "option_id": 76,
                "option_code": "BLUE",
                "option_prompt": "BLUE",
                "option_disp_order": 76,
                "parts": [
                    {
                        "product_id": 21799,
                        "product_code": "shirt_red_medium",
                        "product_name": "Shirt color:red size:medium",
                        "quantity": 1
                    },
                    {
                        "product_id": 21799,
                        "product_code": "shirt_red_large",
                        "product_name": "Shirt color:red size:large",
                        "quantity": 1
                    },
                    {
                        "product_id": 21799,
                        "product_code": "shirt_blue_medium",
                        "product_name": "Shirt color:blue size:medium",
                        "quantity": 1
                    },
                    {
                        "product_id": 21799,
                        "product_code": "testtest_red",
                        "product_name": "testtest color:red",
                        "quantity": 1
                    }
                ]
            },
            {
                "attr_id": 49,
                "attr_type": "select",
                "attr_code": "color",
                "attr_prompt": "Choose Color",
                "attmpat_id": 0,
                "option_id": 77,
                "option_code": "BROWN",
                "option_prompt": "BROWN",
                "option_disp_order": 77,
                "parts": [
                    {
                        "product_id": 21799,
                        "product_code": "shirt_red_small",
                        "product_name": "Shirt color:red size:small",
                        "quantity": 1
                    }
                ]
            }
        ],
        "start_offset": 0,
        "total_count": 10
    }
}

Response parameters#

Parameter Type Description
success Boolean Boolean value indicating if the api request was successful
data Object An object containing the data returned from the request
data Array An array of objects containing product information
attr_id Number Attribute id for the product
attr_type String Attribute Type
attr_code String Attribute code
attr_prompt String Name of the attribute prompt
attmpat_id Number The attribute id number of the attribute template
option_id Number The id number of the option
option_code String The option code
option_prompt String Name of the option prompt
parts Array Array containing objects of parts within the kit
start_offset Number Used with the Count parameter for paginating results of large datasets. Default 0 is no offset.
total_count Number The total number of items returned in the product kit

parts Objects#

Parameter Type Description
product_id Number Product Id of part
product_code String Product Code of part
product_name String Product Name of part
quantity Number Quantity of Product in part

Additional options#

List Load Query overview explains the Filter format and every operator.

Pagination#

This function doesn’t read Count or Offset, so it returns every matching record. The response’s total_count says how many records match.

Error responses#

Error Code Error Message Error Description
MER-JSN-PRD-00070 Product not found Product id is not found
Function Use it to
ProductKit_Update_Parts Set the parts of a product kit
ProductKit_Generate_Variants Generate the variants for a product kit
ProductKit_Variant_Count Count the variants in a product kit
ProductVariantList_Load_Product Load a product’s variants and their parts

Try in Postman#

In the Miva: JSON API: Authenticated collection, open Products > ProductKitList_Load_Query. See Set Up Postman.