openapi: 3.0.0
info:
  title: Stock Counts
  description: Stock Counts enable you to physically verify the actual quantity of items available in your inventory and compare them with the quantities recorded in the system. By identifying and reconciling any differences, you can maintain accurate stock levels, improve inventory control, and prevent issues such as stock discrepancies, shrinkage, or mismanagement. Regular stock counts ensure your inventory data stays reliable and up to date.
  contact: {}
  version: 1.0.0
servers:
  - url: https://www.zohoapis.com/inventory/v1
    description: API Endpoint
tags:
  - name: inventorycounting
    description: Stock Counts Module
  - name: recurringinventorycounting
    description: Recurring Stock Counts Module
  - name: inventorycounting-settings
    description: Stock Counts Settings and Preferences
paths:
  /inventorycounts:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - inventorycounting
      operationId: list_inventory_counts
      summary: List all stock counts
      description: Returns a paginated list of all stock counts in the organization. Supports filtering by status or assignee, searching by count number or description, and sorting by various columns. Default sort is by <code>created_time</code> descending.
      parameters:
        - name: filter_by
          in: query
          description: 'Filter counts by status or assignee. Allowed values: <code>Status.All</code> (default, all counts), <code>Assignee.Self</code> (counts assigned to the current user).'
          required: false
          schema:
            type: string
            enum:
              - Status.All
              - Assignee.Self
            default: Status.All
          example: Status.All
        - name: status
          in: query
          description: 'Filter counts by a specific status value. Allowed values: <code>yet_to_start</code>, <code>counting</code>, <code>submitted</code>, <code>processing</code>, <code>completed</code>, <code>cancelled</code>, <code>expired</code>, <code>approval_in_progress</code>, <code>start_in_progress</code>, <code>submission_in_progress</code>.'
          required: false
          schema:
            type: string
            enum:
              - yet_to_start
              - counting
              - submitted
              - processing
              - completed
              - cancelled
              - expired
              - approval_in_progress
              - start_in_progress
              - submission_in_progress
          example: yet_to_start
        - name: search_text
          in: query
          description: Search text to filter counts by stock count number or description.
          required: false
          schema:
            type: string
          example: IC-00001
        - name: inventorycount_number
          in: query
          description: Filter by an exact or partial stock count number.
          required: false
          schema:
            type: string
          example: IC-0001
        - name: description
          in: query
          description: Filter by count description (notes).
          required: false
          schema:
            type: string
          example: monthly
        - name: assignee_id
          in: query
          description: Filter counts assigned to a specific user ID.
          required: false
          schema:
            type: string
          example: '4815000000012345'
        - name: assignee_ids
          in: query
          description: Comma-separated list of assignee user IDs to filter by.
          required: false
          schema:
            type: string
          example: 4815000000012345,4815000000012346
        - name: created_by
          in: query
          description: Filter counts created by a specific user ID.
          required: false
          schema:
            type: string
          example: '4815000000012300'
        - name: warehouse_ids
          in: query
          description: Comma-separated list of warehouse IDs to filter counts by.
          required: false
          schema:
            type: string
          example: 4815000000038080,4815000000038081
        - name: location_ids
          in: query
          description: Comma-separated list of location IDs to filter counts by. Use when locations are enabled.
          required: false
          schema:
            type: string
          example: 4815000000038080,4815000000038082
        - name: count_date
          in: query
          description: Filter counts by scheduled count date in YYYY-MM-DD format.
          required: false
          schema:
            type: string
          example: '2025-06-15'
        - name: recurring_inventorycount_id
          in: query
          description: Filter counts that were generated by a specific recurring stock count profile.
          required: false
          schema:
            type: string
          example: '4815000000055200'
        - name: sort_column
          in: query
          description: 'Column to sort results by. Allowed values: <code>created_time</code>, <code>count_date</code>, <code>inventorycount_number</code>, <code>last_modified_time</code>. Default is <code>created_time</code>.'
          required: false
          schema:
            type: string
            enum:
              - created_time
              - count_date
              - inventorycount_number
              - last_modified_time
            default: created_time
          example: created_time
        - name: sort_order
          in: query
          description: Sort direction. <code>A</code> for ascending, <code>D</code> for descending. Default is <code>D</code>.
          required: false
          schema:
            type: string
            enum:
              - A
              - D
            default: D
          example: D
        - name: page
          in: query
          description: Page number to fetch. Default is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page. Default is 200.
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-inventory-counts-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    post:
      tags:
        - inventorycounting
      operationId: create_inventory_count
      summary: Create a stock count
      description: Creates a new stock count (stock take) in Zoho Inventory. The count starts in <code>yet_to_start</code> status. You must specify the warehouse/location and the line items (products) to count. Duplicate products in line items are not allowed. A maximum of 1000 line items per count (5000 if extended limit is enabled).
      parameters:
        - name: ignore_auto_number_generation
          in: query
          description: When <code>true</code>, the auto-numbering sequence is not used and the <code>inventorycount_number</code> value from the request body is used as-is. Default is <code>false</code>.
          required: false
          schema:
            type: boolean
            default: false
          example: false
        - name: importfile
          in: query
          description: 'File containing line items to import. Allowed formats: <code>csv</code>, <code>xls</code>, <code>tsv</code>, <code>xlsx</code>. Max size 10 MB.'
          required: false
          schema:
            type: string
            format: binary
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-inventory-count-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.CREATE
    delete:
      tags:
        - inventorycounting
      operationId: bulk_delete_inventory_counts
      summary: Bulk delete stock counts
      description: Deletes multiple stock counts in a single request. Counts with associated inventory adjustments cannot be deleted.
      parameters:
        - name: inventorycount_ids
          in: query
          description: Comma-separated list of stock count IDs to delete.
          required: true
          schema:
            type: string
          example: 4815000000044100,4815000000044101
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                    readOnly: true
                  message:
                    type: string
                    example: Stock counts have been deleted.
                    readOnly: true
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.DELETE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /inventorycounts/{inventorycount_id}:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - inventorycounting
      operationId: get_inventory_count
      summary: Retrieve a stock count
      description: Fetches the complete details of an existing stock count including its header information, line items, status, assignee details, and any associated inventory adjustments.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    put:
      tags:
        - inventorycounting
      operationId: update_inventory_count
      summary: Update a stock count
      description: Updates the details of an existing stock count that is in <code>yet_to_start</code> status. You can update the assignee, notes, and line items. Warehouse/location cannot be changed once child counts exist.
      parameters:
        - name: ignore_auto_number_generation
          in: query
          description: When <code>true</code>, the auto-numbering sequence is not used and the <code>inventorycount_number</code> value from the request body is used as-is.
          required: false
          schema:
            type: boolean
            default: false
          example: false
        - name: is_overwrite
          in: query
          description: When <code>true</code>, the existing line items are completely replaced with the line items provided in the request body. When <code>false</code>, the provided line items are merged with existing ones. Applicable only when importfile are included in the request.
          required: false
          schema:
            type: boolean
            default: false
          example: false
        - name: importfile
          in: query
          description: 'File containing line items to import. Allowed formats: <code>csv</code>, <code>xls</code>, <code>tsv</code>, <code>xlsx</code>. Max size 10 MB.'
          required: false
          schema:
            type: string
            format: binary
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-inventory-count-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    delete:
      tags:
        - inventorycounting
      operationId: delete_inventory_count
      summary: Delete a stock count
      description: Deletes an existing stock count. Counts with associated inventory adjustments cannot be deleted.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.DELETE
    parameters:
      - name: inventorycount_id
        in: path
        required: true
        description: Unique identifier of the stock count.
        schema:
          type: string
        example: '4815000000044100'
      - $ref: '#/components/parameters/organization_id'
  /inventorycounts/{inventorycount_id}/start:
    x-mcp-group:
      - Stock Counts
    post:
      tags:
        - inventorycounting
      operationId: start_inventory_count
      summary: Start a stock count
      description: Initiates the counting process for a stock count that is in <code>yet_to_start</code> status. This captures the system quantities for each line item at the time of start and moves the count to <code>counting</code> status. Only the assigned user can start the count. If start is scheduled in background, the response message indicates it is in progress.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - name: inventorycount_id
        in: path
        required: true
        description: Unique identifier of the stock count.
        schema:
          type: string
        example: '4815000000044100'
      - $ref: '#/components/parameters/organization_id'
  /inventorycounts/{inventorycount_id}/count:
    x-mcp-group:
      - Stock Counts
    put:
      tags:
        - inventorycounting
      operationId: update_counted_quantities
      summary: Update counted quantities
      description: 'Records or updates the physical counted quantities for line items in a count that is in <code>counting</code> status. Only the assigned user can enter counted quantities. Pass <code>next_action: "submit"</code> to automatically submit the count after recording quantities. If <code>next_action</code> is <code>submit</code> and no line items are provided, only the submission is triggered. Counted quantity can be set to <code>null</code> to mark a line item as uncounted.'
      parameters:
        - name: set_uncounted_as_zero
          in: query
          description: When true, uncounted line items are treated as having a counted quantity of zero. Passed only when next_action=<code>submit</code>.
          required: false
          schema:
            type: boolean
            default: false
          example: false
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-counted-quantities-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - name: inventorycount_id
        in: path
        required: true
        description: Unique identifier of the stock count.
        schema:
          type: string
        example: '4815000000044100'
      - $ref: '#/components/parameters/organization_id'
  /inventorycounts/{inventorycount_id}/submit:
    x-mcp-group:
      - Stock Counts
    post:
      tags:
        - inventorycounting
      operationId: submit_inventory_count
      summary: Submit a stock count for approval
      description: Submits a count that is in <code>counting</code> status for review and approval. Moves the count to <code>submitted</code> (pending approval) status. Pass <code>set_uncounted_as_zero=true</code> as a query parameter to treat any uncounted items as having a counted quantity of zero before submission. If submission is scheduled in background, the response message indicates it is in progress.
      parameters:
        - name: set_uncounted_as_zero
          in: query
          description: When true, uncounted line items are treated as having a counted quantity of zero before submission.
          required: false
          schema:
            type: boolean
            default: false
          example: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - name: inventorycount_id
        in: path
        required: true
        description: Unique identifier of the stock count.
        schema:
          type: string
        example: '4815000000044100'
      - $ref: '#/components/parameters/organization_id'
  /inventorycounts/{inventorycount_id}/approve:
    x-mcp-group:
      - Stock Counts
    put:
      tags:
        - inventorycounting
      operationId: approve_inventory_count
      summary: Approve or reject line items in a stock count
      description: Approves or rejects individual line items in a count that is in <code>submitted</code> (pending approval) status. Each line item must specify an <code>item_id</code> and an <code>approval_status</code> of either <code>approved</code> or <code>rejected</code>. Approved items with quantity differences trigger inventory adjustments. Rejected items can be recounted. If approval is scheduled in background, the response message indicates it is in progress.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/approve-inventory-count-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - name: inventorycount_id
        in: path
        required: true
        description: Unique identifier of the stock count.
        schema:
          type: string
        example: '4815000000044100'
      - $ref: '#/components/parameters/organization_id'
  /inventorycounts/{inventorycount_id}/cancel:
    x-mcp-group:
      - Stock Counts
    post:
      tags:
        - inventorycounting
      operationId: cancel_inventory_count
      summary: Cancel a stock count
      description: Cancels a stock count that is in <code>yet_to_start</code> or <code>counting</code> status. Cancelled counts cannot be restarted.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                    readOnly: true
                  message:
                    type: string
                    example: Stock count has been cancelled.
                    readOnly: true
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - name: inventorycount_id
        in: path
        required: true
        description: Unique identifier of the stock count.
        schema:
          type: string
        example: '4815000000044100'
      - $ref: '#/components/parameters/organization_id'
  /recurringinventorycounts:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - recurringinventorycounting
      operationId: list_recurring_inventory_counts
      summary: List all recurring stock count profiles
      description: Returns a paginated list of all recurring stock count profiles in the organization. Supports filtering by status, schedule frequency, assignee, warehouse/location, and date ranges.
      parameters:
        - name: filter_by
          in: query
          description: 'Filter profiles by status or assignee. Allowed values: <code>Status.All</code> (default), <code>Assignee.Self</code>.'
          required: false
          schema:
            type: string
            enum:
              - Status.All
              - Assignee.Self
            default: Status.All
          example: Status.All
        - name: status
          in: query
          description: 'Filter by profile status. Allowed values: <code>active</code>, <code>inactive</code>, <code>expired</code>.'
          required: false
          schema:
            type: string
            enum:
              - active
              - inactive
              - expired
          example: active
        - name: search_text
          in: query
          description: Search term to filter profiles by title or description.
          required: false
          schema:
            type: string
          example: Monthly
        - name: assignee_id
          in: query
          description: Filter profiles assigned to a specific user ID.
          required: false
          schema:
            type: string
          example: '4815000000012345'
        - name: assignee_ids
          in: query
          description: Comma-separated list of assignee user IDs to filter by.
          required: false
          schema:
            type: string
          example: 4815000000012345,4815000000012346
        - name: created_by
          in: query
          description: Filter profiles created by a specific user ID.
          required: false
          schema:
            type: string
          example: '4815000000012300'
        - name: frequency
          in: query
          description: 'Filter by recurrence frequency. Allowed values: <code>days</code>, <code>weeks</code>, <code>months</code>, <code>years</code>, <code>manual</code>.'
          required: false
          schema:
            type: string
            enum:
              - days
              - weeks
              - months
              - years
              - manual
          example: months
        - name: start_date
          in: query
          description: Filter profiles whose recurrence start date matches this value (YYYY-MM-DD).
          required: false
          schema:
            type: string
          example: '2025-07-01'
        - name: end_date
          in: query
          description: Filter profiles whose recurrence end date matches this value (YYYY-MM-DD).
          required: false
          schema:
            type: string
          example: '2026-06-30'
        - name: warehouse_id
          in: query
          description: Filter profiles by a specific warehouse ID.
          required: false
          schema:
            type: string
          example: '4815000000038080'
        - name: next_count_date
          in: query
          description: Filter profiles by their next scheduled count date (YYYY-MM-DD).
          required: false
          schema:
            type: string
          example: '2025-08-01'
        - name: warehouse_ids
          in: query
          description: Comma-separated list of warehouse IDs to filter by.
          required: false
          schema:
            type: string
          example: 4815000000038080,4815000000038081
        - name: location_ids
          in: query
          description: Comma-separated list of location IDs to filter by.
          required: false
          schema:
            type: string
          example: 4815000000038080,4815000000038082
        - name: sort_column
          in: query
          description: 'Column to sort results by. Allowed values: <code>created_time</code>, <code>title</code>, <code>next_count_date</code>, <code>last_modified_time</code>. Default is <code>created_time</code>.'
          required: false
          schema:
            type: string
            enum:
              - created_time
              - title
              - next_count_date
              - last_modified_time
            default: created_time
          example: created_time
        - name: sort_order
          in: query
          description: Sort direction. <code>A</code> for ascending, <code>D</code> for descending. Default is <code>D</code>.
          required: false
          schema:
            type: string
            enum:
              - A
              - D
            default: D
          example: D
        - name: page
          in: query
          description: Page number. Default is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page. Default is 200.
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                    readOnly: true
                  message:
                    type: string
                    example: success
                    readOnly: true
                  recurringinventorycounts:
                    type: array
                    description: List of recurring stock count profiles.
                    items:
                      $ref: '#/components/schemas/recurringinventorycount-object'
                  page_context:
                    $ref: '#/components/schemas/page_context'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    post:
      tags:
        - recurringinventorycounting
      operationId: create_recurring_inventory_count
      summary: Create a recurring stock count profile
      description: 'Creates a recurring stock count profile that automatically generates stock counts on a schedule. Two schedule types are supported: <code>auto</code> (system-generated schedule based on recurrence frequency) and <code>manual</code> (user-specified count dates). For <code>auto</code> schedules, provide <code>start_date</code>, <code>recurrence_frequency</code>, <code>repeat_every</code>, and optionally <code>end_date</code> or <code>no_of_cycles</code>. For <code>manual</code> schedules, provide <code>count_dates</code>. Maximum 1000 line items (5000 if extended limit is enabled).'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-recurring-inventory-count-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/recurring-inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
      - name: importfile
        in: query
        description: 'File containing line items to import. Allowed formats: <code>csv</code>, <code>xls</code>, <code>tsv</code>, <code>xlsx</code>. Max size 10 MB.'
        required: false
        schema:
          type: string
          format: binary
  /recurringinventorycounts/{recurringinventorycount_id}/active:
    x-mcp-group:
      - Stock Counts
    post:
      tags:
        - recurringinventorycounting
      operationId: activate_recurring_inventory_count
      summary: Mark a recurring stock count profile as active
      description: Changes the status of a recurring stock count profile to <code>active</code>. Active profiles will continue generating counts on schedule.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                    readOnly: true
                  message:
                    type: string
                    example: Recurring stock count status has been changed.
                    readOnly: true
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - name: recurringinventorycount_id
        in: path
        required: true
        description: Unique identifier of the recurring stock count profile.
        schema:
          type: string
        example: '4815000000055200'
      - $ref: '#/components/parameters/organization_id'
  /recurringinventorycounts/{recurringinventorycount_id}/inactive:
    x-mcp-group:
      - Stock Counts
    post:
      tags:
        - recurringinventorycounting
      operationId: deactivate_recurring_inventory_count
      summary: Mark a recurring stock count profile as inactive
      description: Changes the status of a recurring stock count profile to <code>inactive</code>. Inactive profiles will not generate new counts until reactivated.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                    readOnly: true
                  message:
                    type: string
                    example: Recurring stock count status has been changed.
                    readOnly: true
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - name: recurringinventorycount_id
        in: path
        required: true
        description: Unique identifier of the recurring stock count profile.
        schema:
          type: string
        example: '4815000000055200'
      - $ref: '#/components/parameters/organization_id'
  /recurringinventorycounts/{recurringinventorycount_id}:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - recurringinventorycounting
      operationId: get_recurring_inventory_count
      summary: Retrieve a recurring stock count profile
      description: Fetches the details of an existing recurring stock count profile including its schedule configuration, line items, and status.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-recurring-inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    put:
      tags:
        - recurringinventorycounting
      operationId: update_recurring_inventory_count
      summary: Update a recurring stock count profile
      description: Updates an existing recurring stock count profile. For <code>auto</code> schedules, <code>start_date</code> cannot be changed once the profile has executed at least once. The next count date cannot be set to today if an active count already exists for this profile.
      parameters:
        - name: is_overwrite
          in: query
          description: When <code>true</code>, the existing line items are completely replaced with the line items provided in the request body. When <code>false</code>, the provided line items are merged with existing ones. Applicable only when importfile are included in the request.
          required: false
          schema:
            type: boolean
            default: false
          example: false
        - name: importfile
          in: query
          description: 'File containing line items to import. Allowed formats: <code>csv</code>, <code>xls</code>, <code>tsv</code>, <code>xlsx</code>. Max size 10 MB.'
          required: false
          schema:
            type: string
            format: binary
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-recurring-inventory-count-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/recurring-inventory-count-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    delete:
      tags:
        - recurringinventorycounting
      operationId: delete_recurring_inventory_count
      summary: Delete a recurring stock count profile
      description: Permanently deletes an existing recurring stock count profile. Stock counts already generated by this profile are not affected.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                    readOnly: true
                  message:
                    type: string
                    example: Recurring stock count profile has been deleted.
                    readOnly: true
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.DELETE
    parameters:
      - name: recurringinventorycount_id
        in: path
        required: true
        description: Unique identifier of the recurring stock count profile.
        schema:
          type: string
        example: '4815000000055200'
      - $ref: '#/components/parameters/organization_id'
  /inventorycountitems/{inventorycount_item_id}/trackingdetails:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - inventorycounting
      operationId: list_inventory_count_item_tracking_details
      summary: List serial/batch tracking details for a count line item
      description: Returns a paginated list of serial number or batch tracking entries for a specific stock count line item. Use <code>filter_by</code> to show all, missing, or newly-added tracking entries relative to the system records.
      parameters:
        - name: filter_by
          in: query
          description: 'Filter tracking entries by status. Allowed values: <code>Status.All</code> (default, all entries), <code>Status.Missing</code> (serial/batch numbers present in the system but not counted), <code>Status.NewlyAdded</code> (serial/batch numbers counted but not present in the system).'
          required: false
          schema:
            type: string
            enum:
              - Status.All
              - Status.Missing
              - Status.NewlyAdded
            default: Status.All
          example: Status.All
        - name: search_text
          in: query
          description: Search term to filter tracking entries by serial number or batch number.
          required: false
          schema:
            type: string
          example: SN-001
        - name: page
          in: query
          description: Page number. Default is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page. Default is 1000.
          required: false
          schema:
            type: integer
            default: 1000
          example: 1000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                    readOnly: true
                  message:
                    type: string
                    example: success
                    readOnly: true
                  serial_numbers:
                    type: array
                    description: List of serial number tracking entries for this line item. Populated only for serial-tracked items.
                    items:
                      type: object
                      properties:
                        serialnumber:
                          description: Serial number of the tracked entry.
                          type: string
                          example: SN-00123
                        found:
                          description: Whether this serial number was physically counted (true) or missing (false).
                          type: boolean
                          example: true
                        is_new:
                          description: Whether this serial number was newly counted but not present in the system records.
                          type: boolean
                          example: false
                  batches:
                    type: array
                    description: List of batch tracking entries for this line item. Populated only for batch-tracked items.
                    items:
                      type: object
                      properties:
                        batch_number:
                          description: Batch number of the tracked entry.
                          type: string
                          example: BATCH-2025-06
                        counted_quantity:
                          description: Quantity counted for this batch.
                          type: number
                          format: double
                          example: 10
                        system_quantity:
                          description: System quantity for this batch.
                          type: number
                          format: double
                          example: 12
                        stock_variance:
                          description: Difference between counted and system quantity for this batch.
                          type: number
                          format: double
                          example: -2
                        is_new:
                          description: Whether this batch was newly counted but not present in the system records.
                          type: boolean
                          example: false
                  page_context:
                    $ref: '#/components/schemas/page_context'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    parameters:
      - name: inventorycount_item_id
        in: path
        required: true
        description: Unique identifier of the stock count line item.
        schema:
          type: string
        example: '4815000000044897'
      - $ref: '#/components/parameters/organization_id'
  /inventorycounts/{inventorycount_id}/items/{item_id}/storages:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - inventorycounting
      operationId: list_inventory_count_item_storages
      summary: List storage details for a count item
      description: Retrieves all storage location (bin) details for a specific product (item) that has been added to a stock count. This is used for items that are tracked by storage/bin location. Returns basic storage info when the count is in <code>yet_to_start</code> status; returns system quantities, counted quantities, variances, and serial/batch tracking details once counting has started.
      parameters:
        - name: page
          in: query
          description: Page number to be fetched. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page. Default value is 1000.
          required: false
          schema:
            type: integer
            default: 1000
          example: 1000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-item-storages-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    parameters:
      - name: inventorycount_id
        in: path
        required: true
        description: Unique identifier of the stock count.
        schema:
          type: string
        example: '4815000000044100'
      - name: item_id
        in: path
        required: true
        description: Unique identifier of the product (item) whose storage bin details are to be retrieved.
        schema:
          type: string
        example: '4815000000033001'
      - $ref: '#/components/parameters/organization_id'
  /autocomplete/inventorycounts/items:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - inventorycounting
      operationId: autocomplete_inventory_count_items
      summary: Search items in in-progress stock counts
      description: Returns a list of stock count line items from in-progress counts, suitable for autocomplete/search UI. Supports filtering by item ID, storage location, warehouse, category, manufacturer, and item type (bin-tracked vs non-bin-tracked). Use the <code>filter_by</code> parameter to filter by item status (e.g., <code>Items.Uncounted</code>) or type (e.g., <code>ItemType.BinTracked</code>, <code>ItemType.NonBinTracked</code>). Use the <code>group_by</code> parameter to group results.
      parameters:
        - name: inventorycount_id
          in: query
          description: Filter results to a specific stock count.
          required: false
          schema:
            type: string
          example: '4815000000044100'
        - name: item_id
          in: query
          description: Filter results to a specific item (product).
          required: false
          schema:
            type: string
          example: '4815000000033001'
        - name: storage_location_id
          in: query
          description: Filter results to a specific storage location (bin).
          required: false
          schema:
            type: string
          example: '4815000000050010'
        - name: location_id
          in: query
          description: Filter results by location ID.
          required: false
          schema:
            type: string
          example: '4815000000038080'
        - name: warehouse_id
          in: query
          description: Filter results by a specific warehouse ID.
          required: false
          schema:
            type: string
          example: '4815000000038080'
        - name: category_ids
          in: query
          description: Comma-separated list of category IDs to filter items.
          required: false
          schema:
            type: string
          example: 4815000000011001,4815000000011002
        - name: manufacturer_ids
          in: query
          description: Comma-separated list of manufacturer IDs to filter items.
          required: false
          schema:
            type: string
          example: '4815000000022001'
        - name: brand_ids
          in: query
          description: Comma-separated list of brand IDs to filter items.
          required: false
          schema:
            type: string
          example: 4815000000023001,4815000000023002
        - name: filter_by
          in: query
          description: 'Filter items by status or type. Allowed values: <code>Items.Uncounted</code> (only uncounted items), <code>ItemType.BinTracked</code> (only bin/storage-tracked items), <code>ItemType.NonBinTracked</code> (only non-bin-tracked items).'
          required: false
          schema:
            type: string
            enum:
              - Items.Uncounted
              - ItemType.BinTracked
              - ItemType.NonBinTracked
          example: Items.Uncounted
        - name: group_by
          in: query
          description: Groups the results by the specified field (e.g., <code>item_id</code>).
          required: false
          schema:
            type: string
          example: item_id
        - name: search_text
          in: query
          description: Search term to filter items by name or SKU.
          required: false
          schema:
            type: string
          example: Laptop
        - name: page
          in: query
          description: Page number. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page. Default value is 200.
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/autocomplete-items-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /autocomplete/inventorycounts/storages:
    x-mcp-group:
      - Stock Counts
    get:
      tags:
        - inventorycounting
      operationId: autocomplete_inventory_count_storages
      summary: Search storage locations in in-progress stock counts
      description: Returns a list of storage locations (bins) from in-progress stock counts, suitable for autocomplete/search UI. Supports filtering by storage location, warehouse/location, item ID, and counted status. Use <code>filter_by=Storages.Uncounted</code> to return only storage locations that have uncounted items.
      parameters:
        - name: inventorycount_id
          in: query
          description: Filter results to a specific stock count.
          required: false
          schema:
            type: string
          example: '4815000000044100'
        - name: storage_location_id
          in: query
          description: Filter by a specific storage location.
          required: false
          schema:
            type: string
          example: '4815000000050010'
        - name: location_id
          in: query
          description: Filter by location ID.
          required: false
          schema:
            type: string
          example: '4815000000038080'
        - name: warehouse_id
          in: query
          description: Filter by a specific warehouse ID.
          required: false
          schema:
            type: string
          example: '4815000000038080'
        - name: item_id
          in: query
          description: Filter storage locations that contain a specific item.
          required: false
          schema:
            type: string
          example: '4815000000033001'
        - name: filter_by
          in: query
          description: 'Filter by storage status. Allowed value: <code>Storages.Uncounted</code> to return only storage locations with uncounted items.'
          required: false
          schema:
            type: string
            enum:
              - Storages.Uncounted
          example: Storages.Uncounted
        - name: search_text
          in: query
          description: Search term to filter storage locations by name.
          required: false
          schema:
            type: string
          example: Rack A
        - name: page
          in: query
          description: Page number. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page. Default value is 200.
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/autocomplete-storages-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /settings/inventorycounts:
    x-mcp-group:
      - Stock Counts
    put:
      tags:
        - inventorycounting-settings
      operationId: update_inventory_count_settings
      summary: Update stock count auto-numbering settings
      description: Updates the auto-numbering configuration for stock counts, such as the prefix string and the next number in the sequence.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/inventory-count-settings-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-count-settings-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /settings/preferences/inventorycounts:
    x-mcp-group:
      - Stock Counts
    put:
      tags:
        - inventorycounting-settings
      operationId: update_inventory_counting_preferences
      summary: Update stock counts preferences
      description: Updates global preferences for the stock counts feature, including the default adjustment reason and the default adjustment account used when creating inventory adjustments from count discrepancies.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/inventory-counting-preferences-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventory-counting-preferences-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoInventory.inventorycount.UPDATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
components:
  parameters:
    organization_id:
      name: organization_id
      description: ID of the organization
      in: query
      required: true
      schema:
        type: string
      example: '10234695'
  schemas:
    inventorycount_id:
      description: Unique ID generated by the server for the stock count.
      type: string
      example: '4815000000044100'
    inventorycount_number:
      description: Auto-generated number for the stock count (e.g., IC-00001).
      type: string
      example: IC-00001
    count_date:
      description: The scheduled date for the stock count in YYYY-MM-DD format.
      type: string
      example: '2025-06-15'
    description:
      description: Additional notes or remarks for the stock count.
      type: string
      example: Monthly stock take for warehouse A.
    location_id:
      description: Unique ID of the warehouse or location being counted.
      type: string
      example: '4815000000038080'
    location_name:
      description: Name of the warehouse or location being counted.
      type: string
      example: Main Warehouse
    assignee_id:
      description: Unique ID of the user assigned to perform the count.
      type: string
      example: '4815000000012345'
    assignee_name:
      description: Name of the user assigned to perform the count.
      type: string
      example: John Smith
    status:
      description: 'Current status of the stock count. Possible values: <code>yet_to_start</code>, <code>counting</code>, <code>submitted</code>, <code>processing</code>, <code>completed</code>, <code>cancelled</code>, <code>expired</code>, <code>approval_in_progress</code>, <code>start_in_progress</code>, <code>submission_in_progress</code>.'
      type: string
      enum:
        - yet_to_start
        - counting
        - submitted
        - processing
        - completed
        - cancelled
        - expired
        - approval_in_progress
        - start_in_progress
        - submission_in_progress
      example: yet_to_start
    count_type:
      description: Type of the stock count. <code>count</code> for a general count and <code>recount</code> for a recount of previously rejected items.
      type: string
      enum:
        - count
        - recount
      example: count
    item_id:
      description: Unique ID of the product (item) in the line item.
      type: string
      example: '4815000000033001'
    item_name:
      description: Name of the product.
      type: string
      example: Laptop 15-inch
    line_item_id:
      description: Unique ID generated by the server for this line item in the stock count.
      type: string
      example: '4815000000044897'
    system_quantity:
      description: The system stock quantity of the product at the time the count was started.
      type: number
      format: double
      example: 50
    counted_quantity:
      description: The physical quantity of the product as counted by the assignee. Null indicates the item has not been counted yet.
      type: number
      format: double
      nullable: true
      example: 48
    unit:
      description: Unit of measurement for the product quantity.
      type: string
      example: pcs
    item_status:
      description: 'Status of the line item in the approval workflow. Possible values: <code>draft</code>, <code>submitted</code>, <code>approved</code>, <code>rejected</code>, <code>adjustment_processing</code>, <code>adjustment_created</code>, <code>approval_in_progress</code>, <code>rejection_in_progress</code>, <code>adjustment_failed</code>.'
      type: string
      enum:
        - draft
        - submitted
        - approved
        - rejected
        - adjustment_processing
        - adjustment_created
        - approval_in_progress
        - rejection_in_progress
        - adjustment_failed
      example: draft
    approval_status:
      description: Approval decision for the line item. Use <code>approved</code> to approve and create an adjustment for any discrepancy, or <code>rejected</code> to reject and trigger a recount.
      type: string
      enum:
        - approved
        - rejected
      example: approved
    is_matched:
      description: Indicates whether the counted quantity matches the system quantity.
      type: boolean
      example: false
    reason_id:
      description: Unique ID of the adjustment reason used when approving a discrepancy.
      type: string
      example: '4815000000000388'
    recurringinventorycount_id:
      description: Unique ID of the recurring stock count profile.
      type: string
      example: '4815000000055200'
    title:
      description: Name of the recurring stock count profile.
      type: string
      example: Monthly Warehouse A Count
    schedule_type:
      description: Type of schedule for the recurring count. <code>auto</code> generates counts automatically based on a recurrence frequency; <code>manual</code> uses specific user-defined dates.
      type: string
      enum:
        - auto
        - manual
      example: auto
    recurrence_frequency:
      description: 'Frequency unit for auto-scheduled recurrence. Allowed values: <code>days</code>, <code>weeks</code>, <code>months</code>.'
      type: string
      enum:
        - days
        - weeks
        - months
      example: months
    repeat_every:
      description: Interval value for recurrence (e.g., 1 for every 1 month). Used with <code>recurrence_frequency</code>.
      type: integer
      example: 1
    start_date:
      description: Start date for the auto-schedule recurrence in YYYY-MM-DD format. Must be today or a future date.
      type: string
      example: '2025-07-01'
    end_date:
      description: End date for the auto-schedule recurrence in YYYY-MM-DD format. Either <code>end_date</code> or <code>no_of_cycles</code> can be specified, not both.
      type: string
      example: '2026-06-30'
    no_of_cycles:
      description: Maximum number of count cycles to execute for an auto-schedule. Either <code>no_of_cycles</code> or <code>end_date</code> can be specified, not both.
      type: integer
      example: 12
    count_dates:
      description: List of specific dates for manual-schedule recurring counts.
      type: array
      items:
        type: string
      example:
        - '2025-07-01'
        - '2025-08-01'
        - '2025-09-01'
    remind_before:
      description: Number of days before the next count date to send a reminder notification. Set to 0 or omit to disable reminders.
      type: integer
      example: 3
    recurring_status:
      description: 'Status of the recurring stock count profile. Possible values: <code>active</code>, <code>inactive</code>, <code>expired</code>.'
      type: string
      enum:
        - active
        - inactive
        - expired
      example: active
    next_count_date:
      description: The next scheduled date on which a count will be automatically created from this profile.
      type: string
      example: '2025-08-01'
    prefix_string:
      description: Prefix string used in stock count auto-numbering (e.g., "IC-").
      type: string
      example: IC-
    next_number:
      description: The next sequence number to be used in stock count auto-numbering.
      type: string
      example: '00002'
    default_reason_id:
      description: Unique ID of the default adjustment reason to use when approving count discrepancies. If not provided, the system uses the Stock-Taking Results reason.
      type: string
      example: '4815000000000388'
    default_adjustment_account:
      description: Unique ID of the default account to use for inventory adjustments generated from count approvals.
      type: string
      example: '4815000000000400'
    inventory-count-line-item-response:
      type: object
      properties:
        line_item_id:
          $ref: '#/components/schemas/line_item_id'
        item_id:
          $ref: '#/components/schemas/item_id'
        item_name:
          $ref: '#/components/schemas/item_name'
        item_order:
          description: Position/order of the line item within the stock count.
          type: integer
          example: 1
        sku:
          description: SKU code of the product.
          type: string
          example: LAP-15-WHT
        unit:
          $ref: '#/components/schemas/unit'
        system_quantity:
          $ref: '#/components/schemas/system_quantity'
        counted_quantity:
          $ref: '#/components/schemas/counted_quantity'
        stock_variance:
          $ref: '#/components/schemas/stock_variance'
        track_serial_number:
          description: Indicates whether this item is tracked by serial numbers.
          type: boolean
          example: false
        track_batch_number:
          description: Indicates whether this item is tracked by batch numbers.
          type: boolean
          example: true
        is_matched:
          $ref: '#/components/schemas/is_matched'
        has_tracking_details_mismatch:
          $ref: '#/components/schemas/has_tracking_details_mismatch'
        status:
          $ref: '#/components/schemas/item_status'
        reason_id:
          $ref: '#/components/schemas/reason_id'
    inventorycount-object:
      type: object
      properties:
        inventorycount_id:
          $ref: '#/components/schemas/inventorycount_id'
        inventorycount_number:
          $ref: '#/components/schemas/inventorycount_number'
        count_date:
          $ref: '#/components/schemas/count_date'
        description:
          $ref: '#/components/schemas/description'
        status:
          $ref: '#/components/schemas/status'
        count_type:
          $ref: '#/components/schemas/count_type'
        location_id:
          $ref: '#/components/schemas/location_id'
        location_name:
          $ref: '#/components/schemas/location_name'
        assignee_id:
          $ref: '#/components/schemas/assignee_id'
        assignee_name:
          $ref: '#/components/schemas/assignee_name'
        line_items:
          type: array
          description: List of products (line items) included in this stock count.
          items:
            $ref: '#/components/schemas/inventory-count-line-item-response'
    recurring-count-line-item-request:
      type: object
      required:
        - item_id
      properties:
        item_id:
          $ref: '#/components/schemas/item_id'
        line_item_id:
          $ref: '#/components/schemas/line_item_id'
    list-inventory-counts-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        inventorycounts:
          type: array
          description: List of stock counts.
          items:
            type: object
            properties:
              inventorycount_id:
                $ref: '#/components/schemas/inventorycount_id'
              inventorycount_number:
                $ref: '#/components/schemas/inventorycount_number'
              status:
                $ref: '#/components/schemas/status'
              count_date:
                $ref: '#/components/schemas/count_date'
              warehouse_id:
                description: Unique ID of the warehouse. Returned when multi-warehouse is enabled and locations are not enabled.
                type: string
                example: '4815000000038080'
              warehouse_name:
                description: Name of the warehouse. Returned when multi-warehouse is enabled and locations are not enabled.
                type: string
                example: Main Warehouse
              location_id:
                $ref: '#/components/schemas/location_id'
              location_name:
                $ref: '#/components/schemas/location_name'
              number_of_items:
                description: Total number of items in the count.
                type: integer
                example: 20
              number_of_items_counted:
                description: Number of items that have been counted so far.
                type: integer
                example: 15
              number_of_items_skipped:
                description: Number of items skipped (uncounted and treated as zero on submission).
                type: integer
                example: 2
              number_of_items_adjusted:
                description: Number of items for which inventory adjustments were created. Returned only for completed counts.
                type: integer
                example: 5
              number_of_items_approved:
                description: Number of items approved during the review. Returned only for completed counts.
                type: integer
                example: 3
              number_of_items_rejected:
                description: Number of items rejected during the review. Returned only for completed counts.
                type: integer
                example: 2
              accuracy:
                description: Accuracy percentage of the count (matched items / total items). Returned for submitted, processing, and completed counts when the approver permission is present.
                type: number
                format: double
                example: 85.5
              assignee_id:
                $ref: '#/components/schemas/assignee_id'
              assignee_name:
                $ref: '#/components/schemas/assignee_name'
              assignee_photo_url:
                description: Profile photo URL of the assigned user.
                type: string
                example: https://contacts.zoho.com/file?t=photo&ID=12345
              created_by_id:
                description: Unique ID of the user who created the count.
                type: string
                example: '4815000000012300'
              created_by_name:
                description: Name of the user who created the count.
                type: string
                example: Jane Doe
              created_by_photo_url:
                description: Profile photo URL of the user who created the count.
                type: string
                example: https://contacts.zoho.com/file?t=photo&ID=12300
              last_modified_by_id:
                description: Unique ID of the user who last modified the count.
                type: string
                example: '4815000000012345'
              last_modified_by_name:
                description: Name of the user who last modified the count.
                type: string
                example: John Smith
              created_time:
                description: Timestamp when the count was created.
                type: string
                example: 2025-06-15T09:00:00+0530
              last_modified_time:
                description: Timestamp when the count was last modified.
                type: string
                example: 2025-06-15T11:30:00+0530
        page_context:
          $ref: '#/components/schemas/page_context'
    create-inventory-count-request:
      type: object
      required:
        - location_id
        - assignee_id
        - line_items
      properties:
        inventorycount_number:
          description: Custom stock count number. Used only when <code>ignore_auto_number_generation=true</code> is passed as a query parameter. Otherwise the number is auto-generated.
          type: string
          example: IC-00001
        description:
          $ref: '#/components/schemas/description'
        warehouse_id:
          description: Unique ID of the warehouse to count. Required when multi-warehouse is enabled and locations are not enabled.
          type: string
          example: '4815000000038080'
        location_id:
          description: Unique ID of the location to count. Required when locations are enabled. Mutually exclusive with <code>warehouse_id</code>.
          type: string
          example: '4815000000038080'
        assignee_id:
          $ref: '#/components/schemas/assignee_id'
        line_items:
          type: array
          description: Products to include in this stock count. Each line item requires an <code>item_id</code>. Duplicate products are not allowed.
          items:
            type: object
            required:
              - item_id
            properties:
              item_id:
                $ref: '#/components/schemas/item_id'
              item_order:
                description: Position/order of the line item within the stock count. Used to control the display sequence of items.
                type: integer
                example: 1
    update-inventory-count-request:
      type: object
      properties:
        inventorycount_number:
          description: Custom stock count number. Used only when <code>ignore_auto_number_generation=true</code> was specified during creation.
          type: string
          example: IC-00001
        description:
          $ref: '#/components/schemas/description'
        assignee_id:
          $ref: '#/components/schemas/assignee_id'
        line_items:
          type: array
          description: Updated list of products for this stock count. Include <code>line_item_id</code> for existing items; omit it to add new items. Product IDs cannot be changed for existing line items.
          items:
            type: object
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              item_id:
                $ref: '#/components/schemas/item_id'
              item_order:
                description: Position/order of the line item within the stock count. Used to control the display sequence of items.
                type: integer
                example: 1
    update-counted-quantities-request:
      type: object
      properties:
        next_action:
          description: Optional action to perform after saving counted quantities. Use <code>submit</code> to automatically submit the count for approval after recording quantities.
          type: string
          enum:
            - submit
          example: submit
        line_items:
          type: array
          description: Line items with counted quantities to record. Each item requires the <code>line_item_id</code> and the <code>counted_quantity</code>. Pass <code>""</code> for <code>counted_quantity</code> to mark the item as uncounted.
          items:
            type: object
            required:
              - line_item_id
              - counted_quantity
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              counted_quantity:
                $ref: '#/components/schemas/counted_quantity'
              counted_serial_numbers:
                description: Array of serial number strings counted for this line item. Applicable only for serial-tracked items.
                type: array
                items:
                  type: string
                example:
                  - SN-00123
                  - SN-00124
              counted_batches:
                description: Array of batch entries counted for this line item. Applicable only for batch-tracked items.
                type: array
                items:
                  type: object
                  required:
                    - batch_number
                    - counted_quantity
                  properties:
                    batch_number:
                      description: Batch number of the counted batch.
                      type: string
                      example: BATCH-2025-06
                    counted_quantity:
                      description: Quantity counted for this batch.
                      type: number
                      format: double
                      example: 10
    approve-inventory-count-request:
      type: object
      required:
        - line_items
      properties:
        line_items:
          type: array
          description: List of line items with approval decisions. For each item specify the <code>line_item_id</code>, the <code>approval_status</code> (<code>approved</code> or <code>rejected</code>), and optionally a <code>reason_id</code> for the adjustment.
          items:
            type: object
            required:
              - line_item_id
              - approval_status
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              approval_status:
                $ref: '#/components/schemas/approval_status'
              reason_id:
                description: Unique ID of the adjustment reason used when approving a discrepancy. When this ID is provided, reason-based adjustments will be generated.
                type: string
                example: '4815000000000388'
    inventory-count-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Stock count has been saved.
          readOnly: true
        inventorycount:
          $ref: '#/components/schemas/inventorycount-object'
    get-inventory-count-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        inventorycount:
          $ref: '#/components/schemas/inventorycount-object'
        can_assignee_count:
          description: Indicates whether the currently logged-in user is the assignee and can perform counting.
          type: boolean
          example: true
          readOnly: true
        can_assignee_access_warehouse:
          description: Indicates whether the assignee has access to the warehouse/location for this count.
          type: boolean
          example: true
          readOnly: true
    delete-inventory-count-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Stock count has been deleted.
          readOnly: true
    recurringinventorycount-object:
      type: object
      properties:
        recurringinventorycount_id:
          $ref: '#/components/schemas/recurringinventorycount_id'
        title:
          $ref: '#/components/schemas/title'
        status:
          $ref: '#/components/schemas/recurring_status'
        schedule_type:
          $ref: '#/components/schemas/schedule_type'
        recurrence_frequency:
          $ref: '#/components/schemas/recurrence_frequency'
        repeat_every:
          $ref: '#/components/schemas/repeat_every'
        start_date:
          $ref: '#/components/schemas/start_date'
        end_date:
          $ref: '#/components/schemas/end_date'
        no_of_cycles:
          $ref: '#/components/schemas/no_of_cycles'
        executed_cycles:
          description: Number of count cycles that have been executed so far.
          type: integer
          example: 3
        count_dates:
          $ref: '#/components/schemas/count_dates'
        location_id:
          $ref: '#/components/schemas/location_id'
        location_name:
          $ref: '#/components/schemas/location_name'
        assignee_id:
          $ref: '#/components/schemas/assignee_id'
        assignee_name:
          $ref: '#/components/schemas/assignee_name'
        next_count_date:
          $ref: '#/components/schemas/next_count_date'
        last_count_created_date:
          description: Date when the last stock count was created from this profile.
          type: string
          example: '2025-07-01'
        execution_time:
          description: Time of day at which the count is triggered, in <code>HH:mm</code> format.
          type: string
          example: '09:00'
        run_specific_days:
          description: Array of day-of-week values on which the count runs (for weekly recurrence).
          type: array
          items:
            type: string
          example:
            - MON
            - FRI
        run_specific_date:
          description: Day of the month on which the count runs (for monthly recurrence).
          type: integer
          example: 15
        run_specific_week:
          description: Week of the month to run the count (for monthly recurrence).
          type: string
          example: first
        run_specific_month:
          description: Specific month of the year to run the count.
          type: string
          example: january
        remind_before:
          $ref: '#/components/schemas/remind_before'
        description:
          $ref: '#/components/schemas/description'
        created_by_id:
          description: Unique ID of the user who created the profile.
          type: string
          example: '4815000000012300'
        created_by_name:
          description: Name of the user who created the profile.
          type: string
          example: Jane Doe
        last_modified_by_id:
          description: Unique ID of the user who last modified the profile.
          type: string
          example: '4815000000012345'
        last_modified_by_name:
          description: Name of the user who last modified the profile.
          type: string
          example: John Smith
        created_time:
          description: Timestamp when the profile was created.
          type: string
          example: 2025-06-15T09:00:00+0530
        last_modified_time:
          description: Timestamp when the profile was last modified.
          type: string
          example: 2025-06-15T11:30:00+0530
        line_items:
          type: array
          description: Products included in each count generated by this profile.
          items:
            type: object
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              item_id:
                $ref: '#/components/schemas/item_id'
              item_name:
                $ref: '#/components/schemas/item_name'
              unit:
                $ref: '#/components/schemas/unit'
    create-recurring-inventory-count-request:
      type: object
      required:
        - schedule_type
        - location_id
        - line_items
      properties:
        title:
          $ref: '#/components/schemas/title'
        schedule_type:
          $ref: '#/components/schemas/schedule_type'
        location_id:
          $ref: '#/components/schemas/location_id'
        assignee_id:
          $ref: '#/components/schemas/assignee_id'
        description:
          $ref: '#/components/schemas/description'
        remind_before:
          $ref: '#/components/schemas/remind_before'
        start_date:
          description: Required for <code>auto</code> schedule. The start date of the recurrence in YYYY-MM-DD format. Must be today or a future date.
          type: string
          example: '2025-07-01'
        end_date:
          description: Optional for <code>auto</code> schedule. The end date of the recurrence in YYYY-MM-DD format. Mutually exclusive with <code>no_of_cycles</code>.
          type: string
          example: '2026-06-30'
        no_of_cycles:
          description: Optional for <code>auto</code> schedule. The maximum number of count cycles. Mutually exclusive with <code>end_date</code>.
          type: integer
          example: 12
        recurrence_frequency:
          description: 'Required for <code>auto</code> schedule. Frequency unit for recurrence. Allowed values: <code>days</code>, <code>weeks</code>, <code>months</code>.'
          type: string
          enum:
            - days
            - weeks
            - months
          example: months
        repeat_every:
          description: Required for <code>auto</code> schedule. Interval value for recurrence (e.g., <code>1</code> for every 1 month).
          type: integer
          example: 1
        count_dates:
          description: Required for <code>manual</code> schedule. List of specific count dates in YYYY-MM-DD format.
          type: array
          items:
            type: string
          example:
            - '2025-07-01'
            - '2025-08-01'
        execution_time:
          description: Time of day at which the count should be triggered, in <code>HH:mm</code> (24-hour) format. Applies to both <code>auto</code> and <code>manual</code> schedules. Defaults to <code>00:00</code> if not specified.
          type: string
          example: '09:00'
        run_specific_days:
          description: 'For <code>auto</code> schedule with <code>recurrence_frequency: weeks</code>. Array of day-of-week values on which the count should run (e.g., <code>["MON", "WED", "FRI"]</code>).'
          type: array
          items:
            type: string
          example:
            - MON
            - FRI
        run_specific_date:
          description: 'For <code>auto</code> schedule with <code>recurrence_frequency: months</code>. Day of the month (1-31) on which the count should run.'
          type: integer
          example: 15
        run_specific_week:
          description: 'For <code>auto</code> schedule with <code>recurrence_frequency: months</code>. The week of the month to run the count. Allowed values: <code>first</code>, <code>second</code>, <code>third</code>, <code>fourth</code>, <code>last</code>.'
          type: string
          enum:
            - first
            - second
            - third
            - fourth
            - last
          example: first
        run_specific_month:
          description: For <code>auto</code> schedule. Specific month of the year to run the count (e.g., <code>january</code>).
          type: string
          example: january
        line_items:
          type: array
          description: Products to count in each generated count. Each line item requires an <code>item_id</code>. Duplicate products are not allowed.
          items:
            $ref: '#/components/schemas/recurring-count-line-item-request'
    update-recurring-inventory-count-request:
      type: object
      properties:
        title:
          $ref: '#/components/schemas/title'
        schedule_type:
          $ref: '#/components/schemas/schedule_type'
        assignee_id:
          $ref: '#/components/schemas/assignee_id'
        description:
          $ref: '#/components/schemas/description'
        remind_before:
          $ref: '#/components/schemas/remind_before'
        start_date:
          description: For <code>auto</code> schedule. Cannot be changed after the profile has executed at least once.
          type: string
          example: '2025-07-01'
        end_date:
          description: For <code>auto</code> schedule. End date for the recurrence. Mutually exclusive with <code>no_of_cycles</code>.
          type: string
          example: '2026-06-30'
        no_of_cycles:
          description: For <code>auto</code> schedule. Maximum number of count cycles. Mutually exclusive with <code>end_date</code>.
          type: integer
          example: 12
        recurrence_frequency:
          description: For <code>auto</code> schedule. Frequency unit for recurrence.
          type: string
          enum:
            - days
            - weeks
            - months
          example: months
        repeat_every:
          description: For <code>auto</code> schedule. Interval value for recurrence.
          type: integer
          example: 1
        count_dates:
          description: For <code>manual</code> schedule. Updated list of future count dates in YYYY-MM-DD format.
          type: array
          items:
            type: string
          example:
            - '2025-10-01'
            - '2025-11-01'
        execution_time:
          description: Time of day at which the count should be triggered, in <code>HH:mm</code> (24-hour) format. Applies to both <code>auto</code> and <code>manual</code> schedules.
          type: string
          example: '09:00'
        run_specific_days:
          description: For <code>auto</code> schedule with weekly recurrence. Array of day-of-week values on which the count should run.
          type: array
          items:
            type: string
          example:
            - MON
            - FRI
        run_specific_date:
          description: For <code>auto</code> schedule with monthly recurrence. Day of the month (1-31) on which the count should run.
          type: integer
          example: 15
        run_specific_week:
          description: 'For <code>auto</code> schedule with monthly recurrence. Week of the month. Allowed values: <code>first</code>, <code>second</code>, <code>third</code>, <code>fourth</code>, <code>last</code>.'
          type: string
          enum:
            - first
            - second
            - third
            - fourth
            - last
          example: first
        run_specific_month:
          description: For <code>auto</code> schedule. Specific month of the year to run the count.
          type: string
          example: january
        line_items:
          type: array
          description: Updated list of products. Include <code>line_item_id</code> for existing items; omit it to add new items.
          items:
            $ref: '#/components/schemas/recurring-count-line-item-request'
    recurring-inventory-count-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Recurring stock count profile has been saved.
          readOnly: true
        recurringinventorycount:
          $ref: '#/components/schemas/recurringinventorycount-object'
    get-recurring-inventory-count-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        recurringinventorycount:
          $ref: '#/components/schemas/recurringinventorycount-object'
        can_assignee_count:
          description: Indicates whether the assignee can perform counting.
          type: boolean
          example: true
          readOnly: true
        can_assignee_access_warehouse:
          description: Indicates whether the assignee has access to the warehouse/location.
          type: boolean
          example: true
          readOnly: true
    storage_id:
      description: Unique ID of the storage location (bin).
      type: string
      example: '4815000000050010'
    storage_name:
      description: Name of the storage location (bin).
      type: string
      example: Rack A - Shelf 2
    stock_variance:
      description: Difference between counted quantity and system quantity (counted_quantity - system_quantity). Negative value indicates stock loss; positive indicates excess.
      type: number
      format: double
      example: -2
    has_tracking_details_mismatch:
      description: Indicates whether there is a mismatch in serial number or batch tracking details between the counted and system records.
      type: boolean
      example: false
    total_counted_serials:
      description: Total number of serial numbers that have been scanned/counted for this item.
      type: integer
      example: 48
    total_counted_batches:
      description: Total number of batch entries that have been counted for this item.
      type: integer
      example: 3
    no_of_items:
      description: Total number of distinct items assigned to this storage location.
      type: integer
      example: 5
    no_of_items_counted:
      description: Number of items in this storage location that have been counted so far.
      type: integer
      example: 3
    list-item-storages-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        storages:
          type: array
          description: List of storage locations for the specified line item.
          items:
            type: object
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              storage_id:
                $ref: '#/components/schemas/storage_id'
              storage_name:
                $ref: '#/components/schemas/storage_name'
              system_quantity:
                $ref: '#/components/schemas/system_quantity'
              counted_quantity:
                $ref: '#/components/schemas/counted_quantity'
              stock_variance:
                $ref: '#/components/schemas/stock_variance'
              is_matched:
                $ref: '#/components/schemas/is_matched'
              has_tracking_details_mismatch:
                $ref: '#/components/schemas/has_tracking_details_mismatch'
              total_counted_serials:
                $ref: '#/components/schemas/total_counted_serials'
              total_counted_batches:
                $ref: '#/components/schemas/total_counted_batches'
        page_context:
          $ref: '#/components/schemas/page_context'
    autocomplete-items-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        inventorycount_items:
          type: array
          description: List of stock count line items matching the search criteria.
          items:
            type: object
            properties:
              inventory_count_id:
                $ref: '#/components/schemas/inventorycount_id'
              inventory_count_number:
                $ref: '#/components/schemas/inventorycount_number'
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              item_id:
                $ref: '#/components/schemas/item_id'
              item_name:
                $ref: '#/components/schemas/item_name'
              sku:
                description: SKU code of the product.
                type: string
                example: LAP-15-WHT
              unit:
                $ref: '#/components/schemas/unit'
              storage_location_id:
                description: Unique ID of the storage location assigned to this line item, if any.
                type: string
                example: '4815000000050010'
              storage_location_name:
                description: Name of the storage location assigned to this line item, if any.
                type: string
                example: Rack A - Shelf 2
              system_quantity:
                $ref: '#/components/schemas/system_quantity'
              counted_quantity:
                $ref: '#/components/schemas/counted_quantity'
              stock_variance:
                $ref: '#/components/schemas/stock_variance'
              is_matched:
                $ref: '#/components/schemas/is_matched'
              status:
                $ref: '#/components/schemas/item_status'
              track_serial_number:
                description: Indicates whether this item is tracked by serial numbers.
                type: boolean
                example: false
              track_batch_number:
                description: Indicates whether this item is tracked by batch numbers.
                type: boolean
                example: true
              is_storage_location_enabled:
                description: Indicates whether the product has storage/bin location tracking enabled.
                type: boolean
                example: true
        page_context:
          $ref: '#/components/schemas/page_context'
    autocomplete-storages-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        storage_locations:
          type: array
          description: List of storage locations matching the search criteria.
          items:
            type: object
            properties:
              storage_location_id:
                $ref: '#/components/schemas/storage_id'
              storage_location_name:
                $ref: '#/components/schemas/storage_name'
              system_quantity:
                $ref: '#/components/schemas/system_quantity'
              counted_quantity:
                $ref: '#/components/schemas/counted_quantity'
              stock_variance:
                $ref: '#/components/schemas/stock_variance'
              no_of_items:
                $ref: '#/components/schemas/no_of_items'
              no_of_items_counted:
                $ref: '#/components/schemas/no_of_items_counted'
        page_context:
          $ref: '#/components/schemas/page_context'
    page_context:
      type: object
      description: Pagination details for the response.
      properties:
        page:
          type: integer
          description: Current page number.
          example: 1
        per_page:
          type: integer
          description: Number of records returned per page.
          example: 200
        has_more_page:
          type: boolean
          description: Indicates whether more pages of results are available.
          example: false
        sort_column:
          type: string
          description: Column used to sort the results.
          example: created_time
        sort_order:
          type: string
          description: Sort direction. <code>A</code> for ascending, <code>D</code> for descending.
          example: D
        applied_filter:
          type: string
          description: The filter currently applied to the list.
          example: Status.All
    inventory-count-settings-request:
      type: object
      properties:
        prefix_string:
          $ref: '#/components/schemas/prefix_string'
        next_number:
          $ref: '#/components/schemas/next_number'
    inventory-count-settings-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Stock count settings updated successfully.
          readOnly: true
        settings:
          type: object
          properties:
            prefix_string:
              $ref: '#/components/schemas/prefix_string'
            next_number:
              $ref: '#/components/schemas/next_number'
    inventory-counting-preferences-request:
      type: object
      properties:
        default_reason_id:
          $ref: '#/components/schemas/default_reason_id'
        default_adjustment_account:
          $ref: '#/components/schemas/default_adjustment_account'
    inventory-counting-preferences-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Stock counts preferences updated successfully.
          readOnly: true
        preferences:
          type: object
          properties:
            default_reason_id:
              $ref: '#/components/schemas/default_reason_id'
            default_adjustment_account:
              $ref: '#/components/schemas/default_adjustment_account'
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoInventory.inventorycount.CREATE: Create Stock Counts
            ZohoInventory.inventorycount.READ: Read Stock Counts
            ZohoInventory.inventorycount.UPDATE: Update Stock Counts
            ZohoInventory.inventorycount.DELETE: Delete Stock Counts
