# Edit Products

The method allows you to change the product parameters.
When editing units of measure for a product that already has inventory operations, you must add an array of rules for recalculating units of measure - correction_rules. Otherwise, the array is optional.

Endpoint: PUT /goods/{location_id}/{product_id}
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (number, required)
    Location ID

  - `product_id` (number, required)
    Product ID

## Header parameters:

  - `Accept` (string, required)
    application/vnd.api.v2+json

  - `Content-Type` (string, required)
    application/json

  - `Authorization` (string, required)
    Bearer partner_token, User user_token

## Request fields (application/json):

  - `title` (string, required)
    Product Name

  - `print_title` (string)
    Title to be printed on receipt

  - `article` (string)
    vendor code

  - `barcode` (string)
    Barcode

  - `category_id` (integer, required)
    Product category ID

  - `cost` (number)
    Selling price

  - `actual_cost` (number)
    Cost price

  - `sale_unit_id` (integer, required)
    Sales unit

  - `service_unit_id` (integer, required)
    Write-off unit

  - `unit_equals` (number)
    The ratio of the unit of measure for sale to the unit of measure for write-off

  - `critical_amount` (number)
    critical residue

  - `desired_amount` (number)
    Desired balance

  - `netto` (number)
    Net weight

  - `brutto` (number)
    Gross weight

  - `comment` (string)
    A comment

  - `tax_variant` (integer)
    Taxation system

  - `vat_id` (integer)
    VAT

  - `correction_rules` (array)
    An array of rules for converting units of measurement (required if there are inventory operations for the product)

  - `correction_rules.type` (integer)
    Type of transaction

  - `correction_rules.base_unit` (string)
    Basic units in adjustment

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `success` (boolean)
    Execution success status (true)

  - `data` (object)
    Product data object

  - `data.title` (string)
    Name of product

  - `data.value` (string)
    Name of product

  - `data.label` (string)
    Product name with article number (if any)

  - `data.good_id` (number)
    Product ID

  - `data.cost` (number)
    Selling price

  - `data.unit_id` (number)
    Sales Unit ID

  - `data.unit_short_title` (string)
    Sales unit

  - `data.service_unit_id` (number)
    ID of unit of measure to write off

  - `data.service_unit_short_title` (string)
    Write-off unit

  - `data.actual_cost` (number)
    Cost price

  - `data.unit_actual_cost` (number)
    Unit cost

  - `data.unit_actual_cost_format` (string)
    Unit cost format

  - `data.unit_equals` (number)
    The ratio of the unit of measure for sale to the unit for write-off

  - `data.barcode` (string)
    Barcode

  - `data.loyalty_abonement_type_id` (number)
    Subscription type identifier (if the product is a membership)

  - `data.loyalty_certificate_type_id` (number)
    Certificate type identifier (if the item is a certificate)

  - `data.loyalty_allow_empty_code` (boolean | number)
    Is it allowed to sell without a code (can be 0/1 or true/false)

  - `data.critical_amount` (number)
    Critical residue

  - `data.desired_amount` (number)
    Desired balance

  - `data.actual_amounts` (array)
    Remaining stock

  - `data.actual_amounts.storage_id` (number)
    Inventory ID

  - `data.actual_amounts.amount` (number)
    Quantity

  - `data.last_change_date` (string)
    The date the entity was last modified

  - `meta` (array)
    Metadata (empty array)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

## Response 409:

  - `409` (unknown)
    Conflict

## Response 409 fields (application/json):

  - `success` (boolean)
    Execution success status

  - `data` (string)
    Contains null

  - `meta` (object)
    Object with error message

  - `meta.message` (string)

  - `meta.conflict` (boolean)

## Response 422:

  - `422` (unknown)
    Unprocessable Entity

## Response 422 fields (application/json):

  - `success` (boolean)
    Execution success status

  - `data` (string)
    Contains null

  - `meta` (object)
    Contains an error message

  - `meta.message` (string)

  - `meta.errors` (array)

  - `meta.errors.message` (string)

