shop.product.update

Adds a new product. Access rights allowing a user to edit products of that type are required.

Parameters

  • id GET

    Product ID.

  • name POST Optional

    Name.

  • summary POST Optional

    Brief description.

  • meta_title POST Optional

    TITLE element for product page in storefront.

  • meta_keywords POST Optional

    META keywords.

  • meta_description POST Optional

    META description.

  • description POST Optional

    Full description.

  • status POST Optional

    Publication status. 0: hidden, 1: published.

  • type_id POST Optional

    Product type ID.

  • image_id POST Optional

    Default image ID.

  • sku_id POST Optional

    Default product variant ID.

  • url POST Optional

    Editable part of the product page URL in the storefront.

  • price POST Optional

    Price.

  • compare_price POST Optional

    Strike-through price.

  • currency POST Optional

    Product currency's ISO3 code.

  • tax_id POST Optional

    Id of product's tax rule.

  • cross_selling POST Optional

    Recommended products selection mode (cross-selling): 0 (disabled), 1 (automatic selection), 2 (manually selected recommended products).

  • upselling POST Optional

    Recommended products selection mode (upselling). 0 (disabled), 1 (automatic selection), 2 (manually selected recommended products).

  • badge POST Optional

    Id of selected default badge or HTML code of custom badge.

  • sku_type POST Optional

    Product variants selection mode for the storefront: 0 (by SKU names), 1 (by feature values). Default value is 0.

  • features POST Optional

    Array of product feature’s values. Array keys are the features’ string identifiers. Array item values have different format depending on a particular feature type.
    — Single text or numeric value: feature value.
    — Multiple text or numeric values: array of values.
    — Single editable numeric value with a measurement unit: array with the keys 'value' (editable value), 'unit' (localization key of the brief measurement unit name).
    — Single numeric value, with a measurement unit, selectable from a list: feature value followed by a whitespace character and a localized brief measurement unit name.
    — Multiple numeric values with measurement units: array of strings each being a feature value followed by a whitespace character and a localized brief measurement unit name.
    — Dimensions in the form X*X(*X): array with the keys 'feature identifier.0[value]' (1st dimension), 'feature identifier.1[value]' (2nd dimension),
    'feature identifier.2[value]' (3rd dimension, if applicable), 'feature identifier.0[unit]' (localization key of the brief measurement unit name).
    — Range of numeric values: array with the keys 'value[begin]' (start value), 'value[end]' (end value), 'unit' (localization key of the brief measurement unit name, if applicable).
    — Single color value: array with the keys 'value' (editable color name), 'code' (HTML code of a color starting with the # character).
    — Single color value selectable from a list: editable color name.
    ­— Multiple color values: array of editable color names.
    — Yes/No toggle: 1 (yes), 0 (no), or empty value (if not specified).
    — Date: string in the “yyyy-mm-dd” format.

  • categories POST Optional

    Array of product’s categories’ IDs. The first ID in the array is saved as product’s main category ID.

  • skus POST

    Product variants data array. Array keys are variants’ IDs, array values are sub-arrays with variants’ properties:

    - available (int) Flag (0 or 1) of the availability for purchase.
    - status (int) Flag (0 or 1) of the visibility in the storefront.
    - price (float) Price in the decimal(15,4) format.
    - purchase_price (float) Purchase price in the decimal(15,4) format.
    - compare_price (float) Strike-through price in the decimal(15,4) format.
    - name (string) Name.
    - stock_base_ratio (float) Stock-to-base quantity unit rationin the decimal(16,8) format.
    - order_count_min (float) Minimal orderable quantity in the decimal(15,4) format.
    - order_count_step (float) Value of the quantity adjustment with “+/-” buttons in the decimal(15,4) format.
    - stock (array) Variant’s stock quantities. If no stocks are set up in the store settings then the array must contain 1 item with the Variant’s stock quantity in the decimal(15,3) format. If stocks are set up then array keys must be stock IDs and array values must be quantities available on those stocks in the decimal(15,3) format.
    - features (array) Variant’s feature values. Array keys must be features identifiers (strings) and array values must be corresponding features’ values.

  • tags POST Optional

    List of tags, which must be associated with the product, separated by commas as one string or as an array.

  • params POST Optional

    Extra product parameters as an associative array or as a string of the form 'name1=value1\nname2=value2\n...' in which name/value pairs must separated with newline characters. If null is passed instead then all extra parameters of the specified product will be deleted.

  • sets POST Optional

    Array with the information about static sets in which the product must be included. Array items must be either set IDs or sub-arrays, each containing a single 'id' key with the corresponding set ID. If a product was contained in some sets then it is automatically excluded from those whose IDs are not specified in this parameter.

  • og POST Optional

    Associative array of product properties for social media and online messengers. Examples of allowed array keys are 'title', 'description', 'video', 'image_id'.

  • stock_base_ratio POST Optional

    Stock-to-base quantity unit ratio.

  • order_count_min POST Optional

    Minimum orderable quantity.

  • order_count_step POST Optional

    Quantity adjustment value with “+/-” buttons.

  • format GET Optional

    Sets response format. Available options: json (default), xml.

Error codes

  • invalid_request

    Invalid formed request. Additional information about the error is available in error_description parameter.

  • access_denied

    Access to the specified API method for the current token is denied.

  • invalid_method

    Unknown API method.