openapi: 3.0.0
info:
  title: Expenses
  description: 'An expense represents the money that you spend, with the ultimate target of generating revenue for your organization.<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;"> 1002</span></td><td>Expense does not exists</td></tr><tr><td><span style="color:#FF0000;"> 5001</span></td><td>Expenses that were converted to an invoice cannot be deleted</td></tr><tr><td><span style="color:#FF0000;"> 5015</span></td><td>Enter a valid expense amount</td></tr><td><span style="color:#FF0000;"> 5019</span></td><td>Contact cannot be changed for an invoiced expense</td></tr><tr><td><span style="color:#FF0000;"> 5032</span></td><td>You cannot make this expense non-billable as it has been already invoiced</td></tr></tbody></table>'
  contact: {}
  version: 1.0.0
servers:
  - url: https://www.zohoapis.com/billing/v1
    description: API Endpoint
tags:
  - name: expenses
    description: Expenses Module
paths:
  /expenses:
    post:
      tags:
        - expenses
      operationId: create_expense
      summary: Create an Expense
      description: Create billable or non-billable expense.
      parameters:
        - name: receipt
          in: query
          description: 'Expense receipt file to attach. Allowed Extensions: <code>gif</code>, <code>png</code>, <code>jpeg</code>, <code>jpg</code>, <code>bmp</code> and <code>pdf</code>. It should be sent in multipart/formdata.'
          required: false
          schema:
            type: string
            format: binary
          example: png
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-an-expense-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-an-expense-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.expenses.CREATE
    get:
      tags:
        - expenses
      operationId: list_expenses
      summary: List Expenses
      description: List all the Expenses with pagination.
      parameters:
        - name: description
          in: query
          description: Search expenses by description.Variants <code>description_startswith</code> and <code>description_contains</code>. <code>Maximum length [100]</code>
          required: false
          schema:
            type: string
          example: Marketing
        - name: reference_number
          in: query
          description: Search expenses by reference number. Variants <code>reference_number_startswith</code> and <code>reference_number_contains</code>. <code>Maximum length [100]</code>
          required: false
          schema:
            type: string
          example: '#562SD23R4'
        - name: date
          in: query
          description: Search expenses by expense date. Variants <code>date_start</code>, <code>date_end</code>, <code>date_before</code> and <code>date_after</code>. <code>Date Format [yyyy-mm-dd]</code>
          required: false
          schema:
            type: string
          example: 2013-11-18T00:00:00.000Z
        - name: status
          in: query
          description: Search expenses by expense status. Allowed Values <code>unbilled</code>, <code>invoiced</code>, <code>reimbursed</code>, <code>non-billable</code> and <code>billable</code>
          required: false
          schema:
            type: string
          example: unbilled
        - name: amount
          in: query
          description: 'Search expenses by amount. Variants: <code>amount_less_than</code>, <code>amount_less_equals</code>, <code>amount_greater_than</code> and <code>amount_greater_than</code>'
          required: false
          schema:
            type: number
            format: double
          example: 112.5
        - name: account_name
          in: query
          description: Search expenses by expense account name. Variants <code>account_name_startswith</code> and <code>account_name_contains</code>. <code>Maximum length [100]</code>
          required: false
          schema:
            type: string
          example: Rent
        - name: customer_name
          in: query
          description: 'Search expenses by customer name. Variants: <code>customer_name_startswith</code> and <code>customer_name_contains</code>. <code>Maximum length [100]</code>'
          required: false
          schema:
            type: string
          example: Bowman & Co
        - name: search_text
          in: query
          description: Search expenses by account name or description or <code>customer name</code>  or <code>vendor name</code>. <code>Maximum length [100]</code>
          required: false
          schema:
            type: string
          example: Rent
        - name: sort_column
          in: query
          description: Sort expenses.Allowed Values <code>date</code>, <code>account_name</code>, <code>total</code>, <code>bcy_total</code>, <code>reference_number</code>, <code>customer_name</code> and <code>created_time</code>
          required: false
          schema:
            type: string
          example: total
        - name: filter_by
          in: query
          description: Filter expenses by expense status. Allowed Values <code>Status.All</code>, <code>Status.Billable</code>, <code>Status.Nonbillable</code>, <code>Status.Reimbursed</code>, <code>Status.Invoiced</code> and <code>Status.Unbilled</code>
          required: false
          schema:
            type: string
          example: Status.Billable
        - name: page
          in: query
          description: Page number to be fetched. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records 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-expenses-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.expenses.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /expenses/{expense_id}:
    put:
      tags:
        - expenses
      operationId: update_expense
      summary: Update an Expense
      description: Update an existing Expense.
      parameters:
        - name: receipt
          in: query
          description: 'Expense receipt file to attach. Allowed Extensions: <code>gif</code>, <code>png</code>, <code>jpeg</code>, <code>jpg</code>, <code>bmp</code> and <code>pdf</code>. It should be sent in multipart/formdata.'
          required: false
          schema:
            type: string
            format: binary
          example: png
        - name: delete_receipt
          in: query
          description: A historic receipt
          required: false
          schema:
            type: boolean
          example: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-an-expense-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-an-expense-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.expenses.UPDATE
    get:
      tags:
        - expenses
      operationId: get_expense
      summary: Retrieve an Expense
      description: Fetch the details of the Expense.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-an-expense-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.expenses.READ
    delete:
      tags:
        - expenses
      operationId: delete_expense
      summary: Delete an Expense
      description: Delete an existing expense.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-an-expense-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.expenses.DELETE
    parameters:
      - name: expense_id
        in: path
        required: true
        description: Unique identifier of the expense.
        schema:
          type: string
        example: 982000000030049
      - $ref: '#/components/parameters/organization_id'
components:
  parameters:
    organization_id:
      name: X-com-zoho-subscriptions-organizationid
      description: ID of the organization
      in: header
      required: true
      schema:
        type: string
      example: '10234695'
  schemas:
    gendoc-attributes-schema:
      $ref: '#/components/schemas/expense-response'
    expense-response:
      description: A cost for the company
      type: object
      properties:
        expense_id:
          $ref: '#/components/schemas/expense_id'
        transaction_id:
          $ref: '#/components/schemas/transaction_id'
        transaction_type:
          $ref: '#/components/schemas/transaction_type'
        expense_item_id:
          $ref: '#/components/schemas/expense_item_id'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        destination_of_supply:
          $ref: '#/components/schemas/destination_of_supply'
        destination_of_supply_state:
          $ref: '#/components/schemas/destination_of_supply_state'
        hsn_or_sac:
          $ref: '#/components/schemas/hsn_or_sac'
        source_of_supply:
          $ref: '#/components/schemas/source_of_supply'
        paid_through_account_name:
          $ref: '#/components/schemas/paid_through_account_name'
        vat_reg_no:
          $ref: '#/components/schemas/vat_reg_no'
        reverse_charge_tax_id:
          $ref: '#/components/schemas/reverse_charge_tax_id'
        reverse_charge_tax_name:
          $ref: '#/components/schemas/reverse_charge_tax_name'
        reverse_charge_tax_percentage:
          $ref: '#/components/schemas/reverse_charge_tax_percentage'
        reverse_charge_tax_amount:
          $ref: '#/components/schemas/reverse_charge_tax_amount'
        tax_amount:
          $ref: '#/components/schemas/tax_amount'
        is_itemized_expense:
          $ref: '#/components/schemas/is_itemized_expense'
        is_pre_gst:
          $ref: '#/components/schemas/is_pre_gst'
        trip_id:
          $ref: '#/components/schemas/trip_id'
        trip_number:
          $ref: '#/components/schemas/trip_number'
        reverse_charge_vat_total:
          $ref: '#/components/schemas/reverse_charge_vat_total'
        acquisition_vat_total:
          $ref: '#/components/schemas/acquisition_vat_total'
        acquisition_vat_summary:
          $ref: '#/components/schemas/acquisition_vat_summary'
        reverse_charge_vat_summary:
          $ref: '#/components/schemas/reverse_charge_vat_summary'
        account_id:
          $ref: '#/components/schemas/account_id'
        account_name:
          $ref: '#/components/schemas/account_name'
        date:
          $ref: '#/components/schemas/date'
        tax_id:
          $ref: '#/components/schemas/tax_id'
        tax_name:
          $ref: '#/components/schemas/tax_name'
        tax_percentage:
          $ref: '#/components/schemas/tax_percentage'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        sub_total:
          $ref: '#/components/schemas/sub_total'
        total:
          $ref: '#/components/schemas/total'
        bcy_total:
          $ref: '#/components/schemas/bcy_total'
        amount:
          $ref: '#/components/schemas/amount'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        description:
          $ref: '#/components/schemas/description'
        is_billable:
          $ref: '#/components/schemas/is_billable'
        is_personal:
          $ref: '#/components/schemas/is_personal'
        customer_id:
          $ref: '#/components/schemas/customer_id'
        customer_name:
          $ref: '#/components/schemas/customer_name'
        expense_receipt_name:
          $ref: '#/components/schemas/expense_receipt_name'
        expense_receipt_type:
          $ref: '#/components/schemas/expense_receipt_type'
        last_modified_time:
          $ref: '#/components/schemas/last_modified_time'
        status:
          $ref: '#/components/schemas/status'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        invoice_id:
          $ref: '#/components/schemas/invoice_id'
        invoice_number:
          $ref: '#/components/schemas/invoice_number'
        project_id:
          $ref: '#/components/schemas/project_id'
        project_name:
          $ref: '#/components/schemas/project_name'
        mileage_rate:
          $ref: '#/components/schemas/mileage_rate'
        mileage_type:
          $ref: '#/components/schemas/mileage_type'
        expense_type:
          $ref: '#/components/schemas/expense_type'
        start_reading:
          $ref: '#/components/schemas/start_reading'
        end_reading:
          $ref: '#/components/schemas/end_reading'
    description:
      description: Description of the expense. <code>Maximum length [100]</code>
      type: string
      example: Marketing
    reference_number:
      description: Reference number of the expense. <code>Maximum length [100]</code>
      type: string
      example: '#562SD23R4'
    date:
      description: Date of the expense
      type: string
      example: '2013-11-18'
    status:
      description: Expense status
      type: string
      example: unbilled
    customfield_id:
      type: integer
      format: int64
      example: '46000000012845'
    value:
      description: Value of the Custom Field
      type: string
      example: Normal
    custom_fields:
      description: Custom fields for an expense.
      type: array
      items:
        type: object
        properties:
          customfield_id:
            $ref: '#/components/schemas/customfield_id'
          value:
            $ref: '#/components/schemas/value'
    account_id:
      description: ID of the expense account.
      type: string
      example: 982000000561057
    source_of_supply:
      description: Place from where the goods/services are supplied. (If not given, <code>place of contact</code> given for the contact will be taken)
      type: string
      example: AP
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    destination_of_supply:
      description: Place where the goods/services are supplied to. (If not given, organisation's home state will be taken)
      type: string
      example: TN
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    hsn_or_sac:
      description: Add HSN/SAC code for your goods/services
      type: string
      example: 80540
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    gst_no:
      description: 15 digit GST identification number of the vendor.
      type: string
      example: 22AAAAA0000A1Z5
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    reverse_charge_tax_id:
      description: ID of the reverse charge tax
      type: string
      example: 982000000561063
    tax_exemption_code:
      description: Enter tax exemption code
      type: string
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    tax_exemption_id:
      description: Enter tax exemption ID
      type: string
      example: 982000000561067
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    reverse_charge_tax_name:
      description: Enter name of the reverse charge tax
      type: string
      example: intra
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    reverse_charge_tax_percentage:
      description: Enter percentage of the reverse charge tax
      type: number
      format: double
      example: 10
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    reverse_charge_tax_amount:
      description: Enter amount of the reverse charge tax
      type: integer
      example: 12
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    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: []
    destination_of_supply_state:
      description: State to where goods/services are supplied
      type: string
      example: TN
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    paid_through_account_name:
      description: Enter the name of the paid through account.
      type: string
      example: Petty Cash
    vat_reg_no:
      description: Enter VAT registration number.
      type: string
    is_itemized_expense:
      type: boolean
      example: false
    is_pre_gst:
      description: Applicable for transactions that fall before july 1, 2017
      type: string
      example: fasle
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    trip_id:
      description: Enter trip ID
      type: string
      example: ''
    trip_number:
      description: Enter trip number
      type: string
      example: ''
    reverse_charge_vat_total:
      description: Enter total of the reverse charge vat tax.
      type: number
      format: double
      example: 1.2
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    acquisition_vat_total:
      description: Enter acquisition vat total.
      type: number
      format: double
      example: 0
    tax:
      type: object
      properties:
        tax_name:
          $ref: '#/components/schemas/tax_name'
        tax_amount:
          $ref: '#/components/schemas/tax_amount'
    acquisition_vat_summary:
      type: array
      items:
        type: object
        properties:
          tax:
            $ref: '#/components/schemas/tax'
    reverse_charge_vat_summary:
      type: array
      items:
        type: object
        properties:
          tax:
            $ref: '#/components/schemas/tax'
    line_items:
      type: array
      items:
        type: object
        properties:
          line_item_id:
            $ref: '#/components/schemas/line_item_id'
          account_id:
            $ref: '#/components/schemas/account_id'
          description:
            $ref: '#/components/schemas/description'
          amount:
            $ref: '#/components/schemas/amount'
          tax_id:
            $ref: '#/components/schemas/tax_id'
          item_order:
            $ref: '#/components/schemas/item_order'
          product_type:
            $ref: '#/components/schemas/product_type'
          acquisition_vat_id:
            $ref: '#/components/schemas/acquisition_vat_id'
          reverse_charge_vat_id:
            $ref: '#/components/schemas/reverse_charge_vat_id'
          reverse_charge_tax_id:
            $ref: '#/components/schemas/reverse_charge_tax_id'
          tax_exemption_code:
            $ref: '#/components/schemas/tax_exemption_code'
          tax_exemption_id:
            $ref: '#/components/schemas/tax_exemption_id'
    taxes:
      type: array
      description: List of taxes applied to the expense
      items:
        type: object
        properties:
          tax_id:
            $ref: '#/components/schemas/tax_id'
          tax_amount:
            $ref: '#/components/schemas/tax_amount'
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    account_name:
      description: Name of the expense account in which that expense is recorded
      type: string
      example: Rent
    amount:
      description: Total expense value
      type: number
      format: double
      example: 112.5
    customer_name:
      description: Name of the Customer for whom expense is raised. <code>Maximum length [100]</code>
      type: string
      example: Bowman & Co
    customer_id:
      description: ID of the expense account.
      type: string
      example: 982000000567001
    recurring_expense_id:
      description: Search expenses by recurring expense ID.
      type: string
      example: 982000000000190
    paid_through_account_id:
      description: Search expenses by paid through account ID.
      type: string
      example: 982000000567250
    filter_by:
      description: Filter expenses by expense status. Allowed Values <code>Status.All</code>, <code>Status.Billable</code>, <code>Status.Nonbillable</code>, <code>Status.Reimbursed</code>, <code>Status.Invoiced</code> and <code>Status.Unbilled</code>
      type: string
      example: Status.Billable
    search_text:
      description: Search expenses by account name or description or <code>customer name</code>  or <code>vendor name</code>. <code>Maximum length [100]</code>
      type: string
      example: Rent
    sort_column:
      description: Sort expenses.Allowed Values <code>date</code>, <code>account_name</code>, <code>total</code>, <code>bcy_total</code>, <code>reference_number</code>, <code>customer_name</code> and <code>created_time</code>
      type: string
      example: total
    project_id:
      description: ID of the project associated with the customer.
      type: string
      example: 982000000567226
    expense_id:
      description: Unique ID of the expense
      type: string
      example: 982000000030049
    currency_id:
      description: Unique ID of the currency
      type: string
      example: 982000000567001
    currency_code:
      description: Code of the currency
      type: string
      example: USD
    bcy_total:
      description: Total value of expense in Base currency
      type: number
      format: double
      example: 100
    bcy_total_without_tax:
      description: Total expense in Base currency excluding tax
      type: number
      format: double
      example: 100
    total:
      description: Total value of expense
      type: number
      format: double
      example: 100
    total_without_tax:
      description: Total expense excluding tax
      type: number
      format: double
      example: 100
    sub_total:
      description: Sub-total of the expense amount
      type: number
      format: double
      example: 90
    is_billable:
      description: Check if an expense is billable
      type: boolean
      example: true
    created_time:
      description: Time of expense creation
      type: string
      example: 2013-11-18T02:17:40-0800
    last_modified_time:
      description: Date of last modification to the expense
      type: string
      example: 2013-12-18T02:17:40-0800
    expense_receipt_name:
      description: Name of the expense receipt
      type: string
      example: ' '
    expense_receipt_type:
      description: Type of the expense receipt
      type: string
      example: ' '
    applied_filter:
      description: Filter applied to get a view
      type: string
      example: Status.All
    page:
      description: current page number
      type: string
      example: 1
    per_page:
      description: Values per page
      type: string
      example: 100
    expense_item_id:
      description: ID of the expense item/component.
      type: string
      example: 982000000567220
    tax_id:
      description: Tax ID applied
      type: string
      example: 982000000566007
    tax_name:
      description: Name of the tax levied
      type: string
      example: SalesTax
    tax_percentage:
      description: Percentage of tax charged
      type: number
      format: double
      example: 10.5
    tax_amount:
      description: total expense amount
      type: number
      format: double
      example: 11.85
    is_inclusive_tax:
      description: Check if amount is inclusive of tax
      type: boolean
      example: false
    exchange_rate:
      description: Foreign currency exchange rate
      type: number
      format: double
      example: 1
    invoice_id:
      description: ID of the invoice associated
      type: string
      example: ' '
    invoice_number:
      description: Serial Number of the invoice attached
      type: string
      example: ' '
    project_name:
      description: Name of the project in question
      type: string
      example: ' '
    mileage_type:
      description: Milage expense type
      type: string
      example: non_mileage
    vat_treatment:
      description: VAT treatment for the expense. VAT treatment denotes the location of the vendor, if the vendor resides in UK then the VAT treatment is <code>uk</code>. If the vendor is in an EU country & VAT registered, you are resides in Northen Ireland and purchasing Goods then his VAT treatment is <code>eu_vat_registered</code> and if he resides outside 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: []
    product_type:
      description: 'Type of the expense. This denotes whether the expense is to be treated as a goods or service purchase. Allowed Values: <code>goods</code> and <code>service</code>.'
      type: string
      example: goods
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    acquisition_vat_id:
      description: This is the ID of the tax applied in case this is an EU - goods expense and acquisition VAT needs to be reported.
      type: string
      example: ' '
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    reverse_charge_vat_id:
      description: This is the ID of the tax applied in case this is a non UK - service expense and reverse charge VAT needs to be reported.
      type: string
      example: ' '
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    start_reading:
      description: Start reading of odometer when creating a mileage expense where <code>mileage_type</code> is <code>odometer</code>.
      type: number
      format: double
      example: ' '
    end_reading:
      description: End reading of odometer when creating a mileage expense where <code>mileage_type</code> is <code>odometer</code>.
      type: number
      format: double
      example: ' '
    distance:
      description: Distance travelled for a particular mileage expense where <code>mileage_type</code> is <code>manual</code>
      type: string
      example: ' '
    mileage_unit:
      description: 'Unit of the distance travelled. Allowed Values: <code>km</code> and <code>mile</code>'
      type: string
      example: ' '
    mileage_rate:
      description: Mileage rate for a particular mileage expense.
      type: number
      format: double
      example: ' '
    employee_id:
      description: ID of the employee who has submitted this mileage expense.
      type: string
      example: ' '
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    vehicle_type:
      description: 'Vehicle type for a particular mileage expense. Allowed Values: <code>car</code>, <code>van</code>, <code>motorcycle</code> and <code>bike</code>'
      type: string
      example: ' '
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    can_reclaim_vat_on_mileage:
      description: To specify if tax can be reclaimed for this mileage expense.
      type: string
      example: ' '
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    fuel_type:
      description: 'Fuel type for a particular mileage expense. Allowed Values: <code>petrol</code>, <code>lpg</code> and <code>diesel</code>'
      type: string
      example: ' '
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    engine_capacity_range:
      description: 'Engine capacity range for a particular mileage expense. Allowed Values: <code>less_than_1400cc</code>, <code>between_1400cc_and_1600cc</code>, <code>between_1600cc_and_2000cc</code> and <code>more_than_2000cc</code>'
      type: string
      example: ' '
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    comment_id:
      description: ID of the comment made
      type: string
      example: 982000000567272
    commented_by_id:
      description: ID of the user who has commented
      type: string
      example: 982000000554041
    commented_by:
      description: Name of the user commented
      type: string
      example: John David
    date_description:
      description: Date of the comment
      type: string
      example: 16 hours ago
    time:
      description: Time of the comment
      type: string
      example: 4.22AM
    operation_type:
      description: Type of operation on the expense
      type: string
      example: Added
    transaction_id:
      description: Unique ID of the transaction
      type: string
      example: ' '
    transaction_type:
      description: Type of the transaction
      type: string
      example: expense
    name:
      description: Name of the contact
      type: string
      example: John David
    email:
      description: Email address of the contact
      type: string
      example: test@zylker.org
    expense_type:
      description: Type of the expense
      type: string
      example: non-mileage
    is_personal:
      description: Check if the expense os personal
      type: boolean
      example: false
    line_item_id:
      description: ID of the items in the expense
      type: string
      example: 10763000000140068
    tax_type:
      description: Type of tax applied
      type: string
      example: tax
    item_total:
      description: Total value of the ites billed
      type: string
      example: 100
    item_order:
      description: Order of the items
      type: string
      example: 1
    receipt:
      description: 'Expense receipt file to attach. Allowed Extensions: <code>gif</code>, <code>png</code>, <code>jpeg</code>, <code>jpg</code>, <code>bmp</code> and <code>pdf</code>. It should be sent in multipart/formdata.'
      type: string
      format: binary
      example: png
    delete_receipt:
      description: A historic receipt
      type: boolean
      example: false
    create-an-expense-request:
      required:
        - amount
        - account_id
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        date:
          $ref: '#/components/schemas/date'
        amount:
          $ref: '#/components/schemas/amount'
        tax_id:
          $ref: '#/components/schemas/tax_id'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        source_of_supply:
          $ref: '#/components/schemas/source_of_supply'
        destination_of_supply:
          $ref: '#/components/schemas/destination_of_supply'
        hsn_or_sac:
          $ref: '#/components/schemas/hsn_or_sac'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        reverse_charge_tax_id:
          $ref: '#/components/schemas/reverse_charge_tax_id'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        line_items:
          $ref: '#/components/schemas/line_items'
        taxes:
          $ref: '#/components/schemas/taxes'
        is_billable:
          $ref: '#/components/schemas/is_billable'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        description:
          $ref: '#/components/schemas/description'
        customer_id:
          $ref: '#/components/schemas/customer_id'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        project_id:
          $ref: '#/components/schemas/project_id'
        mileage_type:
          $ref: '#/components/schemas/mileage_type'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        product_type:
          $ref: '#/components/schemas/product_type'
        acquisition_vat_id:
          $ref: '#/components/schemas/acquisition_vat_id'
        reverse_charge_vat_id:
          $ref: '#/components/schemas/reverse_charge_vat_id'
        start_reading:
          $ref: '#/components/schemas/start_reading'
        end_reading:
          $ref: '#/components/schemas/end_reading'
        distance:
          $ref: '#/components/schemas/distance'
        mileage_unit:
          $ref: '#/components/schemas/mileage_unit'
        mileage_rate:
          $ref: '#/components/schemas/mileage_rate'
        employee_id:
          $ref: '#/components/schemas/employee_id'
        vehicle_type:
          $ref: '#/components/schemas/vehicle_type'
        can_reclaim_vat_on_mileage:
          $ref: '#/components/schemas/can_reclaim_vat_on_mileage'
        fuel_type:
          $ref: '#/components/schemas/fuel_type'
        engine_capacity_range:
          $ref: '#/components/schemas/engine_capacity_range'
    create-an-expense-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The expense has been recorded.
          readOnly: true
        expense:
          $ref: '#/components/schemas/expense-response'
    list-expenses-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        expenses:
          type: array
          items:
            type: object
            properties:
              expense_id:
                $ref: '#/components/schemas/expense_id'
              date:
                $ref: '#/components/schemas/date'
              account_name:
                $ref: '#/components/schemas/account_name'
              description:
                $ref: '#/components/schemas/description'
              currency_id:
                $ref: '#/components/schemas/currency_id'
              currency_code:
                $ref: '#/components/schemas/currency_code'
              bcy_total:
                $ref: '#/components/schemas/bcy_total'
              bcy_total_without_tax:
                $ref: '#/components/schemas/bcy_total_without_tax'
              total:
                $ref: '#/components/schemas/total'
              total_without_tax:
                $ref: '#/components/schemas/total_without_tax'
              is_billable:
                $ref: '#/components/schemas/is_billable'
              reference_number:
                $ref: '#/components/schemas/reference_number'
              customer_id:
                $ref: '#/components/schemas/customer_id'
              customer_name:
                $ref: '#/components/schemas/customer_name'
              status:
                $ref: '#/components/schemas/status'
              custom_fields:
                $ref: '#/components/schemas/custom_fields'
              created_time:
                $ref: '#/components/schemas/created_time'
              last_modified_time:
                $ref: '#/components/schemas/last_modified_time'
              expense_receipt_name:
                $ref: '#/components/schemas/expense_receipt_name'
              mileage_rate:
                $ref: '#/components/schemas/mileage_rate'
              mileage_unit:
                $ref: '#/components/schemas/mileage_unit'
              expense_type:
                $ref: '#/components/schemas/expense_type'
              start_reading:
                $ref: '#/components/schemas/start_reading'
              end_reading:
                $ref: '#/components/schemas/end_reading'
    update-an-expense-request:
      required:
        - amount
        - account_id
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        date:
          $ref: '#/components/schemas/date'
        amount:
          description: Total expense value
          type: number
          format: double
          example: 120.5
        tax_id:
          $ref: '#/components/schemas/tax_id'
        source_of_supply:
          $ref: '#/components/schemas/source_of_supply'
        destination_of_supply:
          $ref: '#/components/schemas/destination_of_supply'
        hsn_or_sac:
          $ref: '#/components/schemas/hsn_or_sac'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        reverse_charge_tax_id:
          $ref: '#/components/schemas/reverse_charge_tax_id'
        line_items:
          $ref: '#/components/schemas/line_items'
        taxes:
          $ref: '#/components/schemas/taxes'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        is_billable:
          $ref: '#/components/schemas/is_billable'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        description:
          $ref: '#/components/schemas/description'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        customer_id:
          $ref: '#/components/schemas/customer_id'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        project_id:
          $ref: '#/components/schemas/project_id'
        mileage_type:
          $ref: '#/components/schemas/mileage_type'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        product_type:
          $ref: '#/components/schemas/product_type'
        acquisition_vat_id:
          $ref: '#/components/schemas/acquisition_vat_id'
        reverse_charge_vat_id:
          $ref: '#/components/schemas/reverse_charge_vat_id'
        start_reading:
          $ref: '#/components/schemas/start_reading'
        end_reading:
          $ref: '#/components/schemas/end_reading'
        distance:
          $ref: '#/components/schemas/distance'
        mileage_unit:
          $ref: '#/components/schemas/mileage_unit'
        mileage_rate:
          $ref: '#/components/schemas/mileage_rate'
        employee_id:
          $ref: '#/components/schemas/employee_id'
        vehicle_type:
          $ref: '#/components/schemas/vehicle_type'
        can_reclaim_vat_on_mileage:
          $ref: '#/components/schemas/can_reclaim_vat_on_mileage'
        fuel_type:
          $ref: '#/components/schemas/fuel_type'
        engine_capacity_range:
          $ref: '#/components/schemas/engine_capacity_range'
    update-an-expense-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Expense information has been updated.
          readOnly: true
        expense:
          description: A cost spent by the company
          type: object
          properties:
            expense_id:
              $ref: '#/components/schemas/expense_id'
            transaction_id:
              $ref: '#/components/schemas/transaction_id'
            transaction_type:
              $ref: '#/components/schemas/transaction_type'
            expense_item_id:
              $ref: '#/components/schemas/expense_item_id'
            gst_no:
              $ref: '#/components/schemas/gst_no'
            gst_treatment:
              $ref: '#/components/schemas/gst_treatment'
            destination_of_supply:
              $ref: '#/components/schemas/destination_of_supply'
            destination_of_supply_state:
              $ref: '#/components/schemas/destination_of_supply_state'
            hsn_or_sac:
              $ref: '#/components/schemas/hsn_or_sac'
            source_of_supply:
              $ref: '#/components/schemas/source_of_supply'
            paid_through_account_name:
              $ref: '#/components/schemas/paid_through_account_name'
            vat_reg_no:
              $ref: '#/components/schemas/vat_reg_no'
            reverse_charge_tax_id:
              $ref: '#/components/schemas/reverse_charge_tax_id'
            reverse_charge_tax_name:
              $ref: '#/components/schemas/reverse_charge_tax_name'
            reverse_charge_tax_percentage:
              $ref: '#/components/schemas/reverse_charge_tax_percentage'
            reverse_charge_tax_amount:
              $ref: '#/components/schemas/reverse_charge_tax_amount'
            tax_amount:
              $ref: '#/components/schemas/tax_amount'
            is_itemized_expense:
              $ref: '#/components/schemas/is_itemized_expense'
            is_pre_gst:
              $ref: '#/components/schemas/is_pre_gst'
            trip_id:
              $ref: '#/components/schemas/trip_id'
            trip_number:
              $ref: '#/components/schemas/trip_number'
            reverse_charge_vat_total:
              $ref: '#/components/schemas/reverse_charge_vat_total'
            acquisition_vat_total:
              $ref: '#/components/schemas/acquisition_vat_total'
            acquisition_vat_summary:
              $ref: '#/components/schemas/acquisition_vat_summary'
            reverse_charge_vat_summary:
              $ref: '#/components/schemas/reverse_charge_vat_summary'
            account_id:
              $ref: '#/components/schemas/account_id'
            account_name:
              $ref: '#/components/schemas/account_name'
            date:
              $ref: '#/components/schemas/date'
            tax_id:
              $ref: '#/components/schemas/tax_id'
            tax_name:
              $ref: '#/components/schemas/tax_name'
            tax_percentage:
              $ref: '#/components/schemas/tax_percentage'
            currency_id:
              $ref: '#/components/schemas/currency_id'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            exchange_rate:
              $ref: '#/components/schemas/exchange_rate'
            sub_total:
              $ref: '#/components/schemas/sub_total'
            total:
              $ref: '#/components/schemas/total'
            bcy_total:
              $ref: '#/components/schemas/bcy_total'
            amount:
              description: Amount of expense billed
              type: number
              format: double
              example: 120.5
            is_inclusive_tax:
              $ref: '#/components/schemas/is_inclusive_tax'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            description:
              $ref: '#/components/schemas/description'
            is_billable:
              $ref: '#/components/schemas/is_billable'
            is_personal:
              $ref: '#/components/schemas/is_personal'
            customer_id:
              $ref: '#/components/schemas/customer_id'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            expense_receipt_name:
              $ref: '#/components/schemas/expense_receipt_name'
            expense_receipt_type:
              $ref: '#/components/schemas/expense_receipt_type'
            last_modified_time:
              $ref: '#/components/schemas/last_modified_time'
            status:
              $ref: '#/components/schemas/status'
            custom_fields:
              $ref: '#/components/schemas/custom_fields'
            invoice_id:
              $ref: '#/components/schemas/invoice_id'
            invoice_number:
              $ref: '#/components/schemas/invoice_number'
            project_id:
              $ref: '#/components/schemas/project_id'
            project_name:
              $ref: '#/components/schemas/project_name'
            mileage_rate:
              $ref: '#/components/schemas/mileage_rate'
            mileage_type:
              $ref: '#/components/schemas/mileage_type'
            expense_type:
              $ref: '#/components/schemas/expense_type'
            start_reading:
              $ref: '#/components/schemas/start_reading'
            end_reading:
              $ref: '#/components/schemas/end_reading'
    get-an-expense-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        expense:
          type: object
          properties:
            expense_id:
              $ref: '#/components/schemas/expense_id'
            transaction_id:
              $ref: '#/components/schemas/transaction_id'
            transaction_type:
              $ref: '#/components/schemas/transaction_type'
            expense_item_id:
              $ref: '#/components/schemas/expense_item_id'
            gst_no:
              $ref: '#/components/schemas/gst_no'
            gst_treatment:
              $ref: '#/components/schemas/gst_treatment'
            destination_of_supply:
              $ref: '#/components/schemas/destination_of_supply'
            destination_of_supply_state:
              $ref: '#/components/schemas/destination_of_supply_state'
            hsn_or_sac:
              $ref: '#/components/schemas/hsn_or_sac'
            source_of_supply:
              $ref: '#/components/schemas/source_of_supply'
            paid_through_account_name:
              $ref: '#/components/schemas/paid_through_account_name'
            vat_reg_no:
              $ref: '#/components/schemas/vat_reg_no'
            reverse_charge_tax_id:
              $ref: '#/components/schemas/reverse_charge_tax_id'
            reverse_charge_tax_name:
              $ref: '#/components/schemas/reverse_charge_tax_name'
            reverse_charge_tax_percentage:
              $ref: '#/components/schemas/reverse_charge_tax_percentage'
            reverse_charge_tax_amount:
              $ref: '#/components/schemas/reverse_charge_tax_amount'
            tax_amount:
              $ref: '#/components/schemas/tax_amount'
            is_itemized_expense:
              $ref: '#/components/schemas/is_itemized_expense'
            is_pre_gst:
              $ref: '#/components/schemas/is_pre_gst'
            trip_id:
              $ref: '#/components/schemas/trip_id'
            trip_number:
              $ref: '#/components/schemas/trip_number'
            reverse_charge_vat_total:
              $ref: '#/components/schemas/reverse_charge_vat_total'
            acquisition_vat_total:
              $ref: '#/components/schemas/acquisition_vat_total'
            acquisition_vat_summary:
              $ref: '#/components/schemas/acquisition_vat_summary'
            reverse_charge_vat_summary:
              $ref: '#/components/schemas/reverse_charge_vat_summary'
            account_id:
              $ref: '#/components/schemas/account_id'
            account_name:
              $ref: '#/components/schemas/account_name'
            date:
              $ref: '#/components/schemas/date'
            tax_id:
              $ref: '#/components/schemas/tax_id'
            tax_name:
              $ref: '#/components/schemas/tax_name'
            tax_percentage:
              $ref: '#/components/schemas/tax_percentage'
            currency_id:
              $ref: '#/components/schemas/currency_id'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            exchange_rate:
              $ref: '#/components/schemas/exchange_rate'
            sub_total:
              $ref: '#/components/schemas/sub_total'
            total:
              $ref: '#/components/schemas/total'
            bcy_total:
              $ref: '#/components/schemas/bcy_total'
            amount:
              $ref: '#/components/schemas/amount'
            is_inclusive_tax:
              $ref: '#/components/schemas/is_inclusive_tax'
            reference_number:
              $ref: '#/components/schemas/reference_number'
            description:
              $ref: '#/components/schemas/description'
            is_billable:
              $ref: '#/components/schemas/is_billable'
            is_personal:
              $ref: '#/components/schemas/is_personal'
            customer_id:
              $ref: '#/components/schemas/customer_id'
            customer_name:
              $ref: '#/components/schemas/customer_name'
            expense_receipt_name:
              $ref: '#/components/schemas/expense_receipt_name'
            expense_receipt_type:
              $ref: '#/components/schemas/expense_receipt_type'
            last_modified_time:
              $ref: '#/components/schemas/last_modified_time'
            status:
              $ref: '#/components/schemas/status'
            invoice_id:
              $ref: '#/components/schemas/invoice_id'
            invoice_number:
              $ref: '#/components/schemas/invoice_number'
            project_id:
              $ref: '#/components/schemas/project_id'
            project_name:
              $ref: '#/components/schemas/project_name'
            mileage_rate:
              $ref: '#/components/schemas/mileage_rate'
            mileage_type:
              $ref: '#/components/schemas/mileage_type'
            expense_type:
              $ref: '#/components/schemas/expense_type'
            start_reading:
              $ref: '#/components/schemas/start_reading'
            end_reading:
              $ref: '#/components/schemas/end_reading'
            custom_fields:
              $ref: '#/components/schemas/custom_fields'
            line_item:
              type: object
              properties:
                line_item_id:
                  $ref: '#/components/schemas/line_item_id'
                account_id:
                  $ref: '#/components/schemas/account_id'
                account_name:
                  $ref: '#/components/schemas/account_name'
                description:
                  $ref: '#/components/schemas/description'
                tax_amount:
                  $ref: '#/components/schemas/tax_amount'
                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'
                item_order:
                  $ref: '#/components/schemas/item_order'
                amount:
                  $ref: '#/components/schemas/amount'
                hsn_or_sac:
                  $ref: '#/components/schemas/hsn_or_sac'
                reverse_charge_tax_id:
                  $ref: '#/components/schemas/reverse_charge_tax_id'
                reverse_charge_tax_name:
                  $ref: '#/components/schemas/reverse_charge_tax_name'
                reverse_charge_tax_percentage:
                  $ref: '#/components/schemas/reverse_charge_tax_percentage'
                reverse_charge_tax_amount:
                  $ref: '#/components/schemas/reverse_charge_tax_amount'
    delete-an-expense-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The expense has been deleted.
          readOnly: true
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoSubscriptions.expenses.CREATE: Create Expenses
            ZohoSubscriptions.expenses.UPDATE: Update Expenses
            ZohoSubscriptions.expenses.READ: Read Expenses
            ZohoSubscriptions.expenses.DELETE: Delete Expenses
