Skip to content

ProductList_Load_Query#


Description#

This function is used to query one or more products from Miva.

Request Parameters#

Parameter
Type Description
count Number Maximum lines of data allowed to be returned in the response. This limit is used to prevent excessive amounts of data return
filter String A string for filtering returned data
offset Number Used with the Count parameter for paginating results of large datasets. Default 0 is no offset.
sort String The order for sorting returned data

On Demand Columns#

Column
Description
descrip Full HTML product description
catcount Number of categories the product is assigned to
productinventorysettings Product specific inventory settings
attributes Includes attribute object in response
productimagedata Product Image including Image Types and non-image types
categories Product Category Assignments
productshippingrules Includes product dimensions and restricted shipping methods (if any)
relatedproduct Related product assignments
subscriptionsettings Subscription Settings - Added in 10.06.00
subscriptionterms Subscription Terms - Added in 10.06.00
uris Includes URI’s object in response. Canonical URI is the default URL for the product.
url Returns the full URL path, including domain name.
CustomField_Values:*
"CustomField_Values:<module code>:<field code>"
"CustomField_Values:<module code>:*"
Includes all custom fields in the output
Includes that specific field in the output
Includes all fields for the specified module in the output
product_inventory Includes 2 new fields for inventory counts as well as if inventory is active
page_code Includes page_code field associated with product in response. Page_Code is used for alternate Product page templates.
cancat_code Includes cancat_code field associated with product in response. cancat_code is the canonical category code for the product.

Other custom Filters#

Name Description
Product_Show “All”, “Uncategorized” or “Active” (All is default)

Supported Search Filter Columns#

Column
Description
code Product code or identifier.
sku Stock Keeping Unit - a unique identifier assigned to each distinct product for easier tracking and management.
cancat_code Canonical category code associated with the product.
page_code Page code associated with the product, used for alternate product page templates.
name Name or title of the product.
thumbnail URL or path to the thumbnail image of the product.
image URL or path to the main image of the product.
price Price of the product.
cost Cost of the product.
weight Weight of the product.
taxable Indicates whether the product is taxable or not.
active Indicates whether the product is active or inactive.
page_title Title of the product page.
dt_created Date and time when the product was created.
dt_Updated Date and time when the product was last updated.
category Supports only IN and NOT_IN operators. Accepts a comma-separated list of category codes. Limits results to products in the specified categories.
product_inventory Searches the product’s inventory level (not accounting for baskets).

Supported Sort Columns#

One of these values would be passed in the sort request parameter to have the results sorted by that column. Value may be preceded by “-” for a descending sort.

Column
Description
code Unique identifier for the product.
sku Stock Keeping Unit (SKU) of the product.
cancat_code Canonical category code associated with the product.
page_code Code for the page where the product is displayed.
name Name or title of the product.
thumbnail URL or path to the thumbnail image of the product.
image URL or path to the main image of the product.
price Price of the product.
cost Cost of the product.
descrip Description of the product.
weight Weight of the product.
taxable Indicates whether the product is taxable or not.
active Indicates whether the product is active or inactive.
page_title Title of the product page.
dt_created UNIX Timestamp when the product was created.
dt_Updated UNIX Timestamp when the product was last updated.

Response Parameters#

Parameter
Type Description
total_count Number total_count is the total number of records that match your search criteria. Note: this is not always the total products returned. Based on the Count and Offset parameters passed, the number of records returned could be different than the total_count.
start_offset Number Number of the starting offset number of products to return. Used in conjunction with the Count parameter for paginating results of large datasets.
id Number Product Id
code String Miva Product Code (unique)
Sku String Product SKU
thumbnail String This field is depreciated and is supported for legacy purposes. Relative Path to the product thumbnail image.
image String This field is depreciated and is supported for legacy purposes. Relative Path to the product fullsize image.
price Number Product Price
formatted_price String Currency Formatted Product Price
cost Number Product Cost
formatted_cost String Currency Formatted Product Cost
weight Number Product Weight
taxable Boolean true/false flag if the product is taxable
active Boolean true/false flag if the product is active
page_title String Product Page Title - used in HTML title tag within head
dt_created Unix Timestamp Unix timestamp product was created
dt_Updated Unix Timestamp Unix timestamp product was last updated
productinventorysettings Object Product inventory settings
attributes Object attributes Object
productimagedata Object Product Image Object
categories Object Categories Object
uris Object Uris Object
concact_code String Canonical Category Code for the product
page_code String Will contain the page code if the product is linked to an alternate display page (other than PROD)
product_inventory_active Object Flag if inventory is being tracked on this product
product_inventory Object Current Inventory Count
CustomField_Values Object Object of Custom Fields

productinventorysettings Object#

Parameter
Type Description
active Boolean Active Flag if inventory is being tracked on this product
in_short String Inventory Short Message
in_long String Inventory Long Message
low_track String Values include: d = default (inherits from global), y = yes, n = no
low_level Number Inventory level at which the low stock level is triggered
low_lvl_d Boolean Flag to determine if low stock level inherits from global settings. Will be set to false if low_level has a value.
low_short String Low Stock Short Message
low_long String Low Stock Long Message
out_track String Values include: d = default (inherits from global), y = yes, n = no
out_hide String Values include: d = default (inherits from global), y = yes, n = no
out_level Number Inventory level at which the out stock level is triggered
out_lvl_d Boolean Flag to determine if out of stock level inherits from global settings. Will Set to false if out_level has a value.
out_short String Out of Stock Short Message
out_long String Out of Stock Long Message
ltd_long String Shows when only part of the number requested can be added to the basket. ie. there are only 3 instock but customer tries to add 5.

attributes Object#

Parameter
Type Description
id Number Attribute Id
product_id Number Id of product attribute is assigned to
attr_id Number Same as Id field.
default_id Number id of default attribute option
disp_order Number Display Order. Used in sorting attributes.
attemp_id Number Will contain the id of the attribute id reference, otherwise 0
code String Attribute Code
type String One of the following types: radio, checkbox, text, memo, swatch, swatch-select
prompt String Attribute Text displayed to customer during runtime
price Number Attribute Price
cost Number Attribute Cost
weight Number Attribute Weight
required Boolean Flag if the Attribute is Required
inventory Boolean Flag if Inventory is being tracked on this attribute. Required when using Inventory Variants.
image String Attribute Image - Relative path to image file.
options Object Options object.

options Object#

Parameter
Type Description
id Number Option Id
product_id Number Id of product attribute is assigned to
attr_id Number Id of attribute option is assigned to
disp_order Number Display Order. Used in sorting options.
code String Option Code
prompt String Option Text displayed to customer during runtime
price Number Option Price
cost Number Option Cost
weight Number Option Weight
image String Option Image - Relative path to image file.

productimagedata Object#

Parameter
Type Description
id Number Image Id
product_id Number Id of product image is assigned to
image_id Number Same as Id field.
type_id Number Image Type Id
code String Image Type Code
type_desc String Image Type Description
image String Relative (to mm5 folder) path to product image
width Number Width (in Pixels) of image
height Number Height (in pixels) of image
disp_order Number Image Display Order

categories Object#

Parameter
Type Description
id Number Category Id
parent_id Number Id of parent category. 0 if category does not have a parent
agrpcount Number Availability Group Count
depth Number Category Depth
disp_order Number Category Display Order
page_id Number Alternate Display Page Id. O if none.
code String Category Code
name String Category Name
page_title String Page Title Tag (used in head tag)
active Boolean Active
dt_created Unix Timestamp Date/Time Created
dt_Updated Unix Timestamp Date/Time Updated

uris Object#

Parameter
Type Description
id Number URI Id
uri String relative URI path to product
store_id Number Id of Store product URI is assigned to
screen String Only used for page uris. Will always be empty for product URIs
page_id Number Only used for page uris. Will always be 0 for product URIs
cat_id Number Category Id URI is associated with
product_id Number Product Id URI is associated with
feed_id Number Feed id URI is associated with
canonical Boolean Flag to denote if URI is the canonical (default) URI
status Number http Status to return. Values include: 200, 301, 302, 303, 307

CustomField_Values Object#

Parameter
Type Description
cmp-cssui-pchdft Object Product/Category Header & Footer

cmp-cssui-pchdft Object#

Parameter
Type Description
header String Full HTML of Product Header
footer String Full HTML of Product Footer

Example Usage#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "ProductList_Load_Query",
    "Count": 1,
    "Offset": 0,
    "Filter": [
        {
            "name": "search",
            "value": [
                {
                    "field": "active",
                    "operator": "EQ",
                    "value": true
                }
            ]
        },
        {
            "name": "ondemandcolumns",
            "value": ["descrip", "catcount", "attributes", "productimagedata", "categories", "productshippingrules", "relatedproducts", "uris", "productinventorysettings", "CustomField_Values:*", "product_inventory", "page_code", "cancat_code"]
        }
    ]
}

Search Filter Example#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "ProductList_Load_Query",
    "Count": 0,
    "Offset": 0,
    "Filter": [
        {
            "name": "search",
            "value": [
                {
                    "field": "active",
                    "operator": "EQ",
                    "value": true
                }
            ]
        },
        {
            "name": "ondemandcolumns",
            "value": ["descrip", "catcount", "CustomField_Values:*"]
        }
    ]
}

Example Response#

In the case where all custom field values are being returned, each custom field module will be its own JSON object. It this example the following custom field module are returning data: [cmp-cssui-cpdhft, cmp-mv-prodctgy-meta, upsxml, baskinv, customfields] Each store could have a different set of modules in use.

{
    "success": 1,
    "data": {
        "total_count": 2,
        "start_offset": 0,
        "data": [
            {
                "id": 1,
                "code": "test",
                "sku": "",
                "name": "Test Product",
                "thumbnail": "",
                "image": "",
                "price": 10.0,
                "formatted_price": "$10.00",
                "cost": 0.0,
                "formatted_cost": "$0.00",
                "descrip": "",
                "catcount": 1,
                "weight": 10.0,
                "taxable": true,
                "active": true,
                "page_title": "",
                "dt_created": 1539299307,
                "dt_Updated": 1539635001,
                "productinventorysettings": {
                    "active": false,
                    "in_short": "",
                    "in_long": "",
                    "low_track": "d",
                    "low_level": 0,
                    "low_lvl_d": true,
                    "low_short": "",
                    "low_long": "",
                    "out_track": "d",
                    "out_hide": "d",
                    "out_level": 0,
                    "out_lvl_d": true,
                    "out_short": "",
                    "out_long": "",
                    "ltd_long": ""
                },
                "attributes": [
                    {
                        "id": 1,
                        "product_id": 1,
                        "default_id": 0,
                        "disp_order": 1,
                        "attemp_id": 0,
                        "code": "Size",
                        "type": "radio",
                        "prompt": "Select SIze",
                        "price": 0.0,
                        "cost": 0.0,
                        "weight": 0.0,
                        "required": false,
                        "inventory": false,
                        "image": "",
                        "options": [
                            {
                                "id": 1,
                                "product_id": 1,
                                "attr_id": 1,
                                "disp_order": 1,
                                "code": "small",
                                "prompt": "Small",
                                "price": 0.0,
                                "cost": 0.0,
                                "weight": 0.0,
                                "image": ""
                            },
                            {
                                "id": 2,
                                "product_id": 1,
                                "attr_id": 1,
                                "disp_order": 2,
                                "code": "large",
                                "prompt": "Large",
                                "price": 0.0,
                                "cost": 0.0,
                                "weight": 0.0,
                                "image": ""
                            }
                        ]
                    }
                ],
                "productimagedata": [
                    {
                        "id": 1,
                        "product_id": 1,
                        "image_id": 1,
                        "type_id": 1,
                        "code": "main",
                        "type_desc": "Main",
                        "image": "graphics/00000001/blank_cssui.png",
                        "width": 902,
                        "height": 403,
                        "disp_order": 1
                    }
                ],
                "categories": [
                    {
                        "id": 1,
                        "parent_id": 0,
                        "agrpcount": 0,
                        "depth": 0,
                        "disp_order": 1,
                        "page_id": 0,
                        "code": "Sample",
                        "name": "Sample Category",
                        "page_title": "",
                        "active": true,
                        "dt_created": 1539299329,
                        "dt_Updated": 1539299333
                    }
                ],
                "productshippingrules": {
                    "product_id": 1,
                    "ownpackage": false,
                    "width": 0.0,
                    "length": 0.0,
                    "height": 0.0,
                    "limitmeths": false,
                    "methods": []
                },
                "relatedproducts": [
                    {
                        "id": 2,
                        "code": "sample",
                        "sku": "",
                        "name": "Sample Product",
                        "thumbnail": "",
                        "image": "",
                        "price": 10.0,
                        "formatted_price": "$10.00",
                        "cost": 0.0,
                        "formatted_cost": "$0.00",
                        "weight": 0.0,
                        "taxable": true,
                        "active": true,
                        "page_title": "",
                        "dt_created": 1539634968,
                        "dt_Updated": 1539634968
                    }
                ],
                "uris": [
                    {
                        "id": 1,
                        "uri": "/my-custom-url",
                        "store_id": 1,
                        "screen": "",
                        "page_id": 0,
                        "cat_id": 0,
                        "product_id": 1,
                        "feed_id": 0,
                        "canonical": true,
                        "status": 200
                    }
                ],
                "cancat_code": "",
                "page_code": "",
                "product_inventory_active": false,
                "product_inventory": 0,
                "url": "https://mivadevtest.com/test-product.html",
                "CustomField_Values": {
                    "cmp-mv-prodctgy-meta": {
                        "keywords": "",
                        "description": ""
                    },
                    "cmp-cssui-pchdft": {
                        "header": "",
                        "footer": ""
                    }
                }
            }
        ]
    }
}