openapi: 3.0.0
info:
  title: Credit Notes
  description: Credit notes are created when a refund is to be made to a customer. A credit note object allows you to keep track of all credit note related information.
  contact: {}
  version: 1.0.0
servers:
  - url: https://www.zohoapis.com/books/v3
    description: API Endpoint
tags:
  - name: credit-notes
    description: Credit-Notes Module
paths:
  /creditnotes:
    post:
      tags:
        - credit-notes
      operationId: create_credit_note
      summary: Create a credit note
      description: Create a new credit note to record credits issued to customers for returned items, overpayments, or adjustments. Supports multi-currency transactions, custom line items, tax calculations, and workflows.
      parameters:
        - name: invoice_id
          in: query
          description: Invoice ID of the required invoice.
          required: false
          schema:
            type: string
          example: '90300000079426'
        - name: ignore_auto_number_generation
          in: query
          description: Set to true if you need to provide your own credit note number.
          required: false
          schema:
            type: boolean
          example: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-a-credit-note-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    get:
      tags:
        - credit-notes
      operationId: list_credit_notes
      summary: List all Credit Notes
      description: Retrieve a paginated list of credit notes with comprehensive filtering, sorting, and search capabilities. Use query parameters to filter by date, status, amount, customer details, items, taxes, and custom fields.
      parameters:
        - name: creditnote_number
          in: query
          description: Filter credit notes by specific credit note number. Use this parameter to search for a particular credit note by its unique number. Max-Length [100]
          required: false
          schema:
            type: string
          example: CN-29
        - name: date
          in: query
          description: Filter credit notes by the date they were raised. Use yyyy-mm-dd format to search for credit notes created on a specific date.
          required: false
          schema:
            type: string
          example: '2016-06-05'
        - name: status
          in: query
          description: 'Filter credit notes by their current status. Allowed values: <code>open</code>, <code>closed</code>, <code>void</code>, or <code>draft</code>.'
          required: false
          schema:
            type: string
          example: draft
        - name: total
          in: query
          description: Filter credit notes by their total amount. Use this parameter to search for credit notes with a specific total value.
          required: false
          schema:
            type: number
            format: double
          example: 450
        - name: reference_number
          in: query
          description: Filter credit notes by their reference number. Use this parameter to search for credit notes with a specific reference number. Max-Length [100]
          required: false
          schema:
            type: string
          example: INV-384
        - name: customer_name
          in: query
          description: Filter credit notes by customer name. Use this parameter to search for credit notes associated with a specific customer. Max-Length [100]
          required: false
          schema:
            type: string
          example: Bowman Furniture
        - name: item_name
          in: query
          description: Filter credit notes by item name. Use this parameter to search for credit notes containing specific items. Max-Length [100]
          required: false
          schema:
            type: string
          example: kit
        - name: customer_id
          in: query
          description: Filter credit notes by customer ID. Use this parameter to search for credit notes associated with a specific customer. Retrieve customer IDs from the contacts API.
          required: false
          schema:
            type: string
          example: '903000000000099'
        - name: item_description
          in: query
          description: Filter credit notes by item description. Supports variants <code>item_description_startswith</code> and <code>item_description_contains</code> for flexible searching. Max-length [100]
          required: false
          schema:
            type: string
          example: ''
        - name: item_id
          in: query
          description: Filter credit notes by item ID. Use this parameter to search for credit notes containing a specific item. Retrieve item IDs from the items API.
          required: false
          schema:
            type: string
          example: '90300000081501'
        - name: line_item_id
          in: query
          description: Filter credit notes by line item ID. Use this parameter to search for credit notes containing a specific line item within the credit note.
          required: false
          schema:
            type: string
          example: 903000006245
        - name: tax_id
          in: query
          description: Filter credit notes by tax ID. Use this parameter to search for credit notes with a specific tax applied. Retrieve tax IDs from the taxes API.
          required: false
          schema:
            type: string
          example: '903000000000356'
        - name: filter_by
          in: query
          description: 'Filter credit notes by status using predefined status values. Allowed values: <code>Status.All</code>, <code>Status.Open</code>, <code>Status.Draft</code>, <code>Status.Closed</code>, and <code>Status.Void</code>.'
          required: false
          schema:
            type: string
          example: ''
        - name: search_text
          in: query
          description: Search credit notes using text search across multiple fields. Searches credit note number, customer name, and reference number. Max-length [100]
          required: false
          schema:
            type: string
          example: ''
        - name: sort_column
          in: query
          description: 'Sort credit notes by specified column. Allowed values: <code>customer_name</code>, <code>creditnote_number</code>, <code>balance</code>, <code>total</code>, <code>date</code>, and <code>created_time</code>.'
          required: false
          schema:
            type: string
          example: created_time
        - name: page
          in: query
          description: Page number for pagination. Specify which page of results to retrieve. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page for pagination. Controls how many credit notes are returned in each 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/list-all-credit-notes-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    put:
      tags:
        - credit-notes
      operationId: update_credit_note_using_custom_field
      summary: Update a credit note using a custom field's unique value
      description: A custom field will have unique values if it's configured to not accept duplicate values. Now, you can use that custom field's value to update a credit note by providing its API name in the X-Unique-Identifier-Key header and its value in the X-Unique-Identifier-Value header. Based on this value, the corresponding credit note will be retrieved and updated. Additionally, there is an optional X-Upsert header. If the X-Upsert header is true and the custom field's unique value is not found in any of the existing credit notes, a new credit note will be created if the necessary payload details are available
      parameters:
        - name: X-Unique-Identifier-Key
          in: header
          description: Unique CustomField Api Name
          required: true
          schema:
            type: string
            example: cf_unique_cf
        - name: X-Unique-Identifier-Value
          in: header
          description: Unique CustomField Value
          required: true
          schema:
            type: string
            example: unique Value
        - name: X-Upsert
          in: header
          description: If there is no record is found unique custom field value , will create new invoice
          required: false
          schema:
            type: boolean
            example: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-a-credit-note-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.invoices.UPDATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}:
    put:
      tags:
        - credit-notes
      operationId: update_credit_note
      summary: Update a credit note
      description: Details of an existing creditnote.
      parameters:
        - name: ignore_auto_number_generation
          in: query
          description: Set to true if you need to provide your own credit note number.
          required: false
          schema:
            type: boolean
          example: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-a-credit-note-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.UPDATE
    get:
      tags:
        - credit-notes
      operationId: get_credit_note
      summary: Get a credit note
      description: Details of an existing creditnote.
      parameters:
        - name: print
          in: query
          description: 'Export credit note pdf with default print option. Allowed Values: <code>true</code>, <code>false</code>, <code>on</code> and <code>off</code>'
          required: false
          schema:
            type: boolean
          example: true
        - name: accept
          in: query
          description: 'You can get credit note details as json/pdf/html. Default format is html. Allowed Values: <code>json</code>, <code>pdf</code> and <code>html</code>'
          required: false
          schema:
            type: string
          example: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    delete:
      tags:
        - credit-notes
      operationId: delete_credit_note
      summary: Delete a credit note
      description: Delete an existing credit note.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.DELETE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/email:
    post:
      tags:
        - credit-notes
      operationId: email_credit_note
      summary: Email a credit note
      description: Email a credit note.
      parameters:
        - name: customer_id
          in: query
          description: Customer ID of the customer for whom the credit note is raised.
          required: false
          schema:
            type: string
          example: '903000000000099'
        - name: attachments
          in: query
          description: The files to be attached with the email.
          required: false
          schema:
            type: string
            format: binary
          example: ''
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/email-a-credit-note-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/email-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    get:
      tags:
        - credit-notes
      operationId: get_credit_note_email
      summary: Get email content
      description: Get email content of a credit note.
      parameters:
        - name: email_template_id
          in: query
          description: Get the email content based on a specific email template. If this param is not inputted, then the content will be based on the email template associated with the customer. If no template is associated with the customer, then default template will be used.
          required: false
          schema:
            type: string
          example: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-email-content-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/status/void:
    post:
      tags:
        - credit-notes
      operationId: mark_credit_note_void
      summary: Void a Credit Note
      description: Mark the credit note as Void.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/void-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/status/draft:
    post:
      tags:
        - credit-notes
      operationId: mark_credit_note_draft
      summary: Convert Credit Note to Draft.
      description: Convert a voided credit note to Draft.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/convert-credit-note-to-draft-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/status/open:
    post:
      tags:
        - credit-notes
      operationId: mark_credit_note_open
      summary: Convert to Open
      description: Convert a credit note in Draft status to Open.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/convert-to-open-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/submit:
    post:
      tags:
        - credit-notes
      operationId: submit_credit_note
      summary: Submit a credit note for approval
      description: Submit an estimate for approval.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/submit-a-credit-note-for-approval-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/approve:
    post:
      tags:
        - credit-notes
      operationId: approve_credit_note
      summary: Approve a credit note.
      description: Approve a credit note.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/approve-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/emailhistory:
    get:
      tags:
        - credit-notes
      operationId: get_credit_note_email_history
      summary: Email history
      description: Get email history of a credit code.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/email-history-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/address/billing:
    put:
      tags:
        - credit-notes
      operationId: update_credit_note_billing_address
      summary: Update billing address
      description: Updates the billing address for an existing credit note alone.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-billing-address-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-billing-address-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.UPDATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/address/shipping:
    put:
      tags:
        - credit-notes
      operationId: update_credit_note_shipping_address
      summary: Update Shipping address
      description: Updates the shipping address for an existing credit note alone.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-shipping-address-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-shipping-address-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.UPDATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/templates:
    get:
      tags:
        - credit-notes
      operationId: list_credit_note_templates
      summary: List credit note template
      description: Get all credit note pdf templates.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-credit-note-template-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/templates/{template_id}:
    put:
      tags:
        - credit-notes
      operationId: update_credit_note_template
      summary: Update a credit note template
      description: Update the pdf template associated with the credit note.
      parameters:
        - name: template_id
          in: path
          required: true
          description: Unique identifier of the credit note template.
          schema:
            type: string
          example: '90300000001336'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-a-credit-note-template-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.UPDATE
    parameters:
      - name: creditnote_id
        in: path
        required: true
        description: Unique identifier of the credit note.
        schema:
          type: string
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/invoices:
    get:
      tags:
        - credit-notes
      operationId: list_invoices_of_credit_note
      summary: List invoices credited
      description: List invoices to which the credit note is applied.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-invoices-credited-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    post:
      tags:
        - credit-notes
      operationId: apply_credit_note_to_invoice
      summary: Credit to an invoice
      description: Apply credit note to existing invoices.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/credit-to-an-invoice-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/credit-to-an-invoice-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note.
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/invoices/{creditnote_invoice_id}:
    delete:
      tags:
        - credit-notes
      operationId: delete_invoice_of_credit_note
      summary: Delete invoices credited
      description: Delete the credits applied to an invoice.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-invoices-credited-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.DELETE
    parameters:
      - name: creditnote_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note.
        example: '90300000072369'
      - name: creditnote_invoice_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note invoice.
        example: '982000000567172'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/comments:
    get:
      tags:
        - credit-notes
      operationId: list_credit_note_comments
      summary: List credit note comments & history
      description: Get history and comments of a credit note.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-credit-note-comments-and-history-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    post:
      tags:
        - credit-notes
      operationId: add_credit_note_comment
      summary: Add a comment
      description: Add a comment to an existing credit note.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add-a-comment-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add-a-comment-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note.
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/comments/{comment_id}:
    delete:
      tags:
        - credit-notes
      operationId: delete_credit_note_comment
      summary: Delete a Comment
      description: Delete a credit note comment.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-a-comment-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.DELETE
    parameters:
      - name: creditnote_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note.
        example: '90300000072369'
      - name: comment_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the comment.
        example: '982000000570001'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/refunds:
    get:
      tags:
        - credit-notes
      operationId: list_credit_note_refunds
      summary: List credit note refunds
      description: List all refunds with pagination.
      parameters:
        - name: customer_id
          in: query
          description: Customer ID of the customer for whom the credit note is raised.
          required: false
          schema:
            type: string
          example: '903000000000099'
        - name: sort_column
          in: query
          description: 'Sort refunds list. Allowed Values: <code>refund_mode</code>, <code>reference_number</code>, <code>date</code>, <code>creditnote_number</code>, <code>customer_name</code>, <code>amount_bcy</code> and <code>amount_fcy</code>'
          required: false
          schema:
            type: string
          example: created_time
        - name: page
          in: query
          description: Page number for pagination. Specify which page of results to retrieve. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page for pagination. Controls how many credit notes are returned in each 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/list-credit-note-refunds-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/refunds:
    get:
      tags:
        - credit-notes
      operationId: list_credit_note_refunds
      summary: List refunds of a credit note
      description: List all refunds of an existing credit note.
      parameters:
        - name: page
          in: query
          description: Page number for pagination. Specify which page of results to retrieve. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page for pagination. Controls how many credit notes are returned in each 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/list-refunds-of-a-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    post:
      tags:
        - credit-notes
      operationId: create_credit_note_refund
      summary: Refund credit note
      description: Refund credit note amount.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/refund-credit-note-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/refund-credit-note-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.CREATE
    parameters:
      - name: creditnote_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note.
        example: '90300000072369'
      - $ref: '#/components/parameters/organization_id'
  /creditnotes/{creditnote_id}/refunds/{creditnote_refund_id}:
    get:
      tags:
        - credit-notes
      operationId: get_credit_note_refund
      summary: Get credit note refund
      description: Get refund of a particular credit note.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-credit-note-refund-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.READ
    put:
      tags:
        - credit-notes
      operationId: update_credit_note_refund
      summary: Update credit note refund
      description: Update the refunded transaction.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-credit-note-refund-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-credit-note-refund-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.UPDATE
    delete:
      tags:
        - credit-notes
      operationId: delete_credit_note_refund
      summary: Delete credit note refund
      description: Delete a credit note refund.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-credit-note-refund-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.creditnotes.DELETE
    parameters:
      - name: creditnote_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note.
        example: '90300000072369'
      - name: creditnote_refund_id
        in: path
        schema:
          type: string
        required: true
        description: Unique identifier of the credit note refund.
        example: '982000000567158'
      - $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:
    gendoc-attributes-schema:
      $ref: '#/components/schemas/creditnote-response'
    creditnote-response:
      type: object
      properties:
        creditnote_id:
          $ref: '#/components/schemas/creditnote_id'
        creditnote_number:
          $ref: '#/components/schemas/creditnote_number'
        date:
          $ref: '#/components/schemas/date'
        is_pre_gst:
          $ref: '#/components/schemas/is_pre_gst'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        vat_reg_no:
          $ref: '#/components/schemas/vat_reg_no'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        cfdi_usage:
          $ref: '#/components/schemas/cfdi_usage'
        cfdi_reference_type:
          $ref: '#/components/schemas/cfdi_reference_type'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        tax_treatment:
          $ref: '#/components/schemas/tax_treatment'
        is_reverse_charge_applied:
          $ref: '#/components/schemas/is_reverse_charge_applied'
        status:
          $ref: '#/components/schemas/status'
        customer_id:
          $ref: '#/components/schemas/customer_id'
        customer_name:
          $ref: '#/components/schemas/customer_name'
        contact_persons_associated:
          $ref: '#/components/schemas/contact_persons_associated'
        custom_fields:
          description: Additional fields for the Credit-Notes.
          type: array
          items:
            type: object
            properties:
              index:
                $ref: '#/components/schemas/index'
              value:
                $ref: '#/components/schemas/value'
              label:
                $ref: '#/components/schemas/label'
              data_type:
                $ref: '#/components/schemas/data_type'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        email:
          $ref: '#/components/schemas/email'
        total:
          $ref: '#/components/schemas/total'
        balance:
          $ref: '#/components/schemas/balance'
        location_id:
          $ref: '#/components/schemas/location_id'
        location_name:
          $ref: '#/components/schemas/location_name'
        line_items:
          $ref: '#/components/schemas/line_items'
        invoices:
          description: List of invoices for which the credit note has been raised. This contains <code>invoice_id</code> and <code>amount</code>.
          type: array
          items:
            type: object
            properties:
              invoice_id:
                $ref: '#/components/schemas/invoice_id'
              invoice_number:
                $ref: '#/components/schemas/invoice_number'
              amount:
                $ref: '#/components/schemas/amount'
        taxes:
          description: Taxes associated wit the subscription.
          type: array
          items:
            type: object
            properties:
              tax_id:
                $ref: '#/components/schemas/tax_id'
              tax_name:
                $ref: '#/components/schemas/tax_name'
              tax_amount:
                $ref: '#/components/schemas/tax_amount'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        currency_symbol:
          $ref: '#/components/schemas/currency_symbol'
        billing_address:
          type: object
          properties:
            address:
              $ref: '#/components/schemas/address'
            street2:
              $ref: '#/components/schemas/street2'
            city:
              $ref: '#/components/schemas/city'
            state:
              $ref: '#/components/schemas/state'
            zip:
              $ref: '#/components/schemas/zip'
            country:
              $ref: '#/components/schemas/country'
            fax:
              $ref: '#/components/schemas/fax'
        shipping_address:
          type: object
          properties:
            address:
              $ref: '#/components/schemas/address'
            street2:
              $ref: '#/components/schemas/street2'
            city:
              $ref: '#/components/schemas/city'
            state:
              $ref: '#/components/schemas/state'
            zip:
              $ref: '#/components/schemas/zip'
            country:
              $ref: '#/components/schemas/country'
            fax:
              $ref: '#/components/schemas/fax'
        created_time:
          $ref: '#/components/schemas/created_time'
        updated_time:
          $ref: '#/components/schemas/updated_time'
        template_id:
          $ref: '#/components/schemas/template_id'
        template_name:
          $ref: '#/components/schemas/template_name'
        notes:
          $ref: '#/components/schemas/notes'
        terms:
          $ref: '#/components/schemas/terms'
    search_text:
      description: Search credit notes by credit note number or customer name or credit note reference number. Max-length [100]
      type: string
    creditnote_id:
      description: Unique ID of the credit note generated by the server.
      type: string
      example: '90300000072369'
    creditnote_number:
      description: Unique credit note number displayed in the interface. Auto-generated with CN prefix unless ignore_auto_number_generation is true. Max-Length [100]
      type: string
      example: CN-29
    gst_treatment:
      description: Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are <code> business_gst </code> , <code> business_none </code> , <code> overseas </code> , <code> consumer </code>.
      type: string
      example: business_gst
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    tax_treatment:
      description: 'VAT treatment for the credit note .Choose whether the contact falls under: <code>vat_registered</code>,<code>vat_not_registered</code>,<code>gcc_vat_not_registered</code>,<code>gcc_vat_registered</code>,<code>non_gcc</code>.</br><code>dz_vat_registered</code> and <code>dz_vat_not_registered</code> supported only for <b>UAE</b>.</b></br><code>home_country_mexico</code>,<code>border_region_mexico</code>,<code>non_mexico</code> supported only for <b>MX</b>. <br/><b>For Kenya Edition:</b> <code>vat_registered</code> ,<code>vat_not_registered</code> ,<code>non_kenya</code>(A business that is located outside Kenya).<br/><b>For SouthAfrica Edition:</b> <code>vat_registered</code>, <code>vat_not_registered</code>, <code>overseas</code>(A business that is located outside SouthAfrica).'
      type: string
      example: vat_registered
      x-node_available_in:
        - gcc
        - mx
        - ke
        - za
      x-node_unavailable_in: []
    is_reverse_charge_applied:
      description: (Required if customer tax treatment is <code>vat_registered</code>)<br/>Used to specify whether the transaction is applicable for Domestic Reverse Charge (DRC) or not.
      type: boolean
      example: true
      x-node_available_in:
        - za
      x-node_unavailable_in: []
    tax_treatment_code:
      description: Specify reason for using out of scope.</br>Supported values for UAE are <code>uae_same_tax_group</code>, <code>uae_reimbursed_expense</code> and <code>uae_others</code>.</br> Supported values for Bahrain are <code>bahrain_same_tax_group</code>, <code>bahrain_transfer_of_concern</code>, <code>bahrain_disbursement</code>, <code>bahrain_head_to_branch_transaction</code>, <code>bahrain_warranty_repair_services</code> and <code>bahrain_others</code>.</br>Supported values for Saudi Arabia are <code>ksa_pvt_health</code>, <code>ksa_pvt_edu</code>, <code>ksa_reimbursed_expense</code> and <code>ksa_house_sales</code>.
      type: string
      example: uae_others
      x-node_available_in:
        - gcc
      x-node_unavailable_in: []
    gst_no:
      description: 15 digit GST identification number of the customer.
      type: string
      example: 22AAAAA0000A1Z5
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    cfdi_usage:
      description: 'Choose CFDI Usage.</br>Allowed values: <code>acquisition_of_merchandise</code>, <code>return_discount_bonus</code>, <code>general_expense</code>, <code>buildings</code>, <code>furniture_office_equipment</code>, <code>transport_equipment</code>, <code>computer_equipmentdye_molds_tools</code>, <code>telephone_communication</code>, <code>satellite_communication</code>, <code>other_machinery_equipment</code>, <code>hospital_expense</code>, <code>medical_expense_disability</code>, <code>funeral_expense</code>, <code>donation</code>, <code>interest_mortage_loans</code>, <code>contribution_sar</code>, <code>medical_expense_insurance_pormium</code>, <code>school_transportation_expense</code>, <code>deposit_saving_account</code>, <code>payment_educational_service</code>, <code>no_tax_effect</code>, <code>payment</code>, <code>payroll</code>.'
      type: string
      example: acquisition_of_merchandise
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    cfdi_reference_type:
      description: 'Choose CFDI Reference Type.</br>Allowed values: <code>credit_note</code>, <code>debit_note</code>, <code>return_of_merchandise</code>, <code>substitution_previous_cfdi</code>, <code>transfer_of_goods</code>, <code>invoice_generated_from_order</code>, <code>cfdi_for_advance</code>.'
      type: string
      example: return_of_merchandise
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    place_of_supply:
      description: 'Place where the goods/services are supplied to. (If not given, <code>place of contact</code> given for the contact will be taken)<br/>Supported codes for UAE emirates are : </br>Abu Dhabi - <code>AB</code>,</br>Ajman - <code>AJ</code>,</br>Dubai - <code>DU</code>,</br>Fujairah - <code>FU</code>,</br>Ras al-Khaimah - <code>RA</code>,</br>Sharjah - <code>SH</code>,</br>Umm al-Quwain - <code>UM</code><br/>Supported codes for the GCC countries are : </br>United Arab Emirates - <code>AE</code>,</br>Saudi Arabia - <code>SA</code>,</br>Bahrain - <code>BH</code>,</br>Kuwait - <code>KW</code>,</br>Oman - <code>OM</code>,</br>Qatar - <code>QA</code>.'
      type: string
      example: TN
      x-node_available_in:
        - in
        - gcc
      x-node_unavailable_in: []
    product_type:
      description: 'Type of product or service for the line item. Standard values: <code>goods</code> or <code>services</code>. For South Africa: <code>service</code>, <code>goods</code>, <code>capital_service</code>, and <code>capital_goods</code>.'
      type: string
      example: goods
    hsn_or_sac:
      description: Add HSN/SAC code for your goods/services
      type: string
      example: 80540
      x-node_available_in:
        - in
        - ke
        - za
      x-node_unavailable_in: []
    sat_item_key_code:
      description: Add SAT Item Key Code for your goods/services. Download the <a href= http://omawww.sat.gob.mx/tramitesyservicios/Paginas/documentos/catCFDI_V_4_07122022.xls  >CFDI Catalogs.</a>
      type: string
      example: 71121206
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    unitkey_code:
      description: Add Unit Key Code for your goods/services. Download the <a href= http://omawww.sat.gob.mx/tramitesyservicios/Paginas/documentos/catCFDI_V_4_07122022.xls  >CFDI Catalogs.</a>
      type: string
      example: box
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    location_id:
      description: Unique identifier for the business location associated with the line item. Retrieve location IDs from the List Locations API endpoint in the locations section. Determines tax settings and business rules for this line item.
      type: string
      example: '460000000038080'
    location_name:
      description: Name of the location.
      type: string
    project_id:
      description: Unique identifier for the project associated with the line item. Links the credit to a specific project for project-based accounting and reporting.
      type: string
      example: 90300000087378
    project_name:
      description: Name of the project.
      type: string
      example: Sample Project
    item_order:
      description: Enter order of the item
      type: integer
      example: 0
    discount:
      description: Enter discount percentage.
      type: number
      format: double
      example: 10
    item_custom_fields:
      description: Enter custom field information
      type: array
      items:
        type: string
    serial_numbers:
      description: Serial numbers of the items being credited. Used for tracking specific units of inventory or equipment. Important for warranty and return tracking.
      type: string
    street2:
      type: string
      example: McMillan Avenue
    vat_reg_no:
      description: Enter VAT registration number.
      type: string
    is_pre_gst:
      description: Applicable for transactions that fall before july 1, 2017
      type: boolean
      example: true
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    ignore_auto_number_generation:
      description: Set to true to provide a custom credit note number instead of auto-generated CN prefix. When true, you must specify creditnote_number manually.
      type: boolean
      example: false
    from_account_id:
      description: The account from which credit note is refunded.
      type: string
      example: ' '
    filter_by:
      description: Filter credit notes by statuses. Allowed values <code>Status.All</code> <code>Status.Open</code> <code>Status.Draft</code> <code>Status.Closed</code> and <code>Status.Void</code>
    date:
      description: The date on which the credit note is raised. Must be in yyyy-mm-dd format. This date determines the accounting period and affects tax calculations.
      type: string
      example: '2016-06-05'
    status:
      description: Status of the credit note. This can be <code>open</code>, <code>closed</code> or <code>void</code>.
      type: string
      example: draft
    is_draft:
      description: Set to true to create the credit note in draft status. Draft credit notes are not finalized and can be modified before sending to customers.
      type: boolean
      example: true
    transaction_id:
      description: The transaction ID associated with the involved credit notes.
      type: string
      example: '903000002072369'
    transaction_type:
      type: string
      example: email
    comment_id:
      description: The unique ID for the comment generated by the server.
      type: string
      example: '982000000570001'
    commented_by_id:
      type: string
      example: '982000000554041'
    commented_by:
      description: The name of the user who commented.
      type: string
      example: Sujin Kumar
    comment_type:
      type: string
      example: system
    date_description:
      type: string
      example: 7 hours ago
    time:
      type: string
      example: 10:43 PM
    operation_type:
      type: string
      example: Updated
    creditnote_refund_id:
      type: string
      example: '982000000567158'
    amount_bcy:
      type: integer
      example: 10
    amount_fcy:
      type: integer
      example: 10
    page:
      type: integer
      example: 1
    per_page:
      type: integer
      example: 200
    report_name:
      type: string
      example: Credit Notes Refund
    has_more_page:
      type: boolean
      example: false
    sort_order:
      type: string
      example: D
    sort_column:
      description: Sort credit notes by following columns customer_name, creditnote_number, balance, total, date and created_time. Allowed Values <code>customer_name</code> <code>creditnote_number</code> <code>balance</code> <code>total</code> <code>date</code> and <code>created_time</code>
      type: string
      example: created_time
    refund_mode:
      description: The method of refund.
      type: string
      example: cash
    payment_form:
      description: Mode of Vendor Payment
      type: string
      example: cash
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    customer_id:
      description: Unique identifier for the customer contact. Retrieve customer IDs from the Get Customers API endpoint in the contacts section. This ID links the credit note to the specific customer record.
      type: string
      example: '903000000000099'
    customer_name:
      description: Name of the customer to whom the credit note is raised. Max-Length [100]
      type: string
      example: Bowman Furniture
    currency_id:
      description: Unique identifier for the currency used in the credit note. Can differ from customer currency if multi-currency is enabled. Retrieve currency IDs from the List Currencies API endpoint in the currency section.
      type: string
      example: '982000000567240'
    email:
      description: Email address of the customer.
      type: string
      example: benjamin.george@bowmanfurniture.com
    total:
      description: Total credits raised in this credit note.
      type: number
      format: double
      example: 450
    item_name:
      description: Search credit notes by item name.Max_lenght [100]
      type: string
      example: kit
    balance:
      description: The unapplied credits.
      type: number
      format: double
      example: 10
    email_template_id:
      description: Get the email content based on a specific email template. If this param is not inputted, then the content will be based on the email template associated with the customer. If no template is associated with the customer, then default template will be used.
      type: string
      example: ' '
    item_id:
      description: Unique identifier for the item in the line item. Retrieve item IDs from the List Items API endpoint in the items section. Links the line item to a specific product or service.
      type: string
      example: '90300000081501'
    description:
      description: Detailed description of the line item. Provides additional information about the product or service being credited. Displayed on the credit note document.
      type: string
      example: prorated amount for items
    code:
      description: Unique code or SKU for the line item. Used for product identification and inventory tracking. Helps distinguish between different variants of the same product.
      type: string
      example: basic-monthly
    amount_applied:
      description: The total amount applied form the credit note on an invoice.
      type: number
      format: double
      example: 41.82
    name:
      description: Name or title of the line item. Describes the product or service being credited. This name is displayed on the credit note document.
      type: string
      example: Basic Monthly
    type:
      description: Type of the credit note line item. Numeric value indicating the line item type (e.g., 1 for product, 2 for service). Used for categorization and reporting purposes.
      type: integer
      example: 1
    account_id:
      description: Unique identifier for the chart of accounts entry. Retrieve account IDs from the List Chart of Accounts API endpoint. Determines which account the line item affects for accounting purposes.
      type: string
      example: '903000000000388'
    account_name:
      description: Name of the chart of accounts entry. Displays the account name for reference and reporting purposes. Should match the account_id provided.
      type: string
      example: Sales
    unit:
      description: 'Unit of the line item. E.g: kgs, Nos.'
      type: string
      example: kgs
    tax_id:
      description: Unique identifier for the tax applied to the line item. Retrieve tax IDs from the List Taxes API endpoint in the taxes section. Determines tax calculations for this specific line item.
      type: string
      example: '903000000000356'
    tds_tax_id:
      description: Unique ID to denote the TDS tax associated to the creditnote
      type: string
      example: '903000000000357'
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    quantity:
      description: Number of units being credited for this line item. Must be a positive number. Used to calculate the total amount for the line item.
      type: integer
      format: int32
      example: 1
    template_id:
      description: Unique identifier for the credit note PDF template. Retrieve template IDs from the List Credit Note Templates API endpoint. Determines the visual layout and branding of the credit note document.
      type: string
      example: '90300000001336'
    template_name:
      description: Name of the default template of the creditnote.
      type: string
      example: Standard Template
    avatax_use_code:
      description: Used to group like customers for exemption purposes. It is a custom value that links customers to a tax rule. Select from Avalara [standard codes][1] or enter a custom code. Max-length [25]
      type: string
      x-node_available_in:
        - Avalara Integration
      x-node_unavailable_in: []
    avatax_exempt_no:
      description: Exemption certificate number of the customer. Max-length [25]
      type: string
      x-node_available_in:
        - Avalara Integration
      x-node_unavailable_in: []
    invoices:
      description: List of invoices for which the credit note has been raised. This contains <code>invoice_id</code> and <code>amount</code>.
      type: array
      items:
        type: string
    invoice_id:
      description: Invoice ID of the required invoice.
      type: string
      example: '90300000079426'
    invoice_item_id:
      description: Unique identifier of the invoice line item that this credit note line item references. Use this when creating a credit note for a specific invoice line item.
      type: string
      example: '982000000567021'
    invoice_number:
      description: Invoice number of the required invoice.
      type: string
      example: INV-384
    amount:
      description: Amount paid for the invoice.
      type: number
      format: double
      example: 450
    currency_code:
      description: Customer's currency code. This currency code is used in credit notes.
      type: string
      example: USD
    currency_symbol:
      description: Customer's currency symbol.
      type: string
      example: $
    custom_fields:
      description: Additional fields for the Credit-Notes.
      type: array
      items:
        type: string
    index:
      description: Index of the custom field. It can hold any value from 1 to 10.
      type: integer
      example: 1
    label:
      description: Label of the custom field.
      type: string
      example: label
    value:
      description: Value of the custom field.
      type: string
      example: 129890
    reference_number:
      description: Optional reference number for tracking purposes. Can be any custom string or auto-generated. Useful for linking to external systems or internal tracking. Max-Length [100]
      type: string
      example: INV-384
    from:
      description: The email ID from which the credit note is to be mailed.
      type: string
      example: gator@zillum.com
    to_mail_ids:
      description: The email IDs to which the credit note is to be mailed.
      type: array
      items:
        type: string
      example:
        - benjamin.george@bowmanfurniture.com
        - paul@bowmanfurniture.com
    cc_mail_ids:
      description: The email IDs that have to be copied when the credit note is to be mailed.
      type: array
      items:
        type: string
      example:
        - accounts@bowmanfurniture.com
    subject:
      description: The subject of the email. Max-length [1000]
      type: string
      example: Credit note for subscription.
    item_description:
      description: description for the item.Variants <code>item_description_startswith</code> and <code>item_description_contains</code>. Max-length [100]
      type: string
      example: ''
    body:
      description: The body of the email. Max-length [5000]
      type: string
      example: Please find attached the credit note for your subscription.
    created_time:
      description: Time at which the credit note was created.
      type: string
      example: 2016-06-05T02:30:08-0700
    updated_time:
      description: Time at which the credit note details were last updated.
      type: string
      example: 2016-06-05T02:30:08-0700
    from_mail_id_alias:
      description: The email ID from which the credit note is to be mailed.
      type: string
      example: true
    to_mail_ids_alias:
      description: The email IDs to which the credit note is to be mailed.
      type: array
      items:
        type: string
      example: true
    cc_mail_ids_alias:
      description: The email IDs that have to be copied when the credit note is to be mailed.
      type: array
      items:
        type: string
      example: true
    subject_alias:
      description: The subject of the email.
      type: string
      example: true
    body_alias:
      description: The body of the email.
      type: string
      example: true
    contact_person_name:
      description: Name of the Contact Person
      type: string
      example: David
    first_name:
      description: First Name of the Contact Person.
      type: string
      example: David
    contact_person_email:
      description: Email ID of the Contact Person.
      type: string
      example: willsmith@bowmanfurniture.com
    phone:
      description: Phone Number of the Contact Person.
      type: string
      example: +1-925-921-9201
    last_name:
      description: Last Name of the Contact Person.
      type: string
      example: Sujin
    salutation:
      description: Salutation of the Contact Person.
      type: string
      example: Mr
    contact_person_id:
      description: Unique ID of the Contact Person.
      type: integer
      format: int64
      example: 982000000567003
    mobile:
      description: Mobile Number of the Contact Person.
      type: string
      example: +1-4054439562
    is_email_enabled:
      description: Used to check if Email communication preference is enabled for the contact person at transaction level.
      type: boolean
      example: true
    is_sms_enabled:
      description: Used to check if SMS communication preference is enabled for the contact person at transaction level.
      type: boolean
      example: true
      x-node_available_in:
        - SMS integration
    is_whatsapp_enabled:
      description: Used to check if WhatsApp communication preference is enabled for the contact person at transaction level.
      type: boolean
      example: true
      x-node_available_in:
        - WhatsApp integration
    communication_preference:
      description: Preferred modes of communication for the contact person at transaction level.
      type: object
      properties:
        is_email_enabled:
          $ref: '#/components/schemas/is_email_enabled'
        is_whatsapp_enabled:
          $ref: '#/components/schemas/is_whatsapp_enabled'
    contact_persons_associated:
      description: Contact Persons associated with the transaction.
      type: array
      items:
        type: object
        properties:
          contact_person_id:
            $ref: '#/components/schemas/contact_person_id'
          contact_person_name:
            $ref: '#/components/schemas/contact_person_name'
          first_name:
            $ref: '#/components/schemas/first_name'
          last_name:
            $ref: '#/components/schemas/last_name'
          contact_person_email:
            $ref: '#/components/schemas/contact_person_email'
          phone:
            $ref: '#/components/schemas/phone'
          mobile:
            $ref: '#/components/schemas/mobile'
          communication_preference:
            $ref: '#/components/schemas/communication_preference'
    contact_persons_associated_payload:
      description: Contact Persons associated with the transaction.
      type: array
      items:
        type: object
        properties:
          contact_person_id:
            $ref: '#/components/schemas/contact_person_id'
          communication_preference:
            $ref: '#/components/schemas/communication_preference'
    rate:
      description: Rate of the line item.
      type: number
      format: double
      example: 0
    exchange_rate:
      description: Exchange rate for converting the credit note currency to base currency. Required when currency differs from base currency. Retrieve rates from currency exchange rate APIs.
      type: string
      example: '5.5'
    avatax_tax_code:
      description: A tax code is a unique label used to group Items (products, services, or charges) together. Refer the [link][2] for more deails. Max-length [25]
      type: string
      x-node_available_in:
        - Avalara Integration
      x-node_unavailable_in: []
    notes:
      description: Additional notes or comments for the credit note. Displayed on the credit note document for customer reference. Max-length [5000]
      type: string
      example: Offer for the referral
    terms:
      description: Terms and conditions displayed on the credit note document. Include payment terms, return policies, or other business conditions. Max-length [10000]
      type: string
      example: ''
    data_type:
      description: Data type of the custom field.
      type: string
      example: text
    vat_treatment:
      description: (Optional) VAT treatment for the invoices. VAT treatment denotes the location of the customer, if the customer resides in UK then the VAT treatment is <code>uk</code>. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and selling Goods then his VAT treatment is <code>eu_vat_registered</code>, if he resides outside of the UK then his VAT treatment is <code>overseas</code> (For Pre Brexit, this can be split as <code>eu_vat_registered</code>, <code>eu_vat_not_registered</code> and <code>non_eu</code>).
      type: string
      example: overseas
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    tax_authority_id:
      description: Unique ID of the tax authority. Tax authority depends on the location of the customer. For example, if the customer is located in NY, then the tax authority is NY tax authority.
      type: string
      example: '903000006345'
      x-node_available_in:
        - us
      x-node_unavailable_in: []
    is_inclusive_tax:
      description: Used to specify whether the line item rates are inclusive or exclusive of tax.
      type: boolean
      example: fasle
      x-node_available_in: []
      x-node_unavailable_in:
        - us
        - ca
    tax_exemption_id:
      description: Unique ID of the tax exemption.
      type: string
      example: '903000006345'
      x-node_available_in:
        - in
        - us
        - au
        - ca
      x-node_unavailable_in: []
    tax_exemption_code:
      description: Unique code of the tax exemption.
      type: string
      example: GST FREE
      x-node_available_in:
        - in
        - us
        - au
        - ca
        - mx
      x-node_unavailable_in: []
    tax_name:
      description: Unique name for tax.
      type: string
      example: Basic Tax
    tax_percentage:
      description: Percentage of tax
      type: string
      example: 10%
    tax_amount:
      description: Tax amount applied to the subscription.
      type: string
      example: '2.50'
    creditnote_invoice_id:
      type: string
      example: '982000000567172'
    credited_amount:
      description: The total amount that is credited.
      type: number
      format: double
      example: 12.02
    print:
      description: 'Export credit note pdf with default print option. Allowed Values: <code>true</code>, <code>false</code>, <code>on</code> and <code>off</code>'
      type: boolean
      example: true
    accept:
      description: 'You can get credit note details as json/pdf/html. Default format is html. Allowed Values: <code>json</code>, <code>pdf</code> and <code>html</code>'
      type: string
    address:
      description: Billing address for the invoice
      type: string
      example: 4900 Hopyard Rd, Suite 310
    city:
      description: City of the customer's billing address.
      type: string
      example: Pleasanton
    state:
      description: State of the customer's billing address.
      type: string
      example: CA
    zip:
      description: Zip code of the customer's billing address.
      type: string
      example: 94588
    country:
      description: Country of the customer's billing address.
      type: string
      example: U.S.A
    line_item_id:
      description: Search credit notes by credit note line item id.
      type: string
      example: 903000006245
    fax:
      description: Customer's fax number.
      type: string
      example: +1-925-924-9600
    attention:
      type: string
      example: ' '
    attachments:
      description: The files to be attached with the email.
      type: string
      format: binary
    mailhistory_id:
      type: string
      example: 982000000570005
    line_items:
      description: Line items of a credit note.
      type: array
      items:
        type: object
        properties:
          item_id:
            $ref: '#/components/schemas/item_id'
          line_item_id:
            $ref: '#/components/schemas/line_item_id'
          account_id:
            $ref: '#/components/schemas/account_id'
          name:
            $ref: '#/components/schemas/name'
          description:
            $ref: '#/components/schemas/description'
          item_order:
            $ref: '#/components/schemas/item_order'
          rate:
            $ref: '#/components/schemas/rate'
          quantity:
            $ref: '#/components/schemas/quantity'
          unit:
            $ref: '#/components/schemas/unit'
          discount:
            $ref: '#/components/schemas/discount'
          tax_id:
            $ref: '#/components/schemas/tax_id'
          tds_tax_id:
            $ref: '#/components/schemas/tds_tax_id'
          tax_exemption_id:
            $ref: '#/components/schemas/tax_exemption_id'
          tax_exemption_code:
            $ref: '#/components/schemas/tax_exemption_code'
          tax_treatment_code:
            $ref: '#/components/schemas/tax_treatment_code'
          avatax_use_code:
            $ref: '#/components/schemas/avatax_use_code'
          avatax_tax_code:
            $ref: '#/components/schemas/avatax_tax_code'
          product_type:
            $ref: '#/components/schemas/product_type'
          hsn_or_sac:
            $ref: '#/components/schemas/hsn_or_sac'
          sat_item_key_code:
            $ref: '#/components/schemas/sat_item_key_code'
          unitkey_code:
            $ref: '#/components/schemas/unitkey_code'
          item_custom_fields:
            $ref: '#/components/schemas/item_custom_fields'
          location_id:
            $ref: '#/components/schemas/location_id'
          location_name:
            $ref: '#/components/schemas/location_name'
          serial_numbers:
            $ref: '#/components/schemas/serial_numbers'
          project_id:
            $ref: '#/components/schemas/project_id'
    template-id:
      type: string
      example: 982000000010019
    template_type:
      type: string
      example: professional
    taxes:
      description: Details of the taxes associated with the subscription.
      type: array
      items:
        type: object
        properties:
          tax_id:
            $ref: '#/components/schemas/tax_id'
          tax_name:
            $ref: '#/components/schemas/tax_name'
          tax_amount:
            $ref: '#/components/schemas/tax_amount'
    create-a-credit-note-request:
      required:
        - customer_id
        - date
        - creditnote_number
        - line_items
      type: object
      properties:
        customer_id:
          $ref: '#/components/schemas/customer_id'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        contact_persons_associated:
          $ref: '#/components/schemas/contact_persons_associated_payload'
        date:
          $ref: '#/components/schemas/date'
        is_draft:
          $ref: '#/components/schemas/is_draft'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        line_items:
          description: Array of line items for the credit note. Each line item represents a product or service being credited to the customer.
          type: array
          items:
            type: object
            properties:
              item_id:
                $ref: '#/components/schemas/item_id'
              invoice_id:
                $ref: '#/components/schemas/invoice_id'
              invoice_item_id:
                description: Unique identifier of the invoice line item that this credit note line item references. Use this when creating a credit note for a specific invoice line item.
                type: string
                example: '982000000567021'
              description:
                $ref: '#/components/schemas/description'
              code:
                $ref: '#/components/schemas/code'
              name:
                $ref: '#/components/schemas/name'
              type:
                $ref: '#/components/schemas/type'
              account_id:
                $ref: '#/components/schemas/account_id'
              account_name:
                $ref: '#/components/schemas/account_name'
              quantity:
                $ref: '#/components/schemas/quantity'
              tax_id:
                $ref: '#/components/schemas/tax_id'
              tds_tax_id:
                $ref: '#/components/schemas/tds_tax_id'
              tax_treatment_code:
                $ref: '#/components/schemas/tax_treatment_code'
              product_type:
                $ref: '#/components/schemas/product_type'
              sat_item_key_code:
                $ref: '#/components/schemas/sat_item_key_code'
              unitkey_code:
                $ref: '#/components/schemas/unitkey_code'
              serial_numbers:
                $ref: '#/components/schemas/serial_numbers'
              location_id:
                $ref: '#/components/schemas/location_id'
              project_id:
                $ref: '#/components/schemas/project_id'
        location_id:
          $ref: '#/components/schemas/location_id'
        creditnote_number:
          $ref: '#/components/schemas/creditnote_number'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        tax_treatment:
          $ref: '#/components/schemas/tax_treatment'
        is_reverse_charge_applied:
          $ref: '#/components/schemas/is_reverse_charge_applied'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        cfdi_usage:
          $ref: '#/components/schemas/cfdi_usage'
        cfdi_reference_type:
          $ref: '#/components/schemas/cfdi_reference_type'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        ignore_auto_number_generation:
          $ref: '#/components/schemas/ignore_auto_number_generation'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        notes:
          $ref: '#/components/schemas/notes'
        terms:
          $ref: '#/components/schemas/terms'
        template_id:
          $ref: '#/components/schemas/template_id'
        tax_id:
          $ref: '#/components/schemas/tax_id'
        tax_authority_id:
          $ref: '#/components/schemas/tax_authority_id'
        tax_exemption_id:
          $ref: '#/components/schemas/tax_exemption_id'
        avatax_use_code:
          $ref: '#/components/schemas/avatax_use_code'
        avatax_exempt_no:
          $ref: '#/components/schemas/avatax_exempt_no'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        avatax_tax_code:
          $ref: '#/components/schemas/avatax_tax_code'
    create-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note has been created.
          readOnly: true
        creditnote:
          $ref: '#/components/schemas/creditnote-response'
    list-all-credit-notes-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        creditnotes:
          type: object
          properties:
            creditnote_id:
              $ref: '#/components/schemas/creditnote_id'
            creditnote_number:
              $ref: '#/components/schemas/creditnote_number'
            status:
              $ref: '#/components/schemas/status'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            date:
              $ref: '#/components/schemas/date'
            total:
              $ref: '#/components/schemas/total'
            balance:
              $ref: '#/components/schemas/balance'
            location_id:
              $ref: '#/components/schemas/location_id'
            location_name:
              $ref: '#/components/schemas/location_name'
            customer_id:
              $ref: '#/components/schemas/customer_id'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            currency_id:
              $ref: '#/components/schemas/currency_id'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            created_time:
              $ref: '#/components/schemas/created_time'
            last_modified_time:
              type: string
              example: 2016-06-05T02:30:08-0700
            is_emailed:
              type: boolean
              example: true
    update-a-credit-note-request:
      required:
        - customer_id
        - date
        - creditnote_number
        - line_items
      type: object
      properties:
        customer_id:
          $ref: '#/components/schemas/customer_id'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        contact_persons_associated:
          $ref: '#/components/schemas/contact_persons_associated_payload'
        date:
          $ref: '#/components/schemas/date'
        is_draft:
          $ref: '#/components/schemas/is_draft'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        line_items:
          $ref: '#/components/schemas/line_items'
        location_id:
          $ref: '#/components/schemas/location_id'
        creditnote_number:
          $ref: '#/components/schemas/creditnote_number'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        tax_treatment:
          $ref: '#/components/schemas/tax_treatment'
        is_reverse_charge_applied:
          $ref: '#/components/schemas/is_reverse_charge_applied'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        cfdi_usage:
          $ref: '#/components/schemas/cfdi_usage'
        cfdi_reference_type:
          $ref: '#/components/schemas/cfdi_reference_type'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        ignore_auto_number_generation:
          $ref: '#/components/schemas/ignore_auto_number_generation'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        notes:
          $ref: '#/components/schemas/notes'
        terms:
          $ref: '#/components/schemas/terms'
        template_id:
          $ref: '#/components/schemas/template_id'
        tax_id:
          $ref: '#/components/schemas/tax_id'
        tax_authority_id:
          $ref: '#/components/schemas/tax_authority_id'
        tax_exemption_id:
          $ref: '#/components/schemas/tax_exemption_id'
        avatax_use_code:
          $ref: '#/components/schemas/avatax_use_code'
        avatax_exempt_no:
          $ref: '#/components/schemas/avatax_exempt_no'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        item_id:
          $ref: '#/components/schemas/item_id'
        account_id:
          $ref: '#/components/schemas/account_id'
        name:
          $ref: '#/components/schemas/name'
        avatax_tax_code:
          $ref: '#/components/schemas/avatax_tax_code'
        description:
          $ref: '#/components/schemas/description'
        unit:
          $ref: '#/components/schemas/unit'
        rate:
          $ref: '#/components/schemas/rate'
        quantity:
          $ref: '#/components/schemas/quantity'
    update-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note has been updated.
          readOnly: true
        creditnote:
          type: object
          properties:
            creditnote_id:
              $ref: '#/components/schemas/creditnote_id'
            creditnote_number:
              $ref: '#/components/schemas/creditnote_number'
            date:
              $ref: '#/components/schemas/date'
            is_pre_gst:
              $ref: '#/components/schemas/is_pre_gst'
            place_of_supply:
              $ref: '#/components/schemas/place_of_supply'
            vat_treatment:
              $ref: '#/components/schemas/vat_treatment'
            vat_reg_no:
              $ref: '#/components/schemas/vat_reg_no'
            gst_no:
              $ref: '#/components/schemas/gst_no'
            cfdi_usage:
              $ref: '#/components/schemas/cfdi_usage'
            cfdi_reference_type:
              $ref: '#/components/schemas/cfdi_reference_type'
            gst_treatment:
              $ref: '#/components/schemas/gst_treatment'
            tax_treatment:
              $ref: '#/components/schemas/tax_treatment'
            is_reverse_charge_applied:
              $ref: '#/components/schemas/is_reverse_charge_applied'
            status:
              $ref: '#/components/schemas/status'
            customer_id:
              $ref: '#/components/schemas/customer_id'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            contact_persons_associated:
              $ref: '#/components/schemas/contact_persons_associated'
            custom_fields:
              description: Additional fields for the Credit-Notes.
              type: array
              items:
                type: object
                properties:
                  index:
                    $ref: '#/components/schemas/index'
                  value:
                    $ref: '#/components/schemas/value'
                  label:
                    $ref: '#/components/schemas/label'
                  data_type:
                    $ref: '#/components/schemas/data_type'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            email:
              $ref: '#/components/schemas/email'
            total:
              $ref: '#/components/schemas/total'
            balance:
              $ref: '#/components/schemas/balance'
            line_items:
              description: Line items of a credit note.
              type: array
              items:
                type: object
                properties:
                  item_id:
                    $ref: '#/components/schemas/item_id'
                  description:
                    $ref: '#/components/schemas/description'
                  code:
                    $ref: '#/components/schemas/code'
                  name:
                    $ref: '#/components/schemas/name'
                  type:
                    $ref: '#/components/schemas/type'
                  account_id:
                    $ref: '#/components/schemas/account_id'
                  account_name:
                    $ref: '#/components/schemas/account_name'
                  quantity:
                    $ref: '#/components/schemas/quantity'
                  tax_id:
                    $ref: '#/components/schemas/tax_id'
                  tax_treatment_code:
                    $ref: '#/components/schemas/tax_treatment_code'
                  product_type:
                    $ref: '#/components/schemas/product_type'
                  serial_numbers:
                    $ref: '#/components/schemas/serial_numbers'
                  location_id:
                    $ref: '#/components/schemas/location_id'
                  location_name:
                    $ref: '#/components/schemas/location_name'
                  project_id:
                    $ref: '#/components/schemas/project_id'
            invoices:
              description: List of invoices for which the credit note has been raised. This contains <code>invoice_id</code> and <code>amount</code>.
              type: array
              items:
                type: object
                properties:
                  invoice_id:
                    $ref: '#/components/schemas/invoice_id'
                  invoice_number:
                    $ref: '#/components/schemas/invoice_number'
                  amount:
                    $ref: '#/components/schemas/amount'
            taxes:
              description: Taxes associated wit the subscription.
              type: array
              items:
                type: object
                properties:
                  tax_id:
                    $ref: '#/components/schemas/tax_id'
                  tax_name:
                    $ref: '#/components/schemas/tax_name'
                  tax_amount:
                    $ref: '#/components/schemas/tax_amount'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            currency_symbol:
              $ref: '#/components/schemas/currency_symbol'
            location_id:
              $ref: '#/components/schemas/location_id'
            location_name:
              $ref: '#/components/schemas/location_name'
            billing_address:
              type: object
              properties:
                address:
                  $ref: '#/components/schemas/address'
                street2:
                  $ref: '#/components/schemas/street2'
                city:
                  $ref: '#/components/schemas/city'
                state:
                  $ref: '#/components/schemas/state'
                zip:
                  $ref: '#/components/schemas/zip'
                country:
                  $ref: '#/components/schemas/country'
                fax:
                  $ref: '#/components/schemas/fax'
                attention:
                  $ref: '#/components/schemas/attention'
            shipping_address:
              type: object
              properties:
                address:
                  $ref: '#/components/schemas/address'
                street2:
                  $ref: '#/components/schemas/street2'
                city:
                  $ref: '#/components/schemas/city'
                state:
                  $ref: '#/components/schemas/state'
                zip:
                  $ref: '#/components/schemas/zip'
                country:
                  $ref: '#/components/schemas/country'
                fax:
                  $ref: '#/components/schemas/fax'
                attention:
                  $ref: '#/components/schemas/attention'
            created_time:
              $ref: '#/components/schemas/created_time'
            updated_time:
              $ref: '#/components/schemas/updated_time'
            template_id:
              $ref: '#/components/schemas/template_id'
            template_name:
              $ref: '#/components/schemas/template_name'
            notes:
              $ref: '#/components/schemas/notes'
            terms:
              $ref: '#/components/schemas/terms'
    get-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        creditnote:
          type: object
          properties:
            creditnote_id:
              $ref: '#/components/schemas/creditnote_id'
            creditnote_number:
              $ref: '#/components/schemas/creditnote_number'
            date:
              $ref: '#/components/schemas/date'
            is_pre_gst:
              $ref: '#/components/schemas/is_pre_gst'
            place_of_supply:
              $ref: '#/components/schemas/place_of_supply'
            vat_treatment:
              $ref: '#/components/schemas/vat_treatment'
            vat_reg_no:
              $ref: '#/components/schemas/vat_reg_no'
            gst_no:
              $ref: '#/components/schemas/gst_no'
            cfdi_usage:
              $ref: '#/components/schemas/cfdi_usage'
            cfdi_reference_type:
              $ref: '#/components/schemas/cfdi_reference_type'
            gst_treatment:
              $ref: '#/components/schemas/gst_treatment'
            tax_treatment:
              $ref: '#/components/schemas/tax_treatment'
            is_reverse_charge_applied:
              $ref: '#/components/schemas/is_reverse_charge_applied'
            status:
              $ref: '#/components/schemas/status'
            customer_id:
              $ref: '#/components/schemas/customer_id'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            contact_persons_associated:
              $ref: '#/components/schemas/contact_persons_associated'
            custom_fields:
              description: Additional fields for the Credit-Notes.
              type: array
              items:
                type: object
                properties:
                  index:
                    $ref: '#/components/schemas/index'
                  value:
                    $ref: '#/components/schemas/value'
                  label:
                    $ref: '#/components/schemas/label'
                  data_type:
                    $ref: '#/components/schemas/data_type'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            email:
              $ref: '#/components/schemas/email'
            total:
              $ref: '#/components/schemas/total'
            balance:
              $ref: '#/components/schemas/balance'
            location_id:
              $ref: '#/components/schemas/location_id'
            location_name:
              $ref: '#/components/schemas/location_name'
            line_items:
              description: Line items of a credit note.
              type: array
              items:
                type: object
                properties:
                  item_id:
                    $ref: '#/components/schemas/item_id'
                  description:
                    $ref: '#/components/schemas/description'
                  code:
                    $ref: '#/components/schemas/code'
                  name:
                    $ref: '#/components/schemas/name'
                  type:
                    $ref: '#/components/schemas/type'
                  account_id:
                    $ref: '#/components/schemas/account_id'
                  account_name:
                    $ref: '#/components/schemas/account_name'
                  quantity:
                    $ref: '#/components/schemas/quantity'
                  tax_id:
                    $ref: '#/components/schemas/tax_id'
                  tax_treatment_code:
                    $ref: '#/components/schemas/tax_treatment_code'
                  product_type:
                    $ref: '#/components/schemas/product_type'
                  serial_numbers:
                    $ref: '#/components/schemas/serial_numbers'
                  location_id:
                    $ref: '#/components/schemas/location_id'
                  location_name:
                    $ref: '#/components/schemas/location_name'
                  project_id:
                    $ref: '#/components/schemas/project_id'
                  project_name:
                    $ref: '#/components/schemas/project_name'
            invoices:
              description: List of invoices for which the credit note has been raised. This contains <code>invoice_id</code> and <code>amount</code>.
              type: array
              items:
                type: object
                properties:
                  invoice_id:
                    $ref: '#/components/schemas/invoice_id'
                  invoice_number:
                    $ref: '#/components/schemas/invoice_number'
                  amount:
                    $ref: '#/components/schemas/amount'
            taxes:
              description: Taxes associated wit the subscription.
              type: array
              items:
                type: object
                properties:
                  tax_id:
                    $ref: '#/components/schemas/tax_id'
                  tax_name:
                    $ref: '#/components/schemas/tax_name'
                  tax_amount:
                    $ref: '#/components/schemas/tax_amount'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            currency_symbol:
              $ref: '#/components/schemas/currency_symbol'
            created_time:
              $ref: '#/components/schemas/created_time'
            updated_time:
              $ref: '#/components/schemas/updated_time'
            billing_address:
              type: object
              properties:
                address:
                  $ref: '#/components/schemas/address'
                street2:
                  $ref: '#/components/schemas/street2'
                city:
                  $ref: '#/components/schemas/city'
                state:
                  $ref: '#/components/schemas/state'
                zip:
                  $ref: '#/components/schemas/zip'
                country:
                  $ref: '#/components/schemas/country'
                fax:
                  $ref: '#/components/schemas/fax'
                attention:
                  $ref: '#/components/schemas/attention'
            shipping_address:
              type: object
              properties:
                address:
                  $ref: '#/components/schemas/address'
                street2:
                  $ref: '#/components/schemas/street2'
                city:
                  $ref: '#/components/schemas/city'
                state:
                  $ref: '#/components/schemas/state'
                zip:
                  $ref: '#/components/schemas/zip'
                country:
                  $ref: '#/components/schemas/country'
                fax:
                  $ref: '#/components/schemas/fax'
                attention:
                  $ref: '#/components/schemas/attention'
            template_id:
              $ref: '#/components/schemas/template_id'
            template_name:
              $ref: '#/components/schemas/template_name'
            notes:
              $ref: '#/components/schemas/notes'
            terms:
              $ref: '#/components/schemas/terms'
    delete-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note has been deleted.
          readOnly: true
    email-a-credit-note-request:
      required:
        - to_mail_ids
        - subject
        - body
      type: object
      properties:
        to_mail_ids:
          $ref: '#/components/schemas/to_mail_ids'
        cc_mail_ids:
          $ref: '#/components/schemas/cc_mail_ids'
        subject:
          $ref: '#/components/schemas/subject'
        body:
          $ref: '#/components/schemas/body'
    email-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Your creditnote has been sent.
          readOnly: true
    get-email-content-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        data:
          type: array
          items:
            type: object
            properties:
              body:
                description: Body of the mail.
                type: string
                example: The credit note is attached with this email.
              error_list:
                description: Array that consists of errors.
                type: array
                items:
                  type: string
                example: []
              subject:
                description: Subject of the email.
                type: string
                example: 'Credit Note from Zillium Inc(Credit Note #: CN-00001)'
              emailtemplates:
                description: Templates of the email.
                type: array
                items:
                  type: object
                  properties:
                    selected:
                      type: boolean
                      example: fasle
                    name:
                      description: Name of the credit
                      type: string
                      example: Default
                    email_template_id:
                      description: Get the email content based on a specific email template. If this param is not inputted, then the content will be based on the email template associated with the customer. If no template is associated with the customer, then default template will be used.
                      type: string
                      example: '460000000000085'
              to_contacts:
                type: array
                items:
                  type: object
                  properties:
                    first_name:
                      type: string
                      example: Will
                    selected:
                      type: boolean
                      example: fasle
                    phone:
                      type: string
                      example: +1-925-921-9201
                    email:
                      description: Email address of the customer.
                      type: string
                      example: willsmith@bowmanfurniture.com
                    contact_person_id:
                      type: string
                      example: '460000000026051'
                    last_name:
                      type: string
                      example: Parker
                    salutation:
                      type: string
                      example: Mr.
                    mobile:
                      type: string
                      example: +1-4054439760
              file_name:
                type: string
                example: CN-00001.pdf
              from_emails:
                type: array
                items:
                  type: object
                  properties:
                    user_name:
                      type: string
                      example: John Smith
                    selected:
                      type: boolean
                      example: fasle
                    email:
                      description: Email address of the customer.
                      type: string
                      example: willsmith@bowmanfurniture.com
              customer_id:
                description: Customer ID of the customer for whom the credit note is raised.
                type: string
                example: '46000000002609'
    void-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note has been marked as void.
          readOnly: true
    convert-credit-note-to-draft-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note has been marked as Draft.
          readOnly: true
    convert-to-open-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Status of the credit note has been changed to open.
          readOnly: true
    submit-a-credit-note-for-approval-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The Credit Note has been successfully submitted for approval.
          readOnly: true
    approve-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: You have approved the Credit Note.
          readOnly: true
    email-history-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        email_history:
          type: array
          items:
            type: object
            properties:
              mailhistory_id:
                $ref: '#/components/schemas/mailhistory_id'
              from:
                $ref: '#/components/schemas/from'
              to_mail_ids:
                $ref: '#/components/schemas/to_mail_ids'
              subject:
                $ref: '#/components/schemas/subject'
              date:
                $ref: '#/components/schemas/date'
    update-billing-address-request:
      type: object
      properties:
        address:
          description: Billing address for the invoice
          type: string
          example: 4900 Hopyard Rd, Suite 310
        city:
          description: City of the customer's billing address.
          type: string
          example: Pleasanton
        state:
          description: State of the customer's billing address.
          type: string
          example: CA
        zip:
          description: Zip code of the customer's billing address.
          type: string
          example: 94588
        country:
          description: Country of the customer's billing address.
          type: string
          example: USA
        fax:
          description: Customer's fax number.
          type: string
          example: +1-925-924-9600
    update-billing-address-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Billing address updated
          readOnly: true
    update-shipping-address-request:
      type: object
      properties:
        address:
          description: Billing address for the invoice
          type: string
          example: Suite 125, McMillan Avenue
        city:
          description: City of the customer's billing address.
          type: string
          example: San Francisco
        state:
          description: State of the customer's billing address.
          type: string
          example: CA
        zip:
          description: Zip code of the customer's billing address.
          type: string
          example: 94134
        country:
          description: Country of the customer's billing address.
          type: string
          example: USA
        fax:
          description: Customer's fax number.
          type: string
          example: +1-925-924-9600
    update-shipping-address-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Shipping address updated
          readOnly: true
    list-credit-note-template-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        templates:
          type: array
          items:
            type: object
            properties:
              template_name:
                $ref: '#/components/schemas/template_name'
              template_id:
                $ref: '#/components/schemas/template_id'
              template_type:
                $ref: '#/components/schemas/template_type'
    update-a-credit-note-template-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note has been updated.
          readOnly: true
    list-invoices-credited-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        invoices_credited:
          type: array
          items:
            type: object
            properties:
              creditnote_id:
                $ref: '#/components/schemas/creditnote_id'
              invoice_id:
                $ref: '#/components/schemas/invoice_id'
              creditnote_invoice_id:
                $ref: '#/components/schemas/creditnote_invoice_id'
              date:
                $ref: '#/components/schemas/date'
              invoice_number:
                $ref: '#/components/schemas/invoice_number'
              creditnote_number:
                $ref: '#/components/schemas/creditnote_number'
              credited_amount:
                $ref: '#/components/schemas/credited_amount'
    credit-to-an-invoice-request:
      required:
        - invoice_id
        - amount_applied
      type: object
      properties:
        invoices:
          description: List of invoices for which the credit note has been raised. This contains <code>invoice_id</code> and <code>amount</code>.
          type: array
          items:
            type: object
            properties:
              invoice_id:
                $ref: '#/components/schemas/invoice_id'
              amount_applied:
                $ref: '#/components/schemas/amount_applied'
        invoice_id:
          $ref: '#/components/schemas/invoice_id'
        amount_applied:
          $ref: '#/components/schemas/amount_applied'
    credit-to-an-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Credits have been applied to the invoice(s).
          readOnly: true
    delete-invoices-credited-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Credits applied to an invoice have been deleted.
          readOnly: true
    list-credit-note-comments-and-history-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Comments of the credit note are displayed successfully.
          readOnly: true
        comments:
          type: array
          items:
            type: object
            properties:
              comment_id:
                $ref: '#/components/schemas/comment_id'
              creditnote_id:
                $ref: '#/components/schemas/creditnote_id'
              description:
                description: A small description about the item.
                type: string
                example: Credits applied to invoice INV-00004
              commented_by_id:
                $ref: '#/components/schemas/commented_by_id'
              commented_by:
                $ref: '#/components/schemas/commented_by'
              comment_type:
                $ref: '#/components/schemas/comment_type'
              date:
                $ref: '#/components/schemas/date'
              date_description:
                $ref: '#/components/schemas/date_description'
              time:
                $ref: '#/components/schemas/time'
              operation_type:
                $ref: '#/components/schemas/operation_type'
              transaction_id:
                $ref: '#/components/schemas/transaction_id'
              transaction_type:
                $ref: '#/components/schemas/transaction_type'
    add-a-comment-request:
      type: object
      properties:
        description:
          description: A small description about the item.
          type: string
          example: Credits applied to invoice INV-00004
    add-a-comment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Comments added.
          readOnly: true
    delete-a-comment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The comment has been deleted.
          readOnly: true
    list-credit-note-refunds-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The list of credit note refunds are displayed successfully.
          readOnly: true
        creditnote_refunds:
          type: array
          items:
            type: object
            properties:
              creditnote_refund_id:
                $ref: '#/components/schemas/creditnote_refund_id'
              creditnote_id:
                $ref: '#/components/schemas/creditnote_id'
              date:
                $ref: '#/components/schemas/date'
              refund_mode:
                $ref: '#/components/schemas/refund_mode'
              payment_form:
                $ref: '#/components/schemas/payment_form'
              reference_number:
                $ref: '#/components/schemas/reference_number'
              creditnote_number:
                $ref: '#/components/schemas/creditnote_number'
              customer_name:
                $ref: '#/components/schemas/customer_name'
              description:
                description: A small description about the item.
                type: string
                example: ''
              amount_bcy:
                $ref: '#/components/schemas/amount_bcy'
              amount_fcy:
                $ref: '#/components/schemas/amount_fcy'
        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'
            report_name:
              $ref: '#/components/schemas/report_name'
            sort_column:
              $ref: '#/components/schemas/sort_column'
            sort_order:
              $ref: '#/components/schemas/sort_order'
    list-refunds-of-a-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The refunds of the existing credit note are displayed successfully.
          readOnly: true
        creditnote_refunds:
          type: array
          items:
            type: object
            properties:
              creditnote_refund_id:
                $ref: '#/components/schemas/creditnote_refund_id'
              creditnote_id:
                $ref: '#/components/schemas/creditnote_id'
              date:
                $ref: '#/components/schemas/date'
              refund_mode:
                $ref: '#/components/schemas/refund_mode'
              payment_form:
                $ref: '#/components/schemas/payment_form'
              reference_number:
                $ref: '#/components/schemas/reference_number'
              creditnote_number:
                $ref: '#/components/schemas/creditnote_number'
              customer_name:
                $ref: '#/components/schemas/customer_name'
              description:
                description: A small description about the item.
                type: string
                example: ''
              amount_bcy:
                $ref: '#/components/schemas/amount_bcy'
              amount_fcy:
                $ref: '#/components/schemas/amount_fcy'
        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'
            report_name:
              $ref: '#/components/schemas/report_name'
            sort_column:
              $ref: '#/components/schemas/sort_column'
            sort_order:
              $ref: '#/components/schemas/sort_order'
    refund-credit-note-request:
      type: object
      properties:
        date:
          $ref: '#/components/schemas/date'
        refund_mode:
          $ref: '#/components/schemas/refund_mode'
        payment_form:
          $ref: '#/components/schemas/payment_form'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        amount:
          $ref: '#/components/schemas/amount'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        from_account_id:
          $ref: '#/components/schemas/from_account_id'
        description:
          $ref: '#/components/schemas/description'
    refund-credit-note-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note amount is refunded successfully.
          readOnly: true
        creditnote_refund:
          type: object
          properties:
            creditnote_refund_id:
              $ref: '#/components/schemas/creditnote_refund_id'
            creditnote_id:
              $ref: '#/components/schemas/creditnote_id'
            date:
              $ref: '#/components/schemas/date'
            refund_mode:
              $ref: '#/components/schemas/refund_mode'
            payment_form:
              $ref: '#/components/schemas/payment_form'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            amount:
              $ref: '#/components/schemas/amount'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            description:
              $ref: '#/components/schemas/description'
    get-credit-note-refund-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The refund of the credit note is displayed successfully.
          readOnly: true
        creditnote_refund:
          type: object
          properties:
            creditnote_refund_id:
              $ref: '#/components/schemas/creditnote_refund_id'
            creditnote_id:
              $ref: '#/components/schemas/creditnote_id'
            date:
              $ref: '#/components/schemas/date'
            refund_mode:
              $ref: '#/components/schemas/refund_mode'
            payment_form:
              $ref: '#/components/schemas/payment_form'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            amount:
              $ref: '#/components/schemas/amount'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            description:
              $ref: '#/components/schemas/description'
    update-credit-note-refund-request:
      type: object
      properties:
        date:
          $ref: '#/components/schemas/date'
        refund_mode:
          $ref: '#/components/schemas/refund_mode'
        payment_form:
          $ref: '#/components/schemas/payment_form'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        amount:
          $ref: '#/components/schemas/amount'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        from_account_id:
          $ref: '#/components/schemas/from_account_id'
        description:
          $ref: '#/components/schemas/description'
    update-credit-note-refund-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The credit note refund is updated successfully.
          readOnly: true
        creditnote_refund:
          type: object
          properties:
            creditnote_refund_id:
              $ref: '#/components/schemas/creditnote_refund_id'
            creditnote_id:
              $ref: '#/components/schemas/creditnote_id'
            date:
              $ref: '#/components/schemas/date'
            refund_mode:
              $ref: '#/components/schemas/refund_mode'
            payment_form:
              $ref: '#/components/schemas/payment_form'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            amount:
              $ref: '#/components/schemas/amount'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            description:
              $ref: '#/components/schemas/description'
    delete-credit-note-refund-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The refund has been successfully deleted.
          readOnly: true
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoBooks.creditnotes.CREATE: Create Creditnotes
            ZohoBooks.creditnotes.UPDATE: Update Creditnotes
            ZohoBooks.creditnotes.READ: Read Creditnotes
            ZohoBooks.creditnotes.DELETE: Delete Creditnotes
