openapi: 3.0.0
info:
  title: 'Retainer Invoices'
  description: 'A retainer invoice is an advanced payment from a customer before we record any transaction with him.<br><br><b>Possible error codes: </b><br><table><thead><tr><th>Error Code</th><th>Message</th></tr></thead><tbody><tr><td><span style="color:#FF0000;"> 9520</span></td><td>Retainer Invoices for which payments have been recorded cannot be deleted</td></tr><tr><td><span style="color:#FF0000;"> 9533</span></td><td>Cannot modify Retainer Invoice amount, once the payment is recorded</td></tr></tbody></table>'
  contact: {}
  version: 1.0.0
servers:
  -
    url: 'https://www.zohoapis.com/invoice/v3'
    description: 'API Endpoint'
tags:
  -
    name: retainer-invoices
    description: 'Retainer-Invoices Module'
paths:
  /retainerinvoices:
    post:
      tags:
        - retainer-invoices
      operationId: 'create_retainer_invoice'
      summary: 'Create a retainer invoice'
      description: 'Create a retainer invoice for your customer.'
      parameters:
        -
          name: ignore_auto_number_generation
          in: query
          description: 'Ignore auto invoice number generation for this invoice. This mandates the invoice number. Allowed values <code>true</code> and <code>false</code>'
          required: false
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-a-retainer-invoice-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-a-retainer-invoice-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.CREATE
    get:
      tags:
        - retainer-invoices
      operationId: 'list_retainer_invoices'
      summary: 'List Retainer invoices'
      description: 'List all retainer invoices with pagination.'
      parameters:
        -
          name: print
          in: query
          description: 'Print the exported pdf.'
          required: false
          schema:
            type: boolean
        -
          name: sort_column
          in: query
          description: 'Sort retainer invoices.Allowed Values: <code>customer_name</code>, <code>retainer invoice_number</code>, <code>date</code>, <code> due_date</code>, <code>total</code>, <code>balance</code> and  <code>created_time</code>'
          required: false
          schema:
            type: string
          example: created_time
        -
          name: filter_by
          in: query
          description: 'Filter invoices by any status or payment expected date.Allowed Values: <code> Status.All</code>, <code>Status.Sent</code>, <code> Status.Draft</code>, <code>Status.OverDue</code>, <code>Status.Paid</code>, <code>Status.Void</code>, <code>Status.Unpaid</code>, <code>Status.PartiallyPaid</code>,<code> Status.Viewed</code> and <code>Date.PaymentExpectedDate</code>'
          required: false
          schema:
            type: string
          example: ""
        -
          name: sort_order
          in: query
          description: 'The order for sorting'
          required: false
          schema:
            type: string
          example: D
        -
          name: page
          in: query
          description: 'Number of pages'
          required: false
          schema:
            type: integer
          example: 1
        - name: per_page
          in: query
          description: 'Number of records to be fetched per page. Default value is 200.'
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-retainer-invoices-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.READ
    parameters:
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}':
    put:
      tags:
        - retainer-invoices
      operationId: 'update_retainer_invoice'
      summary: 'Update a retainer invoice'
      description: 'Update an existing invoice.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-a-retainer-invoice-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-a-retainer-invoice-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.UPDATE
    get:
      tags:
        - retainer-invoices
      operationId: 'get_retainer_invoice'
      summary: 'Get a retainer invoice'
      description: 'Get the details of a retainer invoice.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-a-retainer-invoice-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.READ
    delete:
      tags:
        - retainer-invoices
      operationId: 'delete_retainer_invoice'
      summary: 'Delete a retainer invoice'
      description: 'Delete an existing retainer invoice. Invoices which have payment or credits note applied cannot be deleted.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-a-retainer-invoice-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.DELETE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/status/sent':
    post:
      tags:
        - retainer-invoices
      operationId: 'mark_retainer_invoice_as_sent'
      summary: 'Mark a retainer invoice as sent'
      description: 'Mark a draft retainer invoice as sent.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mark-a-retainer-invoice-as-sent-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.CREATE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/templates/{template_id}':
    put:
      tags:
        - retainer-invoices
      operationId: 'update_retainer_invoice_template'
      summary: 'Update retainer invoice template'
      description: 'Update the pdf template associated with the retainer invoice.'
      parameters:
        -
          name: template_id
          in: path
          required: true
          description: 'Unique identifier of the retainer invoice template.'
          schema:
            type: string
          example: 982000000000143
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-retainer-invoice-template-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.UPDATE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/status/void':
    post:
      tags:
        - retainer-invoices
      operationId: 'mark_retainer_invoice_as_void'
      summary: 'Void a retainer invoice'
      description: 'Mark an invoice status as void. Upon voiding, the payments and credits associated with the retainer invoices will be unassociated and will be under customer credits.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/void-a-retainer-invoice-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.CREATE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{reatinerinvoice_id}/status/draft':
    post:
      tags:
        - retainer-invoices
      operationId: 'mark_retainer_invoice_as_draft'
      summary: 'Mark as draft'
      description: 'Mark a voided retainer invoice as draft.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mark-as-draft-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.CREATE
    parameters:
      -
        name: reatinerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: "982000000567114"
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/email':
    post:
      tags:
        - retainer-invoices
      operationId: 'email_retainer_invoice'
      summary: 'Email a retainer invoice'
      description: 'Email a retainer invoice to the customer. Input json string is not mandatory. If input json string is empty, mail will be send with default mail content.'
      parameters:
        -
          name: send_customer_statement
          in: query
          description: 'Send customer statement pdf a with email.'
          required: false
          schema:
            type: boolean
          example: ' '
        -
          name: send_attachment
          in: query
          description: 'Send the retainer invoice attachment a with the email.'
          required: false
          schema:
            type: boolean
          example: ' '
        -
          name: attachments
          in: query
          description: 'Files to be attached to the email'
          required: false
          schema:
            type: string
            format: binary
          example: ""
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/email-a-retainer-invoice-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/email-a-retainer-invoice-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.CREATE
    get:
      tags:
        - retainer-invoices
      operationId: 'get_retainer_invoice_email_content'
      summary: 'Get retainer invoice email content'
      description: 'Get the email content of a retainer invoice.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-retainer-invoice-email-content-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.READ
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/address/billing':
    put:
      tags:
        - retainer-invoices
      operationId: 'update_retainer_invoice_billing_address'
      summary: 'Update billing address'
      description: 'Updates the billing address for this retainer invoice 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:
            - ZohoInvoice.invoices.UPDATE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  /retainerinvoices/templates:
    get:
      tags:
        - retainer-invoices
      operationId: 'list_retainer_invoice_templates'
      summary: 'List retainer invoice templates'
      description: 'Get all retainer invoice pdf templates.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-retainer-invoice-templates-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.READ
    parameters:
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/attachment':
    get:
      tags:
        - retainer-invoices
      operationId: 'get_retainer_invoice_attachment'
      summary: 'Get a retainer invoice attachment'
      description: 'Returns the file attached to the retainer invoice.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-a-retainer-invoice-attachment-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.READ
    post:
      tags:
        - retainer-invoices
      operationId: 'add_retainer_invoice_attachment'
      summary: 'Add attachment to a retainer invoice'
      description: 'Attach a file to an invoice.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add-attachment-to-a-retainer-invoice-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add-attachment-to-a-retainer-invoice-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.CREATE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/documents/{document_id}':
    delete:
      tags:
        - retainer-invoices
      operationId: 'delete_retainer_invoice_attachment'
      summary: 'Delete an attachment'
      description: 'Delete the file attached to the retainer invoice.'
      parameters:
        -
          name: document_id
          in: path
          required: true
          description: 'Unique identifier of the retainer invoice document.'
          schema:
            type: string
          example: "982000000567115"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-an-attachment-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.DELETE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/comments':
    get:
      tags:
        - retainer-invoices
      operationId: 'list_retainer_invoice_comments'
      summary: 'List retainer invoice comments & history'
      description: 'Get the complete history and comments of a retainer invoice.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-retainer-invoice-comments-and-history-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.READ
    post:
      tags:
        - retainer-invoices
      operationId: 'add_retainer_invoice_comment'
      summary: 'Add comment'
      description: 'Add a comment for a retainer invoice.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add-comment-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add-comment-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.CREATE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
  '/retainerinvoices/{retainerinvoice_id}/comments/{comment_id}':
    delete:
      tags:
        - retainer-invoices
      operationId: 'delete_retainer_invoice_comment'
      summary: 'Delete a comment'
      description: 'Delete a retainer invoice comment.'
      parameters:
        -
          name: comment_id
          in: path
          required: true
          description: 'Unique identifier of the comment.'
          schema:
            type: string
          example: 982000000567019
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-a-comment-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.DELETE
    put:
      tags:
        - retainer-invoices
      operationId: 'update_retainer_invoice_comment'
      summary: 'Update comment'
      description: 'Update an existing comment of a retainer invoice.'
      parameters:
        -
          name: comment_id
          in: path
          required: true
          description: 'Unique identifier of the comment.'
          schema:
            type: string
          example: 982000000567019
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-comment-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-comment-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInvoice.invoices.UPDATE
    parameters:
      -
        name: retainerinvoice_id
        in: path
        required: true
        description: 'Unique identifier of the retainer invoice.'
        schema:
          type: string
        example: 982000000567114
      -
        $ref: '#/components/parameters/organization_id'
components:
  parameters:
    organization_id:
      name: X-com-zoho-invoice-organizationid
      description: 'ID of the organization'
      in: header
      required: true
      schema:
        type: string
      example: '10234695'
  schemas:
    gendoc-attributes-schema:
      $ref: '#/components/schemas/retainerinvoices-response'
    retainerinvoices-response:
      type: object
      properties:
        retainerinvoice_id:
          $ref: '#/components/schemas/retainerinvoice_id'
        retainerinvoice_number:
          $ref: '#/components/schemas/retainerinvoice_number'
        date:
          $ref: '#/components/schemas/date'
        status:
          $ref: '#/components/schemas/status'
        is_pre_gst:
          $ref: '#/components/schemas/is_pre_gst'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        project_id:
          $ref: '#/components/schemas/project_id'
        project_name:
          $ref: '#/components/schemas/project_name'
        last_payment_date:
          $ref: '#/components/schemas/last_payment_date'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        customer_id:
          $ref: '#/components/schemas/customer_id'
        customer_name:
          $ref: '#/components/schemas/customer_name'
        contact_persons:
          $ref: '#/components/schemas/contact_persons'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        currency_symbol:
          $ref: '#/components/schemas/currency_symbol'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        is_viewed_by_client:
          $ref: '#/components/schemas/is_viewed_by_client'
        client_viewed_time:
          $ref: '#/components/schemas/client_viewed_time'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        line_items:
          description: 'Line items of a retainer invoice.'
          type: array
          items:
            type: object
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              description:
                $ref: '#/components/schemas/description'
              item_order:
                $ref: '#/components/schemas/item_order'
              rate:
                $ref: '#/components/schemas/rate'
              bcy_rate:
                $ref: '#/components/schemas/bcy_rate'
              tax_id:
                $ref: '#/components/schemas/tax_id'
              tax_name:
                $ref: '#/components/schemas/tax_name'
              tax_type:
                $ref: '#/components/schemas/tax_type'
              tax_percentage:
                $ref: '#/components/schemas/tax_percentage'
              item_total:
                $ref: '#/components/schemas/item_total'
        sub_total:
          $ref: '#/components/schemas/sub_total'
        total:
          $ref: '#/components/schemas/total'
        taxes:
          $ref: '#/components/schemas/taxes'
        payment_made:
          $ref: '#/components/schemas/payment_made'
        payment_drawn:
          $ref: '#/components/schemas/payment_drawn'
        balance:
          $ref: '#/components/schemas/balance'
        allow_partial_payments:
          $ref: '#/components/schemas/allow_partial_payments'
        price_precision:
          $ref: '#/components/schemas/price_precision'
        payment_options:
          $ref: '#/components/schemas/payment_options'
        is_emailed:
          $ref: '#/components/schemas/is_emailed'
        documents:
          $ref: '#/components/schemas/documents'
        billing_address:
          $ref: '#/components/schemas/billing_address'
        shipping_address:
          $ref: '#/components/schemas/shipping_address'
        notes:
          $ref: '#/components/schemas/notes'
        terms:
          $ref: '#/components/schemas/terms'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        template_id:
          $ref: '#/components/schemas/template_id'
        template_name:
          $ref: '#/components/schemas/template_name'
        page_width:
          $ref: '#/components/schemas/page_width'
        page_height:
          $ref: '#/components/schemas/page_height'
        orientation:
          $ref: '#/components/schemas/orientation'
        template_type:
          $ref: '#/components/schemas/template_type'
        created_time:
          $ref: '#/components/schemas/created_time'
        last_modified_time:
          $ref: '#/components/schemas/last_modified_time'
        created_by_id:
          $ref: '#/components/schemas/created_by_id'
        attachment_name:
          $ref: '#/components/schemas/attachment_name'
        can_send_in_mail:
          $ref: '#/components/schemas/can_send_in_mail'
        invoice_url:
          $ref: '#/components/schemas/invoice_url'
    page:
      description: 'Number of pages'
      type: integer
      example: 1
    per_page:
      description: 'Per page values'
      type: integer
      example: 200
    report_name:
      description: 'The report name'
      type: string
      example: 'Retainer Invoices'
    has_more_page:
      description: 'Check if there are more pages'
      type: boolean
      example: false
    sort_order:
      description: 'The order for sorting'
      type: string
      example: D
    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)'
      type: string
      example: TN
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    is_pre_gst:
      description: 'Applicable for transactions that fall before july 1, 2017'
      type: string
      example: false
    project_id:
      description: 'ID of the project'
      type: string
      example: 982000000567154
    project_name:
      description: 'Name of the project'
      type: string
    street2:
      type: string
      example: 'McMillan Avenue'
    sort_column:
      description: 'Sort retainer invoices.Allowed Values: <code>customer_name</code>, <code>retainer invoice_number</code>, <code>date</code>, <code> due_date</code>, <code>total</code>, <code>balance</code> and  <code>created_time</code>'
      type: string
      example: created_time
    applied_filter:
      description: 'The filer applied for sorting'
      type: string
      example: Status.All
    retainerinvoice_id:
      description: 'The id of the retainerinvoice'
      type: string
      example: 982000000567114
    retainerinvoice_number:
      description: 'number of the retainer invoice.'
      type: string
      example: RET-00003
    customer_name:
      description: 'The name of the customer. <code>Maximum length [100]</code>'
      type: string
      example: 'Bowman & Co'
    customer_id:
      description: 'ID of the customer the retainer invoice has to be created.'
      type: string
      example: 982000000567001
    status:
      description: 'retainer invoice status.Allowed Values: <code>sent</code>, <code>draft</code>, <code>overdue</code>, <code>paid</code>, <code>void</code>, <code>unpaid</code>, <code>partially_paid</code> and <code>viewed</code>'
      type: string
      example: draft
    reference_number:
      description: 'The reference number of the retainer invoice. <code>Maximum length [100]</code>'
      type: string
      example: ' '
    date:
      description: 'The date of creation of the retainer invoice.'
      type: string
      example: '2013-11-17'
    project_or_estimate_name:
      type: string
      example: 'new project'
    currency_id:
      description: 'The currenct id of the currency'
      type: string
      example: 982000000000190
    currency_code:
      description: 'The currency code in which the retainer invoice is created.'
      type: string
      example: USD
    currency_symbol:
      description: 'The currency symbol in which the retainer invoice is created.'
      type: string
      example: USD
    total:
      description: 'The total amount to be paid'
      type: string
      example: 40.6
    balance:
      description: 'The unpaid amount'
      type: string
      example: 40.6
    created_time:
      description: 'The time of creation of the retainer invoice'
      type: string
      example: '2013-11-17T02:31:51-0800'
    last_modified_time:
      description: 'The time of last modification of the retainer invoice'
      type: string
      example: '2013-12-18T02:31:51-0800'
    is_emailed:
      description: 'Boolean check to if the email was sent'
      type: string
      example: false
    last_payment_date:
      description: 'The last payment date of the retainer invoice'
      type: string
      example: ' '
    has_attachment:
      description: 'Boolean retainer invoice has attachment'
      type: boolean
      example: true
    is_viewed_by_client:
      description: 'Boolean is retainer invoice viewed by client in client portal.'
      type: boolean
      example: true
    client_viewed_time:
      description: 'client viewed time for retainer invoice in client portal.'
      type: boolean
      example: true
    contact_persons:
      description: 'The conatct persons associated with the contact.'
      type: array
      items:
        type: string
      example:
        - '982000000567003'
        - '982000000567003'
    notes:
      description: 'The notes added below expressing gratitude or for conveying some information.'
      type: string
      example: 'Looking forward for your business.'
    terms:
      description: 'The terms added below expressing gratitude or for conveying some information.'
      type: string
      example: 'Terms & Conditions apply'
    description:
      description: 'The description of the line items. <code>Maximum length [2000]</code>'
      type: string
      example: '500GB, USB 2.0 interface 1400 rpm, protective hard case.'
    item_order:
      description: 'The order of the line item_order'
      type: integer
      example: 1
    rate:
      description: 'Rate of the line item.'
      type: number
      format: double
      example: 120
    bcy_rate:
      description: 'base currency rate'
      type: number
      format: double
      example: 120
    template_id:
      description: 'ID of the pdf template associated with the retainer invoice.'
      type: string
      example: 982000000000143
    configured:
      description: 'Boolean check to see if a payment gateway ahs been configured'
      type: boolean
      example: true
    additional_field1:
      description: 'Paypal payment method. Allowed Values: <code>standard</code> and <code>adaptive</code>'
      type: string
      example: standard
    gateway_name:
      description: 'Name of the payment gateway associated with the retainer invoice. E.g. paypal, stripe.Allowed Values: <code>paypal</code>, <code>authorize_net</code>, <code>payflow_pro</code>, <code>stripe</code>, <code>2checkout</code> and <code>braintree</code>'
      type: string
      example: paypal
    payment_gateways:
      description: 'Online payment gateways through which payment can be made.'
      type: array
      items:
        type: object
        properties:
          gateway_name:
            $ref: '#/components/schemas/gateway_name'
    payment_options:
      description: 'Payment options for the retainer invoice, online payment gateways and bank accounts. Will be displayed in the pdf.'
      type: object
      properties:
        payment_gateways:
          $ref: '#/components/schemas/payment_gateways'
    customfield_id:
      description: 'Unique ID of the custom field'
      type: integer
      format: int64
      example: 439910000000236000
    data_type:
      description: 'Data type of the custom field'
      type: string
      example: number
    label:
      description: 'Name of the custom field'
      type: string
      example: 'Record Number'
    show_on_pdf:
      description: 'Enable/Disable show this custom field on pdf for that invoice'
      type: boolean
      example: true
    show_in_all_pdf:
      description: 'Enable/Disable show this custom field on all the pdf'
      example: true
    value:
      description: 'Value of the custom field'
      type: integer
      example: 23
    index:
      description: 'The index of the custom field'
      type: integer
      example: 1
    custom_fields:
      description: 'Custom fields for a retainer invoice.'
      type: array
      items:
        type: object
        properties:
          customfield_id:
            $ref: '#/components/schemas/customfield_id'
          data_type:
            $ref: '#/components/schemas/data_type'
          index:
            $ref: '#/components/schemas/index'
          label:
            $ref: '#/components/schemas/label'
          show_on_pdf:
            $ref: '#/components/schemas/show_on_pdf'
          show_in_all_pdf:
            $ref: '#/components/schemas/show_in_all_pdf'
          value:
            $ref: '#/components/schemas/value'
    exchange_rate:
      description: 'Exchange rate of the currency.'
      type: number
      format: float
      example: 1
    is_inclusive_tax:
      description: 'To check if the total amount is inclusive of tax'
      type: boolean
      example: false
    sub_total:
      description: 'The sub total of the all items'
      type: number
      format: float
      example: 153
    taxes:
      description: 'List of the taxes levied'
      type: array
      items:
        type: object
        properties:
          tax_name:
            $ref: '#/components/schemas/tax_name'
          tax_amount:
            $ref: '#/components/schemas/tax_amount'
    payment_made:
      description: 'The amount paid'
      type: number
      format: float
      example: 26.91
    payment_drawn:
      description: 'The amount drawn'
      type: number
      format: float
      example: 26.91
    allow_partial_payments:
      description: 'Boolean to check if partial payments are allowed for the contact'
      type: boolean
      example: true
    price_precision:
      description: 'The precision value on the price'
      type: integer
      example: 2
    documents:
      description: 'documents attached to the retainer invoice'
      type: array
      items:
        type: string
      example: []
    address:
      description: 'Organisation''s Billing address'
      type: string
      example: 'Suite 125, McMillan Avenue'
    city:
      description: 'City of Organisation''s billing address'
      type: string
      example: 'San Francisco'
    state:
      description: 'State where organisation''s billing location is mentioned'
      type: string
      example: CA
    zip:
      description: 'ZIP of organisation''s billing address'
      type: string
      example: 94134
    country:
      description: 'Country of organisation''s billing address'
      type: string
      example: U.S.A
    fax:
      description: 'FAX number of organisation''s billing address'
      type: string
      example: +86-10-82637827
    billing_address:
      description: 'Organisation''s 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:
      description: 'Organisation''s 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'
    template_name:
      description: 'Name of template used by organisation'
      type: string
      example: 'Service - Classic'
    page_width:
      description: 'Width of page of contents'
      type: string
      example: 8.27in
    page_height:
      description: 'Height of page of contents'
      type: string
      example: 11.69in
    orientation:
      description: 'Page orientation'
      type: string
      example: portrait
    template_type:
      description: 'The type of template type'
      type: string
      example: classic
    created_by_id:
      description: 'Filted by ID of comment'
      type: string
      example: 14909000000072000
    attachment_name:
      description: 'name of file attached'
      type: string
      example: 'new file'
    can_send_in_mail:
      description: 'Check if attachment can be sent via mail'
      type: boolean
      example: true
    invoice_url:
      description: 'Url link of invoice'
      type: string
      example: 'https://invoice.zoho.com/portal/zylkar/secure?CInvoiceID=23d84d0cf64f9a72ea0c66fded25a08c8bafd0ab508aff05323a9f80e2cd03fdc5dd568d3d6407bbda969d3e870d740b6fce549a9438c4ea'
    line_item_id:
      description: 'The line item ID'
      type: string
      example: 982000000567021
    item_total:
      description: 'The total amount of the line items'
      type: number
      format: float
      example: 120
    tax_percentage:
      description: 'The  percentage of tax levied'
      type: number
      format: float
      example: 12.5
    tax_id:
      description: 'ID of the tax or tax group applied to the estimate'
      type: string
      example: 982000000557028
    tax_name:
      description: 'The name of the tax'
      type: string
      example: VAT
    tax_amount:
      description: 'The amount of the tax levied'
      type: number
      format: float
      example: 19.13
    tax_type:
      description: 'The type of the tax'
      type: string
      example: tax
    cc_mail_ids:
      description: 'Array of email address of the recipients to be CC''d.'
      type: array
      items:
        type: string
      example:
        - test@zylker.org
    to_mail_ids:
      description: 'Array of email address of the recipients.'
      type: array
      items:
        type: string
      example:
        - test@zylker.org
    subject:
      description: 'The subject of the mail'
      type: string
      example: 'Retainer Invoice from Zillium Inc (Retainer Invoice#: RET-00001)'
    send_customer_statement:
      description: 'Send customer statement pdf a with email.'
      type: boolean
      example: ' '
    send_attachment:
      description: 'Send the retainer invoice attachment a with the email.'
      type: boolean
      example: ' '
    attachment:
      description: 'The file to be attached. It has to be sent in multipart/formdata'
      type: string
      format: binary
    send_from_org_email_id:
      description: 'Boolean to trigger the email from the organization''s email address'
      type: boolean
      example: false
    body:
      description: 'The body of the mail'
      type: string
      example: 'Dear Customer,         <br><br><br><br>Thanks for your business.         <br><br><br><br>The retainer invoice RET-00001 is attached with this email. You can choose the easy way out and <a href= https://invoice.zoho.com/portal/zylkar/secure?CInvoiceID=b9800228e011ae86abe71227bdacb3c68e1af685f647dcaed747812e0b9314635e55ac6223925675b371fcbd2d5ae3dc  >pay online for this invoice.</a>         <br><br>Here''s an overview of the invoice for your reference.         <br><br><br><br>Invoice Overview:         <br><br>Invoice  : INV-00001         <br><br>Date : 05 Aug 2013         <br><br>Amount : $541.82         <br><br><br><br>It was great working with you. Looking forward to working with you again.<br><br><br>\nRegards<br>\nZillium Inc<br>\n",'
    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
    gateways_configured:
      description: 'Payment gateways configured with the organisation'
      type: boolean
      example: true
    deprecated_placeholders_used:
      description: 'Place holders specified, if any.'
      type: array
      items:
        type: string
      example: []
    error_list:
      description: 'error List'
      type: array
      items:
        type: string
      example: []
    file_name:
      description: 'Name of attachment'
      type: string
      example: RET-00001.pdf
    first_name:
      description: 'First name of the contact person'
      type: string
      example: Will
    selected:
      type: string
      example: false
    phone:
      description: 'Contact number of the organisation'
      type: string
      example: '1234'
    email:
      description: 'Search retainer invoices by customer contact persons email. <code>Maximum length [100]</code>'
      type: string
      example: test@zylker.org
    last_name:
      description: 'Last name of the conatct'
      type: string
      example: Smith
    salutation:
      description: 'Salutation of the contact'
      type: string
      example: Mr
    contact_person_id:
      description: 'Unique ID of the contact person'
      type: string
      example: 982000000567003
    mobile:
      description: 'Mobile number of the contact person'
      type: string
      example: '1234'
    user_name:
      description: 'User name of the account'
      type: array
      items:
        type: string
      example: 'John Smith'
    payment_id:
      description: 'Unique ID of payment'
      type: string
      example: '982000000567190'
    payment_number:
      description: 'Serial number of payment'
      type: integer
      example: 7
    is_client_review_settings_enabled:
      description: 'To check if client is enabled access to review in portal'
      type: boolean
      example: true
    unused_amount:
      description: 'Unused retainer amount'
      type: number
      format: double
      example: 100
    amount:
      description: 'Total amount we hold'
      type: number
      format: double
      example: 100
    bank_charges:
      description: 'Bank charges for the transaction'
      type: number
      format: double
      example: 20
    tax_amount_withheld:
      description: 'Amount help (deducted) for future tax'
      type: number
      format: double
      example: 10
    discount_amount:
      description: 'Total discount value'
      type: number
      format: double
      example: 10
    online_transaction_id:
      description: 'Unoque ID for the online transaction'
      type: string
      example: '7843653940324085'
    retainerinvoice_total:
      description: 'Total amount of retainer invoice'
      type: number
      format: double
      example: 3478
    retainerinvoice_balance:
      description: 'Balance remaining from the advance payment'
      type: number
      format: double
      example: 3478
    invoices:
      description: 'list of invoices'
      type: array
      items:
        type: string
      example: []
    retainerinvoice_date:
      description: 'date of issuance of retainer invoice'
      type: string
      example: '2016-12-20'
    payment_refunds:
      description: 'Refund of payments'
      type: array
      items:
        type: string
      example: []
    last_four_digits:
      description: 'Last four digits of number'
      type: string
      example: ""
    html_string:
      description: 'HTML string'
      type: string
      example: ""
    is_payment_drawn_details_required:
      description: 'If payment usage details are required'
      type: boolean
      example: true
    payment_mode:
      description: 'Mode of payment of retianer'
      type: string
      example: cash
    preview:
      description: 'Get the thumbnail of the attachment.'
      type: boolean
    comment_id:
      description: 'The id of the comment id'
      type: string
      example: 982000000567019
    commented_by_id:
      description: 'Filter to view comment by ID'
      type: string
      example: 982000000554041
    comment_type:
      description: 'Comment type'
      type: string
      example: system
    commented_by:
      description: 'Individual who added a comment'
      type: string
      example: 'John David'
    date_description:
      description: 'Number of days since the comments were made'
      type: string
      example: yesterday
    time:
      description: 'Time of the comment'
      type: string
      example: '2:38 AM'
    operation_type:
      description: 'Type of operation performed with the retainer'
      type: string
      example: Added
    transaction_id:
      description: 'Unique ID of the transaction'
      type: string
      example: '982000000567204'
    transaction_type:
      description: 'Type of the transaction'
      type: string
      example: retainer_payment
    payment_expected_date:
      description: 'Actual date when payment is expected to be cedited'
      type: string
      example: ' '
    show_comment_to_clients:
      description: 'Boolean to check if the comment to be shown to the clients'
      type: boolean
      example: true
    ignore_auto_number_generation:
      description: 'Ignore auto invoice number generation for this invoice. This mandates the invoice number. Allowed values <code>true</code> and <code>false</code>'
      type: boolean
    print:
      description: 'Print the exported pdf.'
      type: boolean
    attachments:
      description: 'Files to be attached to the email'
      type: string
      format: binary
    filter_by:
      description: 'Filter invoices by any status or payment expected date.Allowed Values: <code> Status.All</code>, <code>Status.Sent</code>, <code> Status.Draft</code>, <code>Status.OverDue</code>, <code>Status.Paid</code>, <code>Status.Void</code>, <code>Status.Unpaid</code>, <code>Status.PartiallyPaid</code>,<code> Status.Viewed</code> and <code>Date.PaymentExpectedDate</code>'
      type: string
      example: ' '
    line_items:
      description: 'Line items of an invoice.'
      type: array
      items:
        type: object
        properties:
          line_item_id:
            $ref: '#/components/schemas/line_item_id'
          description:
            $ref: '#/components/schemas/description'
          item_order:
            $ref: '#/components/schemas/item_order'
          rate:
            $ref: '#/components/schemas/rate'
          bcy_rate:
            $ref: '#/components/schemas/bcy_rate'
          tax_id:
            $ref: '#/components/schemas/tax_id'
          tax_name:
            $ref: '#/components/schemas/tax_name'
          tax_type:
            $ref: '#/components/schemas/tax_type'
          tax_percentage:
            $ref: '#/components/schemas/tax_percentage'
          item_total:
            $ref: '#/components/schemas/item_total'
    create-a-retainer-invoice-request:
      required:
        - customer_id
        - line_items
      type: object
      properties:
        customer_id:
          $ref: '#/components/schemas/customer_id'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        date:
          $ref: '#/components/schemas/date'
        contact_persons:
          $ref: '#/components/schemas/contact_persons'
        custom_fields:
          description: 'Custom fields for a retainer invoice.'
          type: array
          items:
            type: object
            properties:
              label:
                $ref: '#/components/schemas/label'
              value:
                $ref: '#/components/schemas/value'
        notes:
          $ref: '#/components/schemas/notes'
        terms:
          $ref: '#/components/schemas/terms'
        line_items:
          description: 'Line items of an invoice.'
          type: array
          items:
            type: object
            properties:
              description:
                $ref: '#/components/schemas/description'
              item_order:
                $ref: '#/components/schemas/item_order'
              rate:
                $ref: '#/components/schemas/rate'
        payment_options:
          $ref: '#/components/schemas/payment_options'
        template_id:
          $ref: '#/components/schemas/template_id'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
    create-a-retainer-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'The retainer invoice has been created.'
          readOnly: true
        retainerinvoices:
          $ref: '#/components/schemas/retainerinvoices-response'
    list-retainer-invoices-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        retainerinvoices:
          type: array
          items:
            type: object
            properties:
              retainerinvoice_id:
                $ref: '#/components/schemas/retainerinvoice_id'
              customer_name:
                $ref: '#/components/schemas/customer_name'
              retainerinvoice_number:
                $ref: '#/components/schemas/retainerinvoice_number'
              customer_id:
                $ref: '#/components/schemas/customer_id'
              status:
                $ref: '#/components/schemas/status'
              reference_number:
                $ref: '#/components/schemas/reference_number'
              project_or_estimate_name:
                $ref: '#/components/schemas/project_or_estimate_name'
              date:
                $ref: '#/components/schemas/date'
              currency_id:
                $ref: '#/components/schemas/currency_id'
              currency_code:
                $ref: '#/components/schemas/currency_code'
              is_viewed_by_client:
                $ref: '#/components/schemas/is_viewed_by_client'
              client_viewed_time:
                $ref: '#/components/schemas/client_viewed_time'
              total:
                $ref: '#/components/schemas/total'
              balance:
                $ref: '#/components/schemas/balance'
              created_time:
                $ref: '#/components/schemas/created_time'
              last_modified_time:
                $ref: '#/components/schemas/last_modified_time'
              is_emailed:
                $ref: '#/components/schemas/is_emailed'
              last_payment_date:
                $ref: '#/components/schemas/last_payment_date'
              has_attachment:
                $ref: '#/components/schemas/has_attachment'
    update-a-retainer-invoice-request:
      required:
        - customer_id
        - line_items
      type: object
      properties:
        customer_id:
          $ref: '#/components/schemas/customer_id'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        date:
          $ref: '#/components/schemas/date'
        contact_persons:
          $ref: '#/components/schemas/contact_persons'
        custom_fields:
          description: 'Custom fields for a retainer invoice.'
          type: array
          items:
            type: object
            properties:
              label:
                $ref: '#/components/schemas/label'
              value:
                $ref: '#/components/schemas/value'
        notes:
          $ref: '#/components/schemas/notes'
        terms:
          $ref: '#/components/schemas/terms'
        line_items:
          description: 'Line items of a retainer invoice.'
          type: array
          items:
            type: object
            properties:
              description:
                $ref: '#/components/schemas/description'
              item_order:
                $ref: '#/components/schemas/item_order'
              rate:
                $ref: '#/components/schemas/rate'
        payment_options:
          $ref: '#/components/schemas/payment_options'
        template_id:
          $ref: '#/components/schemas/template_id'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        project_id:
          $ref: '#/components/schemas/project_id'
    update-a-retainer-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Retainer Invoice information has been updated.'
          readOnly: true
        retainerinvoices:
          type: object
          properties:
            retainerinvoice_id:
              $ref: '#/components/schemas/retainerinvoice_id'
            retainerinvoice_number:
              $ref: '#/components/schemas/retainerinvoice_number'
            date:
              $ref: '#/components/schemas/date'
            status:
              $ref: '#/components/schemas/status'
            is_pre_gst:
              $ref: '#/components/schemas/is_pre_gst'
            place_of_supply:
              $ref: '#/components/schemas/place_of_supply'
            project_id:
              $ref: '#/components/schemas/project_id'
            project_name:
              $ref: '#/components/schemas/project_name'
            last_payment_date:
              $ref: '#/components/schemas/last_payment_date'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            customer_id:
              $ref: '#/components/schemas/customer_id'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            contact_persons:
              $ref: '#/components/schemas/contact_persons'
            currency_id:
              $ref: '#/components/schemas/currency_id'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            currency_symbol:
              $ref: '#/components/schemas/currency_symbol'
            exchange_rate:
              $ref: '#/components/schemas/exchange_rate'
            is_viewed_by_client:
              $ref: '#/components/schemas/is_viewed_by_client'
            client_viewed_time:
              $ref: '#/components/schemas/client_viewed_time'
            is_inclusive_tax:
              $ref: '#/components/schemas/is_inclusive_tax'
            line_items:
              description: 'Line items of an invoice.'
              type: array
              items:
                type: object
                properties:
                  line_item_id:
                    $ref: '#/components/schemas/line_item_id'
                  description:
                    $ref: '#/components/schemas/description'
                  item_order:
                    $ref: '#/components/schemas/item_order'
                  rate:
                    $ref: '#/components/schemas/rate'
                  bcy_rate:
                    $ref: '#/components/schemas/bcy_rate'
                  tax_id:
                    $ref: '#/components/schemas/tax_id'
                  tax_name:
                    $ref: '#/components/schemas/tax_name'
                  tax_type:
                    $ref: '#/components/schemas/tax_type'
                  tax_percentage:
                    $ref: '#/components/schemas/tax_percentage'
                  item_total:
                    $ref: '#/components/schemas/item_total'
            sub_total:
              $ref: '#/components/schemas/sub_total'
            total:
              $ref: '#/components/schemas/total'
            taxes:
              $ref: '#/components/schemas/taxes'
            payment_made:
              $ref: '#/components/schemas/payment_made'
            payment_drawn:
              $ref: '#/components/schemas/payment_drawn'
            balance:
              $ref: '#/components/schemas/balance'
            allow_partial_payments:
              $ref: '#/components/schemas/allow_partial_payments'
            price_precision:
              $ref: '#/components/schemas/price_precision'
            payment_options:
              $ref: '#/components/schemas/payment_options'
            is_emailed:
              $ref: '#/components/schemas/is_emailed'
            documents:
              $ref: '#/components/schemas/documents'
            billing_address:
              $ref: '#/components/schemas/billing_address'
            shipping_address:
              $ref: '#/components/schemas/shipping_address'
            notes:
              $ref: '#/components/schemas/notes'
            terms:
              $ref: '#/components/schemas/terms'
            custom_fields:
              $ref: '#/components/schemas/custom_fields'
            template_id:
              $ref: '#/components/schemas/template_id'
            template_name:
              $ref: '#/components/schemas/template_name'
            page_width:
              $ref: '#/components/schemas/page_width'
            page_height:
              $ref: '#/components/schemas/page_height'
            orientation:
              $ref: '#/components/schemas/orientation'
            template_type:
              $ref: '#/components/schemas/template_type'
            created_time:
              $ref: '#/components/schemas/created_time'
            last_modified_time:
              $ref: '#/components/schemas/last_modified_time'
            created_by_id:
              $ref: '#/components/schemas/created_by_id'
            attachment_name:
              $ref: '#/components/schemas/attachment_name'
            can_send_in_mail:
              $ref: '#/components/schemas/can_send_in_mail'
            invoice_url:
              $ref: '#/components/schemas/invoice_url'
    get-a-retainer-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        retainerinvoice:
          type: object
          properties:
            retainerinvoice_id:
              $ref: '#/components/schemas/retainerinvoice_id'
            retainerinvoice_number:
              $ref: '#/components/schemas/retainerinvoice_number'
            date:
              $ref: '#/components/schemas/date'
            status:
              $ref: '#/components/schemas/status'
            is_pre_gst:
              $ref: '#/components/schemas/is_pre_gst'
            place_of_supply:
              $ref: '#/components/schemas/place_of_supply'
            project_id:
              $ref: '#/components/schemas/project_id'
            project_name:
              $ref: '#/components/schemas/project_name'
            last_payment_date:
              $ref: '#/components/schemas/last_payment_date'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            customer_id:
              $ref: '#/components/schemas/customer_id'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            contact_persons:
              $ref: '#/components/schemas/contact_persons'
            currency_id:
              $ref: '#/components/schemas/currency_id'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            currency_symbol:
              $ref: '#/components/schemas/currency_symbol'
            exchange_rate:
              $ref: '#/components/schemas/exchange_rate'
            is_viewed_by_client:
              $ref: '#/components/schemas/is_viewed_by_client'
            client_viewed_time:
              $ref: '#/components/schemas/client_viewed_time'
            is_inclusive_tax:
              $ref: '#/components/schemas/is_inclusive_tax'
            line_items:
              description: 'Line items of a retainer invoice.'
              type: object
              properties:
                line_item_id:
                  $ref: '#/components/schemas/line_item_id'
                description:
                  $ref: '#/components/schemas/description'
                item_order:
                  $ref: '#/components/schemas/item_order'
                rate:
                  $ref: '#/components/schemas/rate'
                bcy_rate:
                  $ref: '#/components/schemas/bcy_rate'
                tax_id:
                  $ref: '#/components/schemas/tax_id'
                tax_name:
                  $ref: '#/components/schemas/tax_name'
                tax_type:
                  $ref: '#/components/schemas/tax_type'
                tax_percentage:
                  $ref: '#/components/schemas/tax_percentage'
                item_total:
                  $ref: '#/components/schemas/item_total'
            sub_total:
              $ref: '#/components/schemas/sub_total'
            total:
              $ref: '#/components/schemas/total'
            taxes:
              $ref: '#/components/schemas/taxes'
            payment_made:
              $ref: '#/components/schemas/payment_made'
            payment_drawn:
              $ref: '#/components/schemas/payment_drawn'
            balance:
              $ref: '#/components/schemas/balance'
            allow_partial_payments:
              $ref: '#/components/schemas/allow_partial_payments'
            price_precision:
              $ref: '#/components/schemas/price_precision'
            payment_options:
              $ref: '#/components/schemas/payment_options'
            is_emailed:
              $ref: '#/components/schemas/is_emailed'
            documents:
              $ref: '#/components/schemas/documents'
            billing_address:
              $ref: '#/components/schemas/billing_address'
            shipping_address:
              $ref: '#/components/schemas/shipping_address'
            notes:
              $ref: '#/components/schemas/notes'
            terms:
              $ref: '#/components/schemas/terms'
            custom_fields:
              $ref: '#/components/schemas/custom_fields'
            template_id:
              $ref: '#/components/schemas/template_id'
            template_name:
              $ref: '#/components/schemas/template_name'
            page_width:
              $ref: '#/components/schemas/page_width'
            page_height:
              $ref: '#/components/schemas/page_height'
            orientation:
              $ref: '#/components/schemas/orientation'
            template_type:
              $ref: '#/components/schemas/template_type'
            created_time:
              $ref: '#/components/schemas/created_time'
            last_modified_time:
              $ref: '#/components/schemas/last_modified_time'
            created_by_id:
              $ref: '#/components/schemas/created_by_id'
            attachment_name:
              $ref: '#/components/schemas/attachment_name'
            can_send_in_mail:
              $ref: '#/components/schemas/can_send_in_mail'
            invoice_url:
              $ref: '#/components/schemas/invoice_url'
    delete-a-retainer-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'The retainer invoice has been deleted.'
          readOnly: true
    mark-a-retainer-invoice-as-sent-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Retainer Invoice status has been changed to Sent.'
          readOnly: true
    update-retainer-invoice-template-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Retainer Invoice information has been updated.'
          readOnly: true
    void-a-retainer-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Retainer Invoice status has been changed to ''Void''.'
          readOnly: true
    mark-as-draft-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Status of retainer invoice changed from void to draft.'
          readOnly: true
    email-a-retainer-invoice-request:
      required:
        - to_mail_ids
        - body
        - subject
      type: object
      properties:
        send_from_org_email_id:
          $ref: '#/components/schemas/send_from_org_email_id'
        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-retainer-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Your retainer invoice has been sent.'
          readOnly: true
    get-retainer-invoice-email-content-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        gateways_configured:
          $ref: '#/components/schemas/gateways_configured'
        deprecated_placeholders_used:
          $ref: '#/components/schemas/deprecated_placeholders_used'
        body:
          $ref: '#/components/schemas/body'
        error_list:
          $ref: '#/components/schemas/error_list'
        subject:
          $ref: '#/components/schemas/subject'
        to_contacts:
          description: 'Recepients of teh email'
          type: array
          items:
            type: object
            properties:
              first_name:
                $ref: '#/components/schemas/first_name'
              selected:
                $ref: '#/components/schemas/selected'
              phone:
                $ref: '#/components/schemas/phone'
              email:
                $ref: '#/components/schemas/email'
              last_name:
                $ref: '#/components/schemas/last_name'
              salutation:
                $ref: '#/components/schemas/salutation'
              contact_person_id:
                $ref: '#/components/schemas/contact_person_id'
              mobile:
                $ref: '#/components/schemas/mobile'
        attachment_name:
          $ref: '#/components/schemas/attachment_name'
        email_template_id:
          $ref: '#/components/schemas/email_template_id'
        file_name:
          $ref: '#/components/schemas/file_name'
        from_emails:
          description: 'Senders of teh email'
          type: array
          items:
            type: object
            properties:
              user_name:
                $ref: '#/components/schemas/user_name'
              selected:
                $ref: '#/components/schemas/selected'
              email:
                $ref: '#/components/schemas/email'
        customer_id:
          $ref: '#/components/schemas/customer_id'
    update-billing-address-request:
      type: object
      properties:
        address:
          description: 'address of the customer'
          type: string
          example: "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District"
        city:
          description: 'city of the customer'
          type: string
          example: Beijing
        state:
          description: 'state of the customer'
          type: string
          example: Beijing
        zip:
          description: 'zip of the customer'
          type: string
          example: 1000881
        country:
          description: 'country of the customer'
          type: string
        fax:
          description: 'fax of the customer'
          type: string
          example: +86-10-82637827
    update-billing-address-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Billing address updated'
          readOnly: true
    list-retainer-invoice-templates-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'
    list-retainer-payments-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        payments:
          type: array
          items:
            type: object
            properties:
              payment_id:
                $ref: '#/components/schemas/payment_id'
              documents:
                $ref: '#/components/schemas/documents'
              customer_id:
                $ref: '#/components/schemas/customer_id'
              customer_name:
                $ref: '#/components/schemas/customer_name'
              retainerinvoice_id:
                $ref: '#/components/schemas/retainerinvoice_id'
              payment_mode:
                $ref: '#/components/schemas/payment_mode'
              date:
                $ref: '#/components/schemas/date'
              currency_id:
                $ref: '#/components/schemas/currency_id'
              currency_code:
                $ref: '#/components/schemas/currency_code'
              exchange_rate:
                $ref: '#/components/schemas/exchange_rate'
              amount:
                $ref: '#/components/schemas/amount'
              unused_amount:
                $ref: '#/components/schemas/unused_amount'
              bank_charges:
                $ref: '#/components/schemas/bank_charges'
              is_client_review_settings_enabled:
                $ref: '#/components/schemas/is_client_review_settings_enabled'
              tax_amount_withheld:
                $ref: '#/components/schemas/tax_amount_withheld'
              discount_amount:
                $ref: '#/components/schemas/discount_amount'
              description:
                $ref: '#/components/schemas/description'
              reference_number:
                $ref: '#/components/schemas/reference_number'
              online_transaction_id:
                $ref: '#/components/schemas/online_transaction_id'
              invoices:
                $ref: '#/components/schemas/invoices'
              retainerinvoice:
                type: object
                properties:
                  retainerinvoice_id:
                    $ref: '#/components/schemas/retainerinvoice_id'
                  retainerinvoice_number:
                    $ref: '#/components/schemas/retainerinvoice_number'
                  retainerinvoice_total:
                    $ref: '#/components/schemas/retainerinvoice_total'
                  retainerinvoice_balance:
                    $ref: '#/components/schemas/retainerinvoice_balance'
                  retainerinvoice_date:
                    $ref: '#/components/schemas/retainerinvoice_date'
              payment_refunds:
                $ref: '#/components/schemas/payment_refunds'
              last_four_digits:
                $ref: '#/components/schemas/last_four_digits'
              html_string:
                $ref: '#/components/schemas/html_string'
              template_id:
                $ref: '#/components/schemas/template_id'
              template_name:
                $ref: '#/components/schemas/template_name'
              page_width:
                $ref: '#/components/schemas/page_width'
              page_height:
                $ref: '#/components/schemas/page_height'
              orientation:
                $ref: '#/components/schemas/orientation'
              template_type:
                $ref: '#/components/schemas/template_type'
              attachment_name:
                $ref: '#/components/schemas/attachment_name'
              can_send_in_mail:
                $ref: '#/components/schemas/can_send_in_mail'
              is_payment_drawn_details_required:
                $ref: '#/components/schemas/is_payment_drawn_details_required'
              custom_fields:
                $ref: '#/components/schemas/custom_fields'
    delete-a-retainer-payment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'The payment has been deleted.'
          readOnly: true
    get-a-retainer-invoice-attachment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
    add-attachment-to-a-retainer-invoice-request:
      type: object
      properties:
        can_send_in_mail:
          $ref: '#/components/schemas/can_send_in_mail'
        attachment:
          $ref: '#/components/schemas/attachment'
    add-attachment-to-a-retainer-invoice-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Your file has been attached.'
          readOnly: true
    delete-an-attachment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Your file is no longer attached to the invoice.'
          readOnly: true
    list-retainer-invoice-comments-and-history-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        comments:
          type: array
          items:
            type: object
            properties:
              comment_id:
                $ref: '#/components/schemas/comment_id'
              retainerinvoice_id:
                $ref: '#/components/schemas/retainerinvoice_id'
              description:
                $ref: '#/components/schemas/description'
              commented_by_id:
                $ref: '#/components/schemas/commented_by_id'
              commented_by:
                $ref: '#/components/schemas/commented_by'
              comment_type:
                $ref: '#/components/schemas/comment_type'
              operation_type:
                $ref: '#/components/schemas/operation_type'
              date:
                $ref: '#/components/schemas/date'
              date_description:
                $ref: '#/components/schemas/date_description'
              time:
                $ref: '#/components/schemas/time'
              transaction_id:
                $ref: '#/components/schemas/transaction_id'
              transaction_type:
                $ref: '#/components/schemas/transaction_type'
    add-comment-request:
      type: object
      properties:
        description:
          description: 'The description of the line items. <code>Maximum length [2000]</code>'
          type: string
          example: 'comment added'
        payment_expected_date:
          $ref: '#/components/schemas/payment_expected_date'
        show_comment_to_clients:
          $ref: '#/components/schemas/show_comment_to_clients'
    add-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
    update-comment-request:
      type: object
      properties:
        description:
          description: 'The description of the line items. <code>Maximum length [2000]</code>'
          type: string
          example: 'comment updated'
        show_comment_to_clients:
          $ref: '#/components/schemas/show_comment_to_clients'
    update-comment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'The comment has been deleted.'
          readOnly: true
        comment_id:
          $ref: '#/components/schemas/comment_id'
        retainerinvoice_id:
          $ref: '#/components/schemas/retainerinvoice_id'
        description:
          $ref: '#/components/schemas/description'
        commented_by_id:
          $ref: '#/components/schemas/commented_by_id'
        commented_by:
          $ref: '#/components/schemas/commented_by'
        date:
          $ref: '#/components/schemas/date'
        date_description:
          $ref: '#/components/schemas/date_description'
        time:
          $ref: '#/components/schemas/time'
        comment_type:
          $ref: '#/components/schemas/comment_type'
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: 'https://accounts.zoho.com/oauth/v2/auth'
          scopes:
            ZohoInvoice.invoices.CREATE: 'Create Invoices'
            ZohoInvoice.invoices.UPDATE: 'Update Invoices'
            ZohoInvoice.invoices.READ: 'Read Invoices'
            ZohoInvoice.invoices.DELETE: 'Delete Invoices'
