openapi: 3.0.0
info:
  title: 'Custom Modules'
  description: 'In Zoho Books, you can create a custom module to record other data when the predefined modules are not sufficient to manage all your business requirements <br>(<span style="font-style: italic">Note</span> : cf_ attribute is placeholder of the created custom field)'
  contact: {}
  version: 1.0.0
servers:
  -
    url: 'https://www.zohoapis.com/books/v3'
    description: 'API Endpoint'
tags:
  -
    name: custom-modules
    description: Custom-Modules
paths:
  '/{module_name}':
    get:
      tags:
        - custom-modules
      operationId: 'list_records_of_custom_module'
      summary: 'Get Record List of a Custom Module'
      description: 'To get the list of records of a custom module, you can use the argument below'
      parameters:
        -
          $ref: '#/components/parameters/module_name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-record-list-of-a-custom-module-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoBooks.custommodules.ALL
    put:
      tags:
        - custom-modules
      operationId: 'bulk_update_custom_module_records'
      summary: 'Bulk Update Custom Module'
      description: 'To update existing custom module records in bulk, use the argument below'
      parameters:
        -
          $ref: '#/components/parameters/module_name'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bulk-update-custom-module-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulk-update-custom-module-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoBooks.custommodules.ALL
    post:
      tags:
        - custom-modules
      operationId: 'create_custom_module'
      summary: 'Create Custom Modules'
      description: 'To create a custom module,  you can use the argument below'
      parameters:
        -
          $ref: '#/components/parameters/module_name'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-custom-modules-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-custom-modules-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoBooks.custommodules.ALL
    delete:
      tags:
        - custom-modules
      operationId: 'delete_custom_module'
      summary: ' Delete Custom Modules'
      description: 'To delete a custom module,  you can use the argument below'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-custom-modules-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoBooks.custommodules.ALL
    parameters:
      -
        name: module_name
        in: path
        description: 'Module Name'
        required: true
        schema:
          type: string
        example: cm_debtor
      -
        $ref: '#/components/parameters/organization_id'
  '/{module_name}/{module_id}':
    get:
      tags:
        - custom-modules
      operationId: 'get_custom_module_record_details'
      summary: 'Get Individual Record Details'
      description: 'To get the details of an individual organisation, use the argument below.'
      parameters:
        -
          $ref: '#/components/parameters/module_name'
        -
          $ref: '#/components/parameters/module_id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-individual-record-details-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoBooks.custommodules.ALL
    put:
      tags:
        - custom-modules
      operationId: 'update_custom_module_record'
      summary: 'Update Custom Module'
      description: 'To update an existing custom module, use the argument below'
      parameters:
        -
          $ref: '#/components/parameters/module_name'
        -
          $ref: '#/components/parameters/module_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-custom-module-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-custom-module-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoBooks.custommodules.ALL
    delete:
      tags:
        - custom-modules
      operationId: 'delete_custom_module_record'
      summary: 'Delete individual records '
      description: 'to delete individual records of a custom module, use the argument below'
      parameters:
        -
          name: module_id
          in: path
          description: 'Custom Module ID'
          required: true
          schema:
            type: integer
          example: 2112155000000652000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-individual-records-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoBooks.custommodules.ALL
    parameters:
      -
        name: module_name
        in: path
        description: 'Module Name'
        required: true
        schema:
          type: string
        example: cm_debtor
      -
        $ref: '#/components/parameters/organization_id'
components:
  parameters:
    module_name:
      name: module_name
      in: path
      description: 'Module Name'
      required: true
      schema:
        type: string
        example: cm_debtor
    module_id:
      name: module_id
      in: path
      description: 'Custom Module ID'
      required: true
      schema:
        type: integer
        example: 2112155000000652000
    organization_id:
      name: organization_id
      description: 'ID of the organization'
      in: query
      required: true
      schema:
        type: string
        example: '10234695'
  schemas:
    gendoc-attributes-schema:
      $ref: '#/components/schemas/module_record-response'
    module_record-response:
      type: object
      properties:
        module_record_id:
          $ref: '#/components/schemas/record_id'
        module_api_name:
          $ref: '#/components/schemas/module_api_name'
        last_modified_time:
          $ref: '#/components/schemas/last_modified_time'
        last_modified_time_formatted:
          $ref: '#/components/schemas/last_modified_time_formatted'
        created_time:
          $ref: '#/components/schemas/created_time'
        created_time_formatted:
          $ref: '#/components/schemas/created_time'
        created_by_id:
          $ref: '#/components/schemas/created_time_formatted'
        last_modified_by_id:
          $ref: '#/components/schemas/last_modified_by_id'
        record_name:
          $ref: '#/components/schemas/record_name'
        record_name_formatted:
          $ref: '#/components/schemas/record_name_formatted'
        cf_debt_amount:
          $ref: '#/components/schemas/cf_debt_amount'
        cf_debt_amount_formatted:
          $ref: '#/components/schemas/cf_debt_amount_formatted'
    record_name:
      description: 'Name of the record'
      type: string
      example: Alice
    shared_to:
      description: 'The users ID to whome it should be shared'
      type: array
      items:
        type: integer
      example:
        - 460000000639128
        - 460000000639129
    record_id:
      description: 'ID of the Custom Module Record'
      type: integer
      format: int64
      example: '460000000639129'
    module_api_name:
      description: 'Module API Name'
      type: string
      example: cm_debtor
    last_modified_time:
      description: 'Last Modified time of the Sales Order'
      type: string
      example: '2022-02-18T11:00:45+0530'
    created_time:
      description: 'Creation Time of the Sales Order'
      type: string
      example: '2022-02-18T11:00:45+0530'
    created_by_id:
      description: 'Created by User ID'
      type: string
      example: '2112155000000069001'
    last_modified_by_id:
      description: 'Last modified by User ID'
      type: string
      example: '2112155000000069001'
    last_modified_time_formatted:
      description: 'Formatted value of modified Time'
      type: string
      example: '18/02/2022 11:00 AM'
    created_time_formatted:
      description: 'Formatted value of created time'
      type: string
      example: '2022-02-18T11:00:45+0530'
    record_name_formatted:
      description: 'Name of the Record Formatted'
      type: string
      example: Alice
    date:
      description: 'The date of the comment added'
      type: string
      example: '2022-02-17'
    commented_by:
      description: 'The user who commented'
      type: string
      example: 'Staff Bob'
    operation_type:
      description: 'Type of the operation'
      type: string
      example: Added
    comment_type:
      description: 'Type of the comment'
      type: string
      example: system
    date_formatted:
      description: 'Date of the comment'
      type: string
      example: '17/02/2022 12:09 AM'
    description:
      description: 'Description of the comment'
      type: string
      example: 'Record added.'
    time:
      description: 'Time of the record added'
      type: string
      example: '12:09 AM'
    comment_id:
      description: 'ID of the comment'
      type: string
      example: '3000000003061'
    commented_by_id:
      description: 'The user ID who added the comment'
      type: string
      example: '3000000002565'
    shared_type:
      description: 'Sharing type'
      type: string
      example: read_write
    can_submit:
      description: 'Whether the record can be submitted'
      type: boolean
      example: false
    approvers_list:
      description: 'List of approvers'
      type: string
      example: ""
    can_approve:
      description: 'To get whether the record can be approved'
      type: boolean
      example: false
    module_name:
      description: 'Name of the Module'
      type: string
      example: debtor
    module_record_id:
      description: 'Reeccord ID'
      type: string
      example: 3000000003057
    module_record_ids:
      description: 'Reeccord IDs'
      type: string
      example: 460000000639128,460000000639129
    field_id:
      description: 'Field ID'
      type: string
      example: 1
    is_active:
      description: 'Field is active'
      type: boolean
      example: true
    is_mandatory:
      description: 'Field is mandatory'
      type: boolean
      example: true
    label:
      description: 'Label/ Field Name'
      type: string
      example: 'debtor Name'
    api_name:
      description: 'API name of the field'
      type: string
      example: record_name
    data_type_formatted:
      description: 'Formattd data type of the field'
      type: string
      example: 'Text Box (Single Line)'
    value_formatted:
      description: 'Formatted value of the Field'
      type: string
      example: Alice
    data_type:
      description: 'Data Type of the Field'
      type: string
      example: string
    pii_type:
      description: 'PII type of the Field'
      type: string
      example: non_pii
    value:
      description: 'Value of the Field'
      type: string
      example: Alice
    max_length:
      description: 'Maximum length of the field'
      type: number
      example: 255
    help_text:
      description: 'Help Text'
      type: string
      example: ""
    module_plural_name:
      description: 'Module name in plural'
      type: string
      example: debtors
    cf_debt_amount:
      description: 'Value of the custom Field'
      type: number
      example: 10000
    cf_debt_amount_formatted:
      description: 'The formatted value of the custom Field'
      type: string
      example: '₹10,000.00'
    id:
      description: 'User ID'
      type: number
      example: 2112155000000069000
    text:
      description: 'User Text'
      type: string
      example: 'Staff Bob'
    name:
      description: 'User Name'
      type: string
      example: 'Staff Bob'
    email:
      description: 'User Email'
      type: string
    photo_url:
      description: 'User Photo URL'
      type: string
    is_current_user:
      description: 'Is the User is current User'
      type: boolean
      example: true
    page:
      type: integer
      example: 1
    per_page:
      type: integer
      example: 200
    has_more_page:
      type: boolean
      example: false
    applied_filter:
      type: string
      example: Status.All
    sort_order:
      type: string
      example: D
    sort_column:
      type: string
      example: created_time
    module_record_hash:
      type: object
      properties:
        module_record_id:
          $ref: '#/components/schemas/date'
        module_api_name:
          $ref: '#/components/schemas/module_api_name'
        last_modified_time:
          $ref: '#/components/schemas/last_modified_time'
        last_modified_time_formatted:
          $ref: '#/components/schemas/last_modified_time_formatted'
        created_time:
          $ref: '#/components/schemas/created_time'
        created_time_formatted:
          $ref: '#/components/schemas/created_time_formatted'
        created_by_id:
          $ref: '#/components/schemas/created_by_id'
        last_modified_by_id:
          $ref: '#/components/schemas/last_modified_by_id'
        record_name:
          $ref: '#/components/schemas/record_name'
        record_name_formatted:
          $ref: '#/components/schemas/record_name_formatted'
    comments:
      type: array
      items:
        type: object
        properties:
          date:
            $ref: '#/components/schemas/date'
          commented_by:
            $ref: '#/components/schemas/commented_by'
          operation_type:
            $ref: '#/components/schemas/operation_type'
          comment_type:
            $ref: '#/components/schemas/comment_type'
          date_formatted:
            $ref: '#/components/schemas/date_formatted'
          description:
            $ref: '#/components/schemas/description'
          time:
            $ref: '#/components/schemas/time'
          comment_id:
            $ref: '#/components/schemas/comment_id'
          commented_by_id:
            $ref: '#/components/schemas/commented_by_id'
    module_fields:
      type: array
      items:
        type: object
        properties:
          field_id:
            $ref: '#/components/schemas/field_id'
          is_active:
            $ref: '#/components/schemas/is_active'
          is_mandatory:
            $ref: '#/components/schemas/is_mandatory'
          label:
            $ref: '#/components/schemas/label'
          api_name:
            $ref: '#/components/schemas/api_name'
          data_type_formatted:
            $ref: '#/components/schemas/data_type_formatted'
          value_formatted:
            $ref: '#/components/schemas/value_formatted'
          data_type:
            $ref: '#/components/schemas/data_type'
          pii_type:
            $ref: '#/components/schemas/pii_type'
          value:
            $ref: '#/components/schemas/value'
          max_length:
            $ref: '#/components/schemas/max_length'
          help_text:
            $ref: '#/components/schemas/help_text'
    module_record:
      type: array
      items:
        $ref: '#/components/schemas/module_record-response'
    module_record_module_put:
      type: array
      items:
        type: object
        properties:
          module_record_id:
            $ref: '#/components/schemas/record_id'
          module_api_name:
            $ref: '#/components/schemas/module_api_name'
          last_modified_time:
            $ref: '#/components/schemas/last_modified_time'
          last_modified_time_formatted:
            $ref: '#/components/schemas/last_modified_time_formatted'
          created_time:
            $ref: '#/components/schemas/created_time'
          created_time_formatted:
            $ref: '#/components/schemas/created_time'
          created_by_id:
            $ref: '#/components/schemas/created_time_formatted'
          last_modified_by_id:
            $ref: '#/components/schemas/last_modified_by_id'
          record_name:
            $ref: '#/components/schemas/record_name'
          record_name_formatted:
            $ref: '#/components/schemas/record_name_formatted'
          cf_debt_amount:
            $ref: '#/components/schemas/cf_debt_amount'
          cf_debt_amount_formatted:
            $ref: '#/components/schemas/cf_debt_amount_formatted'
          code:
            type: integer
            example: 0
          message:
            type: string
            example: success
    module_record_get:
      type: object
      properties:
        module_plural_name:
          $ref: '#/components/schemas/module_plural_name'
        comments:
          $ref: '#/components/schemas/comments'
        module_api_name:
          $ref: '#/components/schemas/module_api_name'
        shared_type:
          $ref: '#/components/schemas/shared_type'
        can_submit:
          $ref: '#/components/schemas/can_submit'
        approvers_list:
          $ref: '#/components/schemas/approvers_list'
        can_approve:
          $ref: '#/components/schemas/can_approve'
        module_name:
          $ref: '#/components/schemas/module_name'
        module_fields:
          $ref: '#/components/schemas/module_fields'
        module_record_id:
          $ref: '#/components/schemas/module_record_id'
        shared_to:
          $ref: '#/components/schemas/shared_to'
    page_context:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/page'
        per_page:
          $ref: '#/components/schemas/per_page'
        has_more_page:
          $ref: '#/components/schemas/has_more_page'
        applied_filter:
          $ref: '#/components/schemas/applied_filter'
        sort_column:
          $ref: '#/components/schemas/sort_column'
        sort_order:
          $ref: '#/components/schemas/sort_order'
    users:
      type: array
      items:
        type: object
        properties:
          id:
            $ref: '#/components/schemas/id'
          text:
            $ref: '#/components/schemas/text'
          name:
            $ref: '#/components/schemas/name'
          email:
            $ref: '#/components/schemas/email'
          photo_url:
            $ref: '#/components/schemas/photo_url'
          is_current_user:
            $ref: '#/components/schemas/is_current_user'
    get-record-list-of-a-custom-module-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        module_record:
          $ref: '#/components/schemas/module_record'
        page_context:
          $ref: '#/components/schemas/page_context'
    bulk-update-custom-module-request:
      required:
        - record_name
      type: object
      properties:
        cf_debt_amount:
          $ref: '#/components/schemas/cf_debt_amount'
        module_record_id:
          $ref: '#/components/schemas/module_record_ids'
        record_name:
          description: 'Name of the record'
          type: string
          example: Alice
    bulk-update-custom-module-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Bulk update successfull'
          readOnly: true
        module_record:
          $ref: '#/components/schemas/module_record_module_put'
    create-custom-modules-request:
      required:
        - record_name
      type: object
      properties:
        record_name:
          $ref: '#/components/schemas/record_name'
        cf_debt_amount:
          $ref: '#/components/schemas/cf_debt_amount'
    create-custom-modules-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'debtor is created successfully'
          readOnly: true
        module_record:
          $ref: '#/components/schemas/module_record'
    delete-custom-modules-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Module record deleted'
          readOnly: true
    get-individual-record-details-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        module_record:
          $ref: '#/components/schemas/module_record_get'
        module_record_hash:
          $ref: '#/components/schemas/module_record_hash'
        users:
          $ref: '#/components/schemas/users'
    update-custom-module-request:
      required:
        - record_name
      type: object
      properties:
        record_name:
          $ref: '#/components/schemas/record_name'
        cf_debt_amount:
          $ref: '#/components/schemas/cf_debt_amount'
    update-custom-module-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'debtor is updated successfully.'
          readOnly: true
        module_record:
          $ref: '#/components/schemas/module_record'
    delete-individual-records-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: 'https://accounts.zoho.com/oauth/v2/auth'
          scopes:
            ZohoBooks.custommodules.ALL: 'All permission for Custom Module'
