# Update Product

Updates a product. This is not a partial update: the request is the whole product, and it replaces what is stored.
Send `sku` (the same as in the path), `name`, `selling_price` and `currency` every time. Most fields you leave out are reset, not kept: `description`, `vendor`, `type`, `image`, `harmonized_system_code` and `country_code_of_origin` are cleared, `partner_product_id` and `barcode` return to the SKU, `weight`, `weight_unit` and `dimensions` return to their defaults, and `status` returns to `active`. Read the product first and send it back with your changes.
These are kept when you leave them out: `cost_price`, `platform_price`, `manufacturer_name`, `manufacturer_id`, `track_expiry`, `batch_management`, `expiry_management`, `inbound_expiry_threshold_days` and `outbound_expiry_threshold_days`. To remove a stored platform price, send `clear_platform_price` `true`; to remove a manufacturer field, send it as an empty string. Do not copy `cost_price` from a read unless you mean it: with no cost stored, a read returns the selling price there.

Endpoint: PATCH /api/fulfilment/products/{sku}
Version: 1.0.0
Security: BearerAuth, OAuth2

## Security:

  - `BearerAuth` (unknown)
    http bearer

  - `OAuth2` (unknown)
    oauth2

## Path parameters:

  - `sku` (string, required)
    The product SKU. The product id is not accepted.

## Request fields (application/json):

  - `availability_status` (integer)
    Not used: any value you send is ignored.

  - `barcode` (string)
    Product barcode (EAN, UPC, ISBN and so on), at most 50 characters. Defaults to the sku.

  - `batch_management` (boolean)
    Whether stock of this product is tracked by batch. On an update, omit it to keep the stored value; a new product defaults to false.

  - `clear_platform_price` (boolean)
    Send true to remove a stored platform_price. Only needed on an update, because omitting platform_price keeps the stored value. When platform_price is also sent, the value you send is kept and this flag has no effect.

  - `cost_price` (number)
    What one unit costs you, 0 or more. On an update, omit it or send 0 to keep the stored cost.

  - `country_code_of_origin` (string)
    ISO 3166-1 alpha-2 code of the country of manufacture, for example CN. Needed in practice for exports.

  - `currency` (string, required)
    Three-letter ISO 4217 currency code.
    Enum: "AED", "SAR"

  - `description` (string)
    Product description, at most 1,000 characters. When empty, responses return the name in its place.

  - `dimensions` (object)
    Length, width and height of one unit.

  - `dimensions.height` (number, required)
    Height of one unit. Greater than 0.

  - `dimensions.length` (number, required)
    Length of one unit. Greater than 0.

  - `dimensions.unit` (string, required)
    cm or m.

  - `dimensions.width` (number, required)
    Width of one unit. Greater than 0.

  - `expiry_management` (boolean)
    Whether stock of this product is managed by expiry date. On an update, omit it to keep the stored value; a new product defaults to false.

  - `harmonized_system_code` (string)
    HS code for customs, at most 20 characters. Needed in practice for exports.

  - `image` (string)
    URL of the product image.

  - `inbound_expiry_threshold_days` (integer)
    Minimum days of shelf life the warehouse accepts when receiving stock, 0 or more. On an update, omit it to keep the stored value.

  - `inventory_tracked` (boolean)
    Not used: any value you send is ignored.

  - `manufacturer_id` (string)
    Manufacturer ID (MID) for customs, at most 100 characters. Carriers ask for it on exports. On an update, omit it to keep the stored value; send an empty string to remove it.

  - `manufacturer_name` (string)
    Name of the manufacturer, at most 255 characters. Carriers ask for it on exports. On an update, omit it to keep the stored value; send an empty string to remove it.

  - `name` (string, required)
    Product name, 2 to 255 characters. Required.

  - `outbound_expiry_threshold_days` (integer)
    Minimum days of shelf life the warehouse picks with, 0 or more. On an update, omit it to keep the stored value.

  - `partner_product_id` (string)
    Your own identifier for the product, at most 100 characters. Defaults to the sku.

  - `platform_price` (number)
    Price used for international orders in place of the sales-channel price, when that is enabled for your account. Greater than 0. On an update, omitting it keeps the stored value: use clear_platform_price to remove it.

  - `requires_shipping` (boolean)
    Not used: any value you send is ignored.

  - `retail_price` (number)
    Not used: any value you send is ignored. Responses return the selling price here.

  - `selling_price` (number, required)
    What the customer pays for one unit. Required, greater than 0.

  - `sku` (string, required)
    Your stock keeping unit, 3 to 100 characters, unique on your account. Required. On an update, send the same sku as in the path.

  - `status` (string)
    Status of a product. Archive a SKU to retire it; there is no delete.
    Enum: "active", "archived", "draft"

  - `total_sales` (number)
    Not used: any value you send is ignored.

  - `track_expiry` (boolean)
    Whether expiry dates are tracked for this product. On an update, omit it to keep the stored value; a new product defaults to false.

  - `type` (string)
    physical or digital.
    Enum: "physical", "digital"

  - `vendor` (string)
    Vendor or brand name, at most 255 characters.

  - `weight` (number)
    Weight of one unit, greater than 0. Defaults to 0.5 when omitted.

  - `weight_unit` (string)
    kg or g. Defaults to kg.

## Response 200:

  - `200` (unknown)
    Success response

## Response 200 fields (application/json):

  - `availability_status` (integer)
    Not populated. Read stock from the inventory endpoints instead.

  - `barcode` (string)
    Product barcode (EAN, UPC, ISBN, etc.).

  - `batch_management` (boolean)
    Whether stock of this product is tracked by batch.

  - `cost_price` (number)
    The stored cost price, or the selling price when no cost is stored.

  - `country_code_of_origin` (string)
    ISO 3166-1 alpha-2 code of the country of manufacture.

  - `created_at` (string)
    Not populated.

  - `currency` (string)
    Three-letter ISO 4217 currency code.
    Enum: "AED", "SAR"

  - `description` (string)
    Product description, or the name when no description is stored.

  - `dimensions` (object)
    Length, width and height of one unit.

  - `dimensions.dimension_unit` (string)
    Unit of the measurements, cm or m.

  - `dimensions.height` (string)
    Height of one unit, as a decimal string.

  - `dimensions.length` (string)
    Length of one unit, as a decimal string.

  - `dimensions.width` (string)
    Width of one unit, as a decimal string.

  - `expiry_management` (boolean)
    Whether stock of this product is managed by expiry date.

  - `harmonized_system_code` (string)
    HS code for customs.

  - `id` (string)
    Quiqup's numeric id for the product, as a string.

  - `image` (string)
    URL of the product image.

  - `inbound_expiry_threshold_days` (integer)
    Minimum days of shelf life the warehouse accepts when receiving stock.

  - `inventory_tracked` (boolean)
    Whether stock levels are tracked for this product.

  - `manufacturer_id` (string)
    Manufacturer ID (MID) for customs. Null when not set.

  - `manufacturer_name` (string)
    Name of the manufacturer, for customs. Null when not set.

  - `name` (string)
    Name of the product.

  - `outbound_expiry_threshold_days` (integer)
    Minimum days of shelf life the warehouse picks with.

  - `partner_product_id` (string)
    Your own identifier for the product.

  - `platform_price` (number)
    Price used for international orders, when one is set.

  - `requires_shipping` (boolean)
    Not populated.

  - `retail_price` (number)
    The same value as selling_price.

  - `selling_price` (number)
    What the customer pays for one unit.

  - `sku` (string)
    Your stock keeping unit.

  - `status` (string)
    Status of a product. Archive a SKU to retire it; there is no delete.
    Enum: "active", "archived", "draft"

  - `total_sales` (number)
    Not populated.

  - `track_expiry` (boolean)
    Whether expiry dates are tracked for this product.

  - `type` (string)
    physical or digital.

  - `updated_at` (string)
    Not populated.

  - `vendor` (string)
    Vendor or brand name.

  - `weight` (number)
    Weight of one unit.

  - `weight_unit` (string)
    kg or g.

## Response 4XX:

  - `4XX` (unknown)
    Error response. See [Error responses](/docs/errors).

## Response 4XX fields (application/json):

  - `code` (string, required)
    The error code. It matches the HTTP status: invalid_argument and failed_precondition are 400, unauthenticated 401, permission_denied 403, not_found 404, already_exists 409, internal 500 and unavailable 503.
    Enum: "canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"

  - `details` (object)
    More about the error. Can be null.

  - `details.field_diffs` (array)
    When an inbound is refused because your product data and the warehouse's disagree, one entry per disagreement.

  - `details.field_diffs.field` (string)
    What disagrees, for example barcode_mismatch.

  - `details.field_diffs.ours` (string)
    The value Quiqup holds for the product.

  - `details.field_diffs.sku` (string)
    The SKU.

  - `details.field_diffs.warehouse` (string)
    The value the warehouse holds.

  - `details.fields` (array)
    For input errors, one entry per field that failed.

  - `details.fields.field` (string)
    The field that failed. Request validation names it by its path in the request, for example ShippingAddress.Phone or Items[0].UnitPrice, which is not always the JSON name.

  - `details.fields.message` (string)
    What was wrong. Request validation gives the rule that failed, for example required.

  - `details.reason` (string)
    A stable identifier for some failures, safe to branch on.

  - `details.request_id` (string)
    Identifies the request. Quote it when you contact support.

  - `details.type` (string)
    The kind of failure.
    Enum: "input", "not_found", "unauthorized", "forbidden", "integration", "internal"

  - `message` (string, required)
    A sentence describing the error.

## Response default:

  - `default` (unknown)
    Error response. See [Error responses](/docs/errors).

## Response default fields (application/json):

  - `code` (string, required)
    The error code. It matches the HTTP status: invalid_argument and failed_precondition are 400, unauthenticated 401, permission_denied 403, not_found 404, already_exists 409, internal 500 and unavailable 503.
    Enum: "canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"

  - `details` (object)
    More about the error. Can be null.

  - `details.field_diffs` (array)
    When an inbound is refused because your product data and the warehouse's disagree, one entry per disagreement.

  - `details.field_diffs.field` (string)
    What disagrees, for example barcode_mismatch.

  - `details.field_diffs.ours` (string)
    The value Quiqup holds for the product.

  - `details.field_diffs.sku` (string)
    The SKU.

  - `details.field_diffs.warehouse` (string)
    The value the warehouse holds.

  - `details.fields` (array)
    For input errors, one entry per field that failed.

  - `details.fields.field` (string)
    The field that failed. Request validation names it by its path in the request, for example ShippingAddress.Phone or Items[0].UnitPrice, which is not always the JSON name.

  - `details.fields.message` (string)
    What was wrong. Request validation gives the rule that failed, for example required.

  - `details.reason` (string)
    A stable identifier for some failures, safe to branch on.

  - `details.request_id` (string)
    Identifies the request. Quote it when you contact support.

  - `details.type` (string)
    The kind of failure.
    Enum: "input", "not_found", "unauthorized", "forbidden", "integration", "internal"

  - `message` (string, required)
    A sentence describing the error.

