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

Miva Developer Docs

Creates a product.


Creates a product. Set the code, SKU, name, price, inventory and other fields, plus custom field values, in one request. The response returns the new product, including its ID.

Before you begin#

  • The API token needs Product_Insert, 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.
  • The product code must not already be in use. Product codes are unique in Miva.

Example requests#

Create a product#

Creates the product new-product with pricing, inventory and custom field values.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "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,
    "Product_ExcludeFromSearchResults": true,
    "CustomField_Values": {
        "cmp-cssui-pchdft": {
            "header": "",
            "footer": ""
        },
        "cmp-mv-prodctgy-meta": {
            "keywords": "",
            "description": ""
        },
        "upsxml": {
            "ups_additional_handling": "No",
            "ups_delivery_confirmation": "Default",
            "ups_fpackage": "",
            "ups_fclass": "",
            "ups_fnmfccom": "",
            "ups_fnmfcsubcm": "",
            "ups_fdanger": "0",
            "ups_fdangermod": "0",
            "hscode": "",
            "origcntry": ""
        },
        "baskinv": {
            "basket_inv": "0",
            "total_inv": ""
        },
        "combofacets": {
            "fitment": [],
            "second": []
        },
        "customfields": {
            "checkbox_CUSTOMFIELD_CODE": true,
            "imageupload_CUSTOMFIELD_CODE": "graphics/en-US/somecustomfieldimage.jpg",
            "text_CUSTOMFIELD_CODE": "fffff",
            "textarea_CUSTOMFIELD_CODE": "ggggg",
            "dropdown_CUSTOMFIELD_CODE": "bbbbb",
            "multitext_CUSTOMFIELD_CODE": ["hhhhh", "iiiii"]
        },
        "marketplaces": {
            "googleshopping_item_id": "",
            "googleshopping_title": "",
            "googleshopping_condition": "",
            "googleshopping_availability": "",
            "googleshopping_description": "",
            "googleshopping_product_category": "",
            "googleshopping_item_number": "",
            "googleshopping_part_number": "",
            "googleshopping_brand": "",
            "googleshopping_weight": "",
            "googleshopping_sale_price": "",
            "googleshopping_product_type": "",
            "googleshopping_expiration_date": "",
            "googleshopping_color": "",
            "googleshopping_material": "",
            "googleshopping_pattern": "",
            "googleshopping_gender": "",
            "googleshopping_age_group": "",
            "googleshopping_item_size": "",
            "googleshopping_size_type": "",
            "googleshopping_size_system": "",
            "googleshopping_adwords_redirect_url": "",
            "googleshopping_multipack": "",
            "googleshopping_is_bundled": "",
            "googleshopping_adult_product": "",
            "googleshopping_custom_0": "",
            "googleshopping_custom_1": "",
            "googleshopping_custom_2": "",
            "googleshopping_custom_3": "",
            "googleshopping_custom_4": "",
            "googleshopping_unit_value": "",
            "googleshopping_unit": "",
            "googleshopping_base_value": "",
            "googleshopping_base_unit": "",
            "googleshopping_ignore_product": "",
            "googleshopping_shipping_label": "",
            "googleshopping_gtin": ""
        },
        "productdigitaldownloadcustomfields": {
            "enabled": "No",
            "max_dl": "Global",
            "expiration": "Global",
            "cdn_name": "",
            "miva_path": "",
            "miva_name": "",
            "bucket": "",
            "file": "",
            "region": ""
        },
        "productimagecustomfields": {
            "main": "graphics/00000001/1/ny__gift-card--main.png",
            "back": ""
        },
        "productdata": {
            "data_field_code": "0"
        }
    }
}

Request parameters#

Parameter Type Required Description
product_code String Yes Product Code of the product to Insert. This is a unique value in Miva.
product_sku String No 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 Yes Product Name
product_description String No Product Description. Full HTML description allowed.
product_canonical_category_code String No The canonical category is used to populate the breadcrumbs and category tree when no category code is present.
product_alternate_display_page String No Alternate Page template to use when rendering this product
product_page_title String No The Title Tag for this product.
product_thumbnail String No Product Thumbnail. This field is deprecated. Images should be uploaded using ProductImage_Add
product_image String No Product Full size image. This field is deprecated. Images should be uploaded using ProductImage_Add
product_price Number No Product Price. This is the price the product will be purchased at.
product_cost Number No Product Cost. Used for reporting and certain types of discounts (markup from cost)
product_weight Number No Product Weight
product_Inventory Number No Current inventory count available for the product. Updating this value does not take into account stock held in open baskets
product_taxable Boolean No true or false value depending on if a product is taxable.
product_active Boolean No true or false value depending on if a product is active. Important: If a value is omitted, the behavior will default to active.
product_excludefromsearchresults Boolean No When true, excludes the product from on-site search results. Added in Miva 26.01.01.
customfield_values Object An object containing a customfields object with custom product fields to update. See examples.

Example response#

{
    "success": 1,
    "data": {
        "id": 20733,
        "disp_order": 20739,
        "code": "new-product",
        "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,
        "profit": 0,
        "margin": 0,
        "formatted_cost": "$1.27",
        "page_code": "",
        "page_id": 0,
        "descrip": "ddddd",
        "weight": 3.58,
        "formatted_weight": "3.58 lb",
        "taxable": true,
        "active": true,
        "exsearch": true,
        "page_title": "eeeee",
        "dt_created": 1777994544,
        "dt_updated": 1777994544
    }
}

Response parameters#

Name Type Description
success Boolean true if the request was successful
data.id Number Internal product ID
data.disp_order Number Display order of the product
data.code String Product code
data.sku String Product SKU
data.name String Product name
data.thumbnail String Path to the product thumbnail image
data.image String Path to the product full-size image
data.price Number Product price
data.formatted_price String Formatted product price (e.g. "$5.29")
data.cost Number Product cost
data.profit Number Calculated profit
data.margin Number Calculated margin
data.formatted_cost String Formatted product cost (e.g. "$1.27")
data.page_code String Code of the alternate display page, if set
data.page_id Number ID of the alternate display page, if set
data.descrip String Product description
data.weight Number Product weight
data.formatted_weight String Formatted product weight (e.g. "3.58 lb")
data.taxable Boolean Whether the product is taxable
data.active Boolean Whether the product is active
data.exsearch Boolean true when the product is excluded from on-site search results. Added in Miva 26.01.01.
data.page_title String Product page title tag
data.dt_created Number Unix timestamp of when the product was created
data.dt_updated Number Unix timestamp of when the product was last updated

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
Function Use it to
Product_Update Change a product
Product_Delete Delete a product
Product_Copy Copy an existing product to a new one
ProductImage_Add Add an image to the new product
ProductList_Load_Query Find products and check which codes are in use

Try in Postman#

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