> ## 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.

# Add an item

> Creates an item in your catalog keyed by your own `id`. Sending an ID that already exists fails with `PRODUCT_ALREADY_EXISTS` — use Update an item to change the catalog record. Items are also created automatically when a document references an unknown item `id`.

<Note>
  **Uploading Product Images**

  To upload 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 post /v2/product
openapi: 3.0.1
info:
  title: SwipeAPI
  version: '2.0'
  description: >-
    The Swipe Partner API — invoicing, payments, and GST compliance for your
    application. Create GST invoices and other documents, manage customers,
    vendors, products and inventory, record payments, and generate e-invoices
    and e-way bills.


    - Docs & guides: https://developers.getswipe.in

    - Quickstart: https://developers.getswipe.in/quickstart

    - Rate limit: 1 request/second per API key

    - All dates are DD-MM-YYYY
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
paths:
  /v2/product:
    post:
      tags:
        - Product V2
      summary: Add an item
      description: >-
        Creates an item in your catalog keyed by your own `id`. Sending an ID
        that already exists fails with `PRODUCT_ALREADY_EXISTS` — use Update an
        item to change the catalog record. Items are also created automatically
        when a document references an unknown item `id`.
      operationId: post_product
      parameters:
        - name: id
          in: query
          description: Unique id for each item
          required: true
          schema:
            type: string
        - name: name
          in: query
          description: Name of the Product
          required: true
          schema:
            type: string
        - name: quantity
          in: query
          description: Opening Quantity
          required: true
          schema:
            type: number
        - name: unit_price
          in: query
          description: Price per item without Tax
          required: true
          schema:
            type: number
        - name: tax_rate
          in: query
          description: Tax percentage for each item
          schema:
            type: number
        - name: price_with_tax
          in: query
          description: Price per item with Tax
          required: true
          schema:
            type: number
        - name: purchase_price_with_tax
          in: query
          description: Purchase Price per item with Tax
          schema:
            type: number
        - name: description
          in: query
          description: Item Description
          schema:
            type: string
        - name: hsn_code
          in: query
          description: HSN Code
          schema:
            type: string
        - name: item_type
          in: query
          description: Product or Service enum
          required: true
          schema:
            type: string
        - name: unit
          in: query
          description: Item quantity unit
          schema:
            type: string
        - name: cess_rate
          in: query
          description: Cess Percent of the Item
          schema:
            type: number
        - name: cess_amount
          in: query
          description: Cess Amount of the Item
          schema:
            type: number
        - name: barcode
          in: query
          description: Barcode
          schema:
            type: string
        - name: category
          in: query
          description: Category
          schema:
            type: string
        - name: alternative_units
          in: query
          description: JSON string of alternative units
          schema:
            type: string
        - name: custom_columns
          in: query
          description: JSON string of custom fields
          schema:
            type: string
        - name: preferences
          in: query
          description: JSON string of product preferences
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                product_images:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Product images (multiple files supported)
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetProductResponseV2'
        '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:
    GetProductResponseV2:
      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
          description: Errors
        data:
          $ref: '#/components/schemas/Item'
      type: object
    ProductResponseV2:
      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
          description: Errors
        data:
          $ref: '#/components/schemas/EmptyData'
      type: object
    Item:
      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
        alternative_units:
          type: array
          description: Alternative Units
          example:
            - alternative_unit: g
              conversion_rate: 1000
          items:
            $ref: '#/components/schemas/AlternativeUnitsV2'
        custom_columns:
          type: array
          description: Custom Fields
          example:
            - label: Custom Label
              value: Custom Value
          items:
            $ref: '#/components/schemas/ProductCustomFieldsV2'
        preferences:
          description: Product Preferences
          example:
            not_for_sale: false
            low_stock_alert: 0
            show_online: false
            discount_percent: 10
          allOf:
            - $ref: '#/components/schemas/ProductPreferencesV2'
        visibility:
          type: integer
          description: >-
            Product visibility status: If the value is 1, the product will be
            visible to all branches; otherwise, it will only be visible in the
            main branch.
          example: 1
      type: object
    EmptyData:
      properties:
        message:
          type: string
          description: Response message
          example: No data found!
      type: object
    AlternativeUnitsV2:
      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
      type: object
    ProductCustomFieldsV2:
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
      type: object
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is an API key from the [API
        Integration](https://app.getswipe.in/user?tab=api_integration) section
        of your dashboard. Keys are scoped to the company they are generated in
        — for testing, [add a separate test
        company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191)
        and generate the key there, so requests never touch your real books.

````