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

# Update an Item

<Note>
  **Uploading Product Images**

  To upload or update product images, use `multipart/form-data` instead of `application/json`. All the regular JSON fields are supported as form fields, plus:

  * `product_images`: Array of image files (JPEG, PNG, etc.)
  * For complex fields like `custom_columns`, `alternative_units`, and `preferences`, send them as JSON strings
</Note>


## OpenAPI

````yaml put /v2/product
openapi: 3.0.1
info:
  title: SwipeAPI
  description: Partner API
  version: '2.0'
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
tags:
  - name: Document
    description: Document related operations
  - name: Customer
    description: Customer related operations
  - name: Payment
    description: Payment related operations
  - name: Product
    description: Product related operations
  - name: Utility
    description: Generic operations
  - name: Subscriptions
    description: Subscriptions related operations
  - name: Document V2
    description: Document related operations
  - name: Customer V2
    description: Customer related operations
  - name: Payment V2
    description: Payment related operations
  - name: Product V2
    description: Product related operations
  - name: Subscriptions V2
    description: Subscriptions related operations
  - name: Utility V2
    description: Generic operations
  - name: Vendor V2
    description: Vendor related operations
  - name: EwayBill
    description: EwayBill related operations
  - name: Inventory V2
    description: Inventory related operations
paths:
  /v2/product:
    put:
      tags:
        - Product V2
      summary: Update an Item
      operationId: v2_put_product
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemV2FormData'
            example:
              id: ITEM123
              name: Updated Product Name
              item_type: Product
              quantity: 15
              unit_price: 120
              tax_rate: 18
              price_with_tax: 141.6
              description: Updated product description
              custom_columns: '[{"label":"Updated Label","value":"Updated Value"}]'
              product_images:
                - <binary_image_file_1>
                - <binary_image_file_2>
          application/json:
            schema:
              $ref: '#/components/schemas/ItemV2'
            example:
              id: ITEM123
              name: Updated Product Name
              item_type: Product
              quantity: 15
              unit_price: 120
              tax_rate: 18
              price_with_tax: 141.6
              description: Updated product description
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponseV2'
        '400':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponseV2'
components:
  schemas:
    ItemV2FormData:
      type: object
      description: >-
        Product/Item object for form data requests. Use this format when
        uploading product images.
      required:
        - id
        - item_type
        - name
        - price_with_tax
        - quantity
        - unit_price
      properties:
        id:
          type: string
          description: Unique id for each item.
          example: ITEM123
        name:
          type: string
          description: Name of the Product
          example: Item Name
        quantity:
          type: number
          description: Opening Quantity
          example: 1
        unit_price:
          type: number
          description: Price per item without Tax
          example: 100
        tax_rate:
          type: number
          description: Tax percentage for each item . Only valid tax rates are accepted
          example: 18
        price_with_tax:
          type: number
          description: Price per item with Tax
          example: 118
        purchase_price_with_tax:
          type: number
          description: Purchase Price per item with Tax
          example: 118
        description:
          type: string
          description: Item Description
          example: Item Description
        hsn_code:
          type: string
          description: HSN Code
          example: '1234'
        item_type:
          type: string
          description: Product or Service enum
          example: Product
          enum:
            - Product
            - Service
        unit:
          type: string
          description: >-
            Item quantity unit. You can find the GST-approved units in the UQC
            Codes section at: https://einvoice1.gst.gov.in/Others/MasterCodes.
          example: kg
        cess_rate:
          type: number
          description: Cess Percent of the Item
          default: 0
          example: 0
          maximum: 100
        cess_amount:
          type: number
          description: Cess Amount of the Item
          default: 0
          example: 0
        barcode:
          type: string
          description: Barcode
          example: '2273546838467'
        category:
          type: string
          description: Category
          example: Electronics
        custom_columns:
          type: string
          description: >-
            Custom Fields as JSON string for form data. Example -
            [{"label":"Custom Label","value":"Custom Value"}]
          example: '[{"label":"Custom Label","value":"Custom Value"}]'
        alternative_units:
          type: string
          description: >-
            Alternative Units as JSON string for form data. Example -
            [{"alternative_unit":"g","conversion_rate":1000}]
          example: '[{"alternative_unit":"g","conversion_rate":1000}]'
        preferences:
          type: string
          description: >-
            Product Preferences as JSON string for form data. Example -
            {"not_for_sale":false}
          example: '{"not_for_sale":false}'
        visibility:
          type: integer
          description: >-
            If set to 1, the product will be visible to all branches. If set to
            0, the product will be visible only to the branch it was created in.
          example: 1
        product_images:
          type: array
          description: >-
            Product images to upload. Each image should be sent as a file in the
            form data.
          items:
            type: string
            format: binary
            description: Image file (JPEG, PNG, etc.)
    ItemV2:
      type: object
      required:
        - id
        - item_type
        - name
        - price_with_tax
        - quantity
        - unit_price
      properties:
        id:
          type: string
          description: Unique id for each item.
          example: ITEM123
        name:
          type: string
          description: Name of the Product
          example: Item Name
        quantity:
          type: number
          description: Opening Quantity
          example: 1
        unit_price:
          type: number
          description: Price per item without Tax
          example: 100
        tax_rate:
          type: number
          description: Tax percentage for each item . Only valid tax rates are accepted
          example: 18
        price_with_tax:
          type: number
          description: Price per item with Tax
          example: 118
        purchase_price_with_tax:
          type: number
          description: Purchase Price per item with Tax
          example: 118
        description:
          type: string
          description: Item Description
          example: Item Description
        hsn_code:
          type: string
          description: HSN Code
          example: '1234'
        item_type:
          type: string
          description: Product or Service enum
          example: Product
          enum:
            - Product
            - Service
        unit:
          type: string
          description: >-
            Item quantity unit. You can find the GST-approved units in the UQC
            Codes section at: https://einvoice1.gst.gov.in/Others/MasterCodes.
          example: kg
        cess_rate:
          type: number
          description: Cess Percent of the Item
          default: 0
          example: 0
          maximum: 100
        cess_amount:
          type: number
          description: Cess Amount of the Item
          default: 0
          example: 0
        barcode:
          type: string
          description: Barcode
          example: '2273546838467'
        category:
          type: string
          description: Category
          example: Electronics
        custom_columns:
          type: array
          description: Custom Fields
          example:
            - label: Custom Label
              value: Custom Value
          items:
            $ref: '#/components/schemas/ProductCustomFieldsV2'
        alternative_units:
          type: array
          description: Alternative Units
          example:
            - alternative_unit: g
              conversion_rate: 1000
          items:
            $ref: '#/components/schemas/AlternativeUnitsV2'
        preferences:
          type: object
          description: Product Preferences
          allOf:
            - $ref: '#/components/schemas/ProductPreferencesV2'
        visibility:
          type: integer
          description: >-
            If set to 1, the product will be visible to all branches. If set to
            0, the product will be visible only to the branch it was created in.
          example: 1
    ProductResponseV2:
      type: object
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Response message
          example: Message
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          properties: {}
          description: Errors
        data:
          $ref: '#/components/schemas/EmptyData'
    ProductCustomFieldsV2:
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
      type: object
    AlternativeUnitsV2:
      type: object
      properties:
        alternative_unit:
          type: string
          description: Alternative Unit
          example: kg
          enum:
            - LAD
            - PET
            - JARS
            - HEGAR
            - POCH
            - BOR
            - COIL
            - FT
            - IN
            - PRT
            - CASE
            - EACH
            - CPS
            - PADS
            - REEL
            - BLISTER
            - PAD
            - PCS
            - PRS
            - QTL
            - ROL
            - SET
            - SQF
            - SQM
            - SQY
            - TBS
            - TGM
            - THD
            - TON
            - TUB
            - UGS
            - UNT
            - YDS
            - OTH
            - HRS
            - MINS
            - LTR
            - MTS
            - MLG
            - BCK
            - GLS
            - PLT
            - CTS
            - STRP
            - CFT
            - VIAL
            - BAG
            - BAL
            - BDL
            - BKL
            - BOU
            - BOX
            - BTL
            - BUN
            - CAN
            - CBM
            - CCM
            - CMS
            - CTN
            - DOZ
            - DRM
            - GGR
            - GMS
            - GRS
            - GYD
            - KGS
            - KLR
            - KME
            - MLT
            - MTR
            - NOS
            - PAC
            - CNT
            - RFT
            - RIM
            - TIN
            - CHUDI
            - PATTA
            - KIT
            - CUFT
            - RMT
            - MM
            - AMP
            - PAIR
            - ANA
            - CFM
            - YRS
            - MTH
            - MAN-DAY
            - NIGHT
            - DAY
            - SQIN
            - WEEK
            - PERSON
            - LOT
            - SAC
            - REAM
            - BRASS
            - NONE
            - COPY
            - TKT
            - KW
            - W
            - SEC
            - BARREL
            - SHEETS
            - HOLES
            - LINES
            - LGTH
            - TRIP
            - LPSM
            - WDTH
            - SQCM
            - SHFT
            - AU
            - SQKM
            - JOBS
            - CUIN
            - IDIA
            - INMT
            - AC
            - HA
            - BARS
            - PKTS
        conversion_rate:
          type: number
          description: Conversion Rate
          example: 1
    ProductPreferencesV2:
      properties:
        not_for_sale:
          type: boolean
          description: >-
            Hides the item for sale and shows only while making a purchase. eg.
            Office equipment
          example: false
        low_stock_alert:
          type: integer
          description: Low stock alert for the item
          example: 0
        show_online:
          type: boolean
          description: Show or hide the product in catalogue/ online store
          example: false
        discount_percent:
          type: number
          description: Default Discount Percent
          default: 0
          example: 10
      type: object
    EmptyData:
      type: object
      properties:
        message:
          type: string
          description: Response message
          example: No data found!
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````