Updates a product’s shipping rules: whether it ships in its own packaging, its dimensions, and which shipping methods it’s limited to. All parameters are optional.
Before you begin#
- The API token needs
ProductShippingRules_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.
- Available in version 10.08.03 and newer.
- You need the product’s
Product_ID,Edit_Product,Product_CodeorProduct_SKU.
Example requests#
Set dimensions and limit shipping methods#
Sets the product to ship in its own packaging, sets its dimensions, and limits it to one shipping method. Add more objects to ShippingMethods to allow more methods.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "ProductShippingRules_Update",
"Product_ID": "{{Product_ID}}",
"ShipsInOwnPackaging": true,
"Width": 10,
"Length": 11,
"Height": 12,
"LimitShippingMethods": true,
"ShippingMethods": [
{
"module_code": "xxx",
"method_code": "yyy"
}
]
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
product_idEdit_ProductProduct_CodeProduct_SKU |
Number String String String |
ID Number of product Product code string Product code string Product SKU string |
|
ShipsInOwnPackaging |
boolean | No | Product Always Ships in Separate Packaging |
Width |
number | No | Maximum 10 digits before decimal and 2 digits after decimal |
Length |
number | No | Maximum 10 digits before decimal and 2 digits after decimal |
Height |
number | No | Maximum 10 digits before decimal and 2 digits after decimal |
LimitShippingMethods |
boolean | No | Limit shipping methods |
ShippingMethods |
array | Shipping methods to limit the product to. Array of objects, see ShippingMethods. |
ShippingMethods#
Each object in the ShippingMethods array has these members.
| Parameter | Type | Description |
|---|---|---|
module_code |
string | Required. Shipping module code. The module must be active and provide the shipping feature. |
method_code |
string | Required. Shipping method code |
Example response#
{
"success": 1
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
success |
boolean | boolean value for if the request was successful |
Related functions#
| Function | Use it to |
|---|---|
ProductPaymentRules_Update |
Change a product’s payment rules |
InventoryProductSettings_Update |
Change a product’s inventory settings |
Product_Update |
Change a product |
ProductList_Load_Query |
Load products with their shipping rules |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Products > ProductShippingRules_Update. See Set Up Postman.