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

Miva Developer Docs

Updates a product's inventory settings.


Updates a product’s inventory settings: tracking, stock levels, stock messages and the current stock count. All parameters are optional. Identify the product with Product_ID, Product_Code, Edit_Product or Product_SKU.

Before you begin#

  • The API token needs InventoryProductSettings_Update, 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 product’s Product_ID, Product_Code, Edit_Product or Product_SKU.

Example requests#

Update inventory settings#

Turns on inventory tracking, sets stock levels and messages, and adds 10 to the current stock.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "InventoryProductSettings_Update",
    "product_code": "{{Product_Code}}",
    "TrackLowStockLevel": "Yes",
    "TrackOutOfStockLevel": "No",
    "HideOutOfStockProducts": "Default",
    "LowStockLevel": 2,
    "OutOfStockLevel": 10,
    "TrackProduct": true,
    "InStockMessageShort": "In Stock Message Short",
    "InStockMessageLong": "In Stock Message Long",
    "LowStockMessageShort": "Low Stock Message Short",
    "LowStockMessageLong": "Low Stock Message Long",
    "OutOfStockMessageShort": "Out Of Stock Message Short",
    "OutOfStockMessageLong": "Out Of Stock Message Long",
    "LimitedStockMessage": "Limited Stock Message",
    "AdjustStockBy": 10
}

Request parameters#

Name Type Required Title
product_id Number This is the product id of the product you wish to update.
product_code String This is the product code of the product you wish to update.
product_sku String This is the product SKU of the product you wish to update.
TrackLowStockLevel String No The string of Default, Yes, No can be used to set the Track Low Stock Level setting
TrackOutOfStockLevel String No The string of Default, Yes, No can be used to set the Track Out Of Stock Level setting
HideOutOfStockProducts String No The string of Default, Yes, No can be used to set the Hide Out Of Stock Products setting
LowStockLevel String No The low stock level, as a whole number, or default to use the store default.
OutOfStockLevel String No The out of stock level, as a whole number, or default to use the store default.
TrackProduct Boolean No True or False value to track product inventory
InStockMessageShort String No The In Stock Message Short
InStockMessageLong String No The In Stock Message Long
LowStockMessageShort String No The Low Stock Message Short
LowStockMessageLong String No The Low Stock Message Long
OutOfStockMessageShort String No The Out Of Stock Message Short
OutOfStockMessageLong String No The out of stock message
LimitedStockMessage String No The limited stock message
AdjustStockBy Number No A Number with the value to adjust the current product inventory count. Note this parameter can not be used with CurrentStock
CurrentStock Number No A Number with the value to adjust the current product inventory count. Note this parameter can not be used with AdjustStockBy

Example response#

{
    "success": 1
}

Response parameters#

Parameter Type Description
success Boolean Boolean value indicating if the API request was successful
Function Use it to
ProductList_Adjust_Inventory Adjust inventory for one or more products
ProductList_Load_Query Load products with their inventory settings
Product_Update Change a product
ProductShippingRules_Update Change a product’s shipping rules
ProductPaymentRules_Update Change a product’s payment rules

Try in Postman#

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