> ## Documentation Index
> Fetch the complete documentation index at: https://docs.subotiz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Product

> Partially updates the product by field; omitted fields remain unchanged. Updating an active product creates a new version and returns the new version ID; changing status is not supported (use Change Product Status instead). features is replaced as a whole: existing features not included are deleted and removed from all prices under this product; when omitted, features remain unchanged. merchant_product_id cannot be cleared, and changes are not synced to prices already created. All features cannot be cleared via this API; feature ids must not repeat within one request.

Partially updates the product by field; omitted fields remain unchanged. Updating an active product creates a new version and returns the new version ID; changing status is not supported (use Change Product Status instead). features is replaced as a whole: existing features not included are deleted and removed from all prices under this product; when omitted, features remain unchanged. merchant\_product\_id cannot be cleared, and changes are not synced to prices already created. All features cannot be cleared via this API; feature ids must not repeat within one request.


## OpenAPI

````yaml openapi/v1-en.yaml POST /api/v1/products/{product_id}
openapi: 3.0.3
info:
  title: Subotiz API
  description: Subotiz OpenAPI
  version: 1.0.0
servers:
  - url: https://{api}.subotiz.com
    variables:
      api:
        default: api
security:
  - sec0: []
tags:
  - name: Subscription
    description: 订阅
  - name: Price
    description: 商品定价方案
  - name: Trade
    description: 交易单
  - name: Payment
    description: 支付流水
  - name: Checkout Session
    description: 结账会话
  - name: Customer
    description: 顾客
  - name: Customer Portal
    description: 顾客门户
paths:
  /api/v1/products/{product_id}:
    post:
      tags:
        - Product
      summary: Update Product
      description: >-
        Partially updates the product by field; omitted fields remain unchanged.
        Updating an active product creates a new version and returns the new
        version ID; changing status is not supported (use Change Product Status
        instead). features is replaced as a whole: existing features not
        included are deleted and removed from all prices under this product;
        when omitted, features remain unchanged. merchant_product_id cannot be
        cleared, and changes are not synced to prices already created. All
        features cannot be cleared via this API; feature ids must not repeat
        within one request.
      operationId: v1-product-update-product
      parameters:
        - name: product_id
          in: path
          description: Subotiz platform product ID
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/HeaderRequestID'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateProductResponse'
components:
  parameters:
    HeaderRequestID:
      name: Request-Id
      in: header
      description: The unique identifier of the request
      required: true
      schema:
        type: string
        default: 008e3967-a1b5-48bb-be14-d5bff5092e61
  schemas:
    UpdateProductRequest:
      required:
        - product_id
      type: object
      properties:
        product_id:
          type: string
          description: Subotiz platform product ID
        product_name:
          type: string
          description: Product name; must not be empty when provided
        category_id:
          type: string
          description: Product category ID
        image_url:
          type: string
          description: Product image URL; must not be empty when provided
        merchant_product_id:
          type: string
          description: >-
            Merchant-side product ID, unique within the merchant; empty string
            is not allowed (clearing it via this API is not supported). Changes
            are not synced to prices already created
        description:
          type: string
          description: Product description
        features:
          type: array
          items:
            $ref: '#/components/schemas/UpdateProductFeature'
          description: |-
            Product features list, replaced as a whole:
             - When provided, existing features not included are deleted and removed from all prices under this product
             - When omitted (or an empty list is passed), features remain unchanged, so all features cannot be cleared via this API
             - To keep an existing feature, include its id; entries without id are treated as new; ids must not repeat within one request
        quantity_unit:
          type: string
          description: >-
            Quantity unit name (product-level); empty string resets it to the
            default "unit"
      description: >-
        Update product request (partial update by field: omitted fields remain
        unchanged)
    UpdateProductResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/UpdateProductResponse_Data'
      description: Update product response
    UpdateProductFeature:
      type: object
      properties:
        id:
          type: string
          description: Existing feature ID; empty means a new feature
        name:
          type: string
          description: Feature name
        type:
          type: string
          description: Feature type
      description: Feature used when updating a product
    UpdateProductResponse_Data:
      type: object
      properties:
        product_id:
          type: string
          description: Subotiz platform product ID
        product_version_id:
          type: string
          description: >-
            Current product version ID after the update (updating an active
            product creates a new version)
      description: Update product response
  securitySchemes:
    sec0:
      type: http
      description: >-
        Bearer API Key authentication. Format: Authorization: Bearer
        {your_api_key}
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.