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

> **v1 is deprecated — use the v2 endpoint instead.** 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`.



## OpenAPI

````yaml post /v1/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:
  /v1/product:
    post:
      tags:
        - Product
      summary: Add an item
      description: >-
        **v1 is deprecated — use the v2 endpoint instead.** 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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemV1'
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '400':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductError'
components:
  schemas:
    ItemV1:
      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
        discount_percent:
          type: number
          description: Default Discount Percent
          default: 0
          example: 10
        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
        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
        category:
          type: string
          description: Category
          example: Electronics
        status:
          type: string
          description: Status of the Item
          example: Active
      type: object
    ProductResponse:
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Response message
          example: Product added successfully
      type: object
    ProductError:
      properties:
        success:
          type: boolean
          description: Success flag
          example: false
        error_code:
          type: string
          description: Error Code
          example: INVALID_PRODUCT_ID
        message:
          type: string
          description: Response message
          example: Error Message
        errors:
          type: object
          description: Validation errors
          example: List of errors
      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.

````

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