» Products PUT API Documentation

Updating an Existing Product

Endpoint: PUT /api/v4/admin/products/{product_id}

Purpose

This endpoint updates the details of an existing product based on its unique product ID. Admins can modify any attribute, including product name, SKU, price, inventory settings, availability rules, SEO configurations, and customer restrictions. It helps ensure product information remains accurate, up-to-date, and aligned with evolving business needs.

Path Parameters

ParameterTypeDescription
product_idIntegerThe unique identifier of the product whose information is being updated

Query Parameters

No query parameters for this endpoint.

Use Case

An admin needs to edit an existing product to reflect changes such as updated pricing, extended availability dates, modified inventory levels, or enhanced SEO settings. This is typically used when products are rebranded, placed on sale, or when conditions like customer access need updating.

Request Body

The request body must contain the updated product data. This includes fields like name, SKU, sale prices, stock quantities, product media, SEO metadata, related products, available customer groups, and additional advanced configurations.

{
    "name": "PRODUCT_NAME",
    "sku": "PRODUCT_SKU",
    "heading": "PRODUCT_HEADING",
    "parents": [
      {
        "id": CATEGORY_ID,
        "name": "CATEGORY_NAME",
        "is_in_trash": BOOLEAN,
        "is_parent_in_trash": BOOLEAN,
        "is_disposable": BOOLEAN
      }
    ],
    "created_by": {
      "id": CREATED_BY_ID,
      "name": "CREATED_BY_NAME"
    },
    "product_type": "PRODUCT_TYPE",
    "available": BOOLEAN,
    "product_page": {
      "id": PRODUCT_PAGE_ID
    },
    "product_layout": {
      "id": PRODUCT_LAYOUT_ID
    },
    "custom_class": "CUSTOM_CLASS",
    "available_on_date_range": BOOLEAN,
    "available_from_date": "YYYY-MM-DDTHH:MM:SS",
    "available_to_date": "YYYY-MM-DDTHH:MM:SS",
    "available_for": "AVAILABLE_FOR_TYPE",
    "selected_customers": {
      "customers": [
        CUSTOMER_ID_1
      ],
      "groups": [
        GROUP_ID_1
      ]
    },
    "restrict_for_selected_customers": "BOOLEAN",
    "password_protected": "BOOLEAN",
    "password": "PRODUCT_PASSWORD",
    "available_on_weekdays": {
      "enabled": BOOLEAN,
      "weekdays": [
        {
          "day": "WEEKDAY_NAME",
          "start_hour": START_HOUR,
          "start_minute": START_MINUTE,
          "end_hour": END_HOUR,
          "end_minute": END_MINUTE
        }
      ]
    },
    "base_price": "BASE_PRICE",
    "cost_price": "COST_PRICE",
    "administrative_status": "BOOLEAN",
    "product_summary": "PRODUCT_SUMMARY",
    "product_description": "PRODUCT_DESCRIPTION",
    "product_properties": {
      "featured_product": BOOLEAN,
      "featured_product_label": "FEATURED_PRODUCT_LABEL",
      "new_product": BOOLEAN,
      "sold_out": BOOLEAN,
      "sold_out_label": "SOLD_OUT_LABEL",
      "model": "PRODUCT_MODEL",
      "length": "PRODUCT_LENGTH",
      "width": "PRODUCT_WIDTH",
      "height": "PRODUCT_HEIGHT",
      "weight": "PRODUCT_WEIGHT"
    },
    "product_pricing_and_stock": {
      "track_inventory": BOOLEAN,
      "available_stock": "AVAILABLE_STOCK",
      "low_level_stock": "LOW_LEVEL_STOCK",
      "minimum_order_quantity": "MINIMUM_ORDER_QUANTITY",
      "maximum_order_quantity": "MAXIMUM_ORDER_QUANTITY",
      "tax_profile": "TAX_PROFILE",
      "shipping_profile": {
        "id": SHIPPING_PROFILE_ID,
        "name": "SHIPPING_PROFILE_NAME"
      },
      "enable_multiple_order": BOOLEAN,
      "multiple_order_quantity": "MULTIPLE_ORDER_QUANTITY",
      "on_sale": BOOLEAN,
      "on_sale_price_type": "ON_SALE_PRICE_TYPE",
      "on_sale_price": "ON_SALE_PRICE",
      "expected_to_pay": BOOLEAN,
      "expected_to_pay_price": "EXPECTED_TO_PAY_PRICE",
      "enable_call_for_price": BOOLEAN,
      "restrict_price_for": "RESTRICT_PRICE_FOR",
      "restrict_price_for_selected_customers": [
        "CUSTOMER_ID_1",
        "CUSTOMER_ID_2",
        "CUSTOMER_ID_3"
      ],
      "restrict_purchase_for": "RESTRICT_PURCHASE_FOR",
      "restrict_purchase_for_selected_customers": [
        "CUSTOMER_ID_1",
        "CUSTOMER_ID_2",
        "CUSTOMER_ID_3"
      ],
      "hide_price": BOOLEAN,
      "variation_price": {
        "label": "VARIATION_LABEL",
        "display_type": "VARIATION_DISPLAY_TYPE"
      },
      "enable_lite_variation": BOOLEAN
    },
    "image_and_video": {
      "images": [
        {
          "filename": "IMAGE_FILENAME",
          "base64": "BASE64_IMAGE_STRING"
        }
      ],
      "videos": [
        {
          "video": "BINARY_VIDEO_FILE",
          "metadata": "VIDEO_METADATA_JSON"
        }
      ],
      "spec": [
        {
          "filename": "SPEC_FILENAME",
          "base64": "BASE64_SPEC_STRING"
        }
      ]
    },
    "advanced": {
      "advance_information": {
        "global_trade_item_number": "GTIN_NUMBER",
        "product_condition": "PRODUCT_CONDITION"
      },
      "webtool_disable_tracking": BOOLEAN,
      "meta_tags": [
        {
          "name": "META_TAG_NAME",
          "value": "META_TAG_VALUE",
          "id": META_TAG_ID
        }
      ]
    },
    "related_products": [
      {
        "id": RELATED_PRODUCT_ID,
        "name": "RELATED_PRODUCT_NAME",
        "url": "RELATED_PRODUCT_URL"
      }
    ],
    "similar_products": [
      {
        "id": SIMILAR_PRODUCT_ID,
        "name": "SIMILAR_PRODUCT_NAME",
        "url": "SIMILAR_PRODUCT_URL"
      }
    ],
    "seo_configs": [
      {
        "value": "SEO_CONFIG_VALUE",
        "type": "SEO_CONFIG_TYPE",
        "config_key": "SEO_CONFIG_KEY",
        "meta_tags": []
      }
    ],
    "tags": [
      {
        "name": "TAG_NAME",
        "values": [
          "TAG_VALUE_1",
          "TAG_VALUE_2",
          "TAG_VALUE_3"
        ],
        "display_in_product_page": BOOLEAN,
        "enable_expanded_view": BOOLEAN
      }
    ],
    "custom_properties": [
      {
        "label": "CUSTOM_PROPERTY_LABEL",
        "description": "CUSTOM_PROPERTY_DESCRIPTION"
      }
    ]
  }

Response

Upon successful update, the API returns the updated product object containing all the new details. The response includes basic information, pricing, inventory settings, visibility settings, SEO configurations, and timestamps, providing confirmation that the product was modified as requested.

PUT
https://wcapi.mywebcommander.com/api/v4/admin/products/{product_id}
Try It Out
{
    "product": {
        "id": PRODUCT_ID,
        "name": "PRODUCT_NAME",
        "sku": "PRODUCT_SKU",
        "urls": {
            "url": "PRODUCT_URL_SLUG",
            "product_url": "PRODUCT_FULL_URL"
        },
        "heading": "PRODUCT_HEADING",
        "parents": [],
        "created_by": {
            "id": CREATED_BY_ID,
            "name": "CREATED_BY_NAME"
        },
        "created_at": "YYYY-MM-DDTHH:MM:SS",
        "updated_at": "YYYY-MM-DDTHH:MM:SS",
        "product_type": "PRODUCT_TYPE",
        "available": BOOLEAN,
        "product_page": {
            "id": PRODUCT_PAGE_ID,
            "name": "PRODUCT_PAGE_NAME"
        },
        "product_layout": PRODUCT_LAYOUT_OBJECT,
        "custom_class": CUSTOM_CLASS,
        "available_on_date_range": BOOLEAN,
        "available_from_date": "AVAILABLE_FROM_DATE",
        "available_to_date": "AVAILABLE_TO_DATE",
        "available_for": "AVAILABLE_FOR_TYPE",
        "selected_customers": {
            "customers": [
                {
                    "id": CUSTOMER_ID_1,
                    "name": "CUSTOMER_NAME_1"
                }
            ],
            "groups": [
                {
                    "id": GROUP_ID_1,
                    "name": "GROUP_NAME_1"
                }
            ]
        },
        "restrict_for_selected_customers": [],
        "password_protected": BOOLEAN,
        "password": "PRODUCT_PASSWORD",
        "available_on_weekdays": {
            "enabled": BOOLEAN,
            "weekdays": [
                {
                    "day": "WEEKDAY_NAME",
                    "start_hour": START_HOUR,
                    "start_minute": START_MINUTE,
                    "end_hour": END_HOUR,
                    "end_minute": END_MINUTE
                }
            ]
        },
        "base_price": BASE_PRICE,
        "cost_price": COST_PRICE,
        "is_on_sale": BOOLEAN,
        "sale_price": SALE_PRICE,
        "sold_out": BOOLEAN,
        "length": "PRODUCT_LENGTH",
        "width": "PRODUCT_WIDTH",
        "height": "PRODUCT_HEIGHT",
        "weight": "PRODUCT_WEIGHT",
        "sold_out_label": SOLD_OUT_LABEL,
        "administrative_status": BOOLEAN,
        "product_summary": "PRODUCT_SUMMARY",
        "product_description": "PRODUCT_DESCRIPTION",
        "product_pricing_and_stock": {
            "track_inventory": BOOLEAN,
            "available_stock": AVAILABLE_STOCK,
            "low_level_stock": LOW_LEVEL_STOCK,
            "minimum_order_quantity": MINIMUM_ORDER_QUANTITY,
            "maximum_order_quantity": MAXIMUM_ORDER_QUANTITY,
            "tax_profile": TAX_PROFILE_OBJECT,
            "shipping_profile": SHIPPING_PROFILE_OBJECT,
            "enable_multiple_order": BOOLEAN,
            "multiple_order_quantity": MULTIPLE_ORDER_QUANTITY,
            "on_sale": BOOLEAN,
            "on_sale_price_type": "ON_SALE_PRICE_TYPE",
            "on_sale_price": ON_SALE_PRICE,
            "expected_to_pay": BOOLEAN,
            "expected_to_pay_price": EXPECTED_TO_PAY_PRICE,
            "enable_call_for_price": BOOLEAN,
            "restrict_price_for": "RESTRICT_PRICE_FOR",
            "restrict_price_for_except_customers": [],
            "restrict_purchase_for": "RESTRICT_PURCHASE_FOR",
            "restrict_purchase_for_selected_customers": [],
            "hide_price": BOOLEAN
        },
        "image_and_video": {
            "images": [
                {
                    "id": IMAGE_ID,
                    "filename": "IMAGE_FILENAME",
                    "thumbnail": "BASE64_IMAGE_STRING"
                    "link": "LINK"
                }
            ],
            "videos": [
                {
                    "id": VIDEO_ID,
                    "filename": "BINARY_VIDEO_FILE",
                    "thumbnail": "VIDEO_METADATA_JSON"
                    "link": "LINK"
                }
            ],
            "spec": [
                {
                    "id": SPEC_ID,
                    "filename": "SPEC_FILENAME",
                    "link": "LINK"
                }
            ]
        },
        "advanced": {
            "advance_information": {
                "global_trade_item_number": GLOBAL_TRADE_ITEM_NUMBER,
                "product_condition": "PRODUCT_CONDITION"
            },
            "webtool_disable_tracking": BOOLEAN,
            "meta_tags": []
        },
        "related_products": [
            {
                "id": RELATED_PRODUCT_ID,
                "name": "RELATED_PRODUCT_NAME",
                "url": "RELATED_PRODUCT_URL"
            }
        ],
        "similar_products": [
            {
                "id": SIMILAR_PRODUCT_ID,
                "name": "SIMILAR_PRODUCT_NAME",
                "url": "SIMILAR_PRODUCT_URL"
            }
        ],
        "seo_configs": [
            {
                "id": SEO_CONFIG_ID,
                "value": "SEO_CONFIG_VALUE",
                "type": "SEO_CONFIG_TYPE",
                "config_key": "SEO_CONFIG_KEY",
                "meta_tags": []
            }
        ],
        "tags": [],
        "custom_properties": CUSTOM_PROPERTIES_OBJECT,
        "reviews": [],
        "product_variation": BOOLEAN
    }
}