Skip to content

Product_Insert#


Description#

This function allows you to insert a product.

Request Body Parameters#

Parameter
Type Description
product_code String Product Code of the product to Insert. This is a unique value in Miva.
product_sku String Product SKU of the product to insert. This is usually a unique value although Miva does not enforce unique values on the SKU field like it does for the Product Code.
product_name String Product Name
product_description String Product Description. Full HTML description allowed.
product_canonical_category_code String The canonical category is used to populate the breadcrumbs and category tree when no category code is present.
product_alternate_display_page String Alternate Page template to use when rendering this product
product_page_title String The Title Tag for this product.
product_thumbnail String Product Thumbnail. This field is depreciated. Images should be uploaded using ProductImage_Add
product_image String Product Fullsize Image. This field is depreciated. Images should be uploaded using ProductImage_Add
product_price Number Product Price. This is the price the product will be purchased at.
product_cost Number Product Cost. Used for reporting and certain types of discounts (markup from cost)
product_weight Number Product Weight
product_Inventory Number Current inventory count available for the product. Updating this value does not take into account stock held in open baskets
product_taxable Boolean true or false value depending on if a product is taxable.
product_active Boolean true or false value depending on if a product is active. Important: If a value is omitted, the behavior will default to active.
customfield_values Object An object containing a customfields object with custom order fields to update. See examples.

Response Parameters#

Name Description
success boolean value for if the request was successful

Example Request#

{
    "Store_code": "beta",
    "Function": "Product_Insert",
    "Product_Code": "new-product",
    "Product_SKU": "555182",
    "Product_Name": "Hello WOrld",
    "Product_Description": "ddddd",
    "Product_Alternate_Display_Page": "",
    "Product_Page_Title": "eeeee",
    "Product_Thumbnail": "graphics/00000001/someimage_thumbnail.jpg",
    "Product_Image": "graphics/00000001/someimage.jpg",
    "Product_Price": 5.29,
    "Product_Cost": 1.27,
    "Product_Weight": 3.58,
    "Product_Inventory": 26,
    "Product_Taxable": true,
    "Product_Active": true,
    "CustomField_Values": {
        "customfields": {
            "automated_checkbox": true,
            "automated_imageupload": "graphics/en-US/somecustomfieldimage.jpg",
            "automated_text": "fffff",
            "automated_textarea": "ggggg",
            "automated_dropdown": "bbbbb",
            "automated_multitext": ["hhhhh", "iiiii"]
        }
    }
}

Example Response#

{
    "success": 1,
    "data": {
        "id": 4,
        "code": "Hello_world",
        "sku": "555182",
        "name": "Hello World",
        "thumbnail": "graphics/00000001/someimage_thumbnail.jpg",
        "image": "graphics/00000001/someimage.jpg",
        "price": 5.29,
        "formatted_price": "$5.29",
        "cost": 1.27,
        "formatted_cost": "$1.27",
        "descrip": "ddddd",
        "weight": 3.58,
        "taxable": true,
        "active": true,
        "page_title": "eeeee",
        "dt_created": 1664305661,
        "dt_Updated": 1664305661
    }
}

Error Responses#

Error Code Error Message Error Description
MER-JSN-00018 Invalid value for field ‘Product_Code’: A product with the code ‘new-product’ already exists