> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List templates

> API to get list of templates



## OpenAPI

````yaml /api-reference/invoices/openapi.json get /invoices/template
openapi: 3.0.0
info:
  title: Invoice API
  description: Documentation for invoice API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Invoice
    description: Documentation for invoice API
  - name: Template
    description: Documentation for invoice API
  - name: Schedule
    description: Documentation for invoice API
  - name: Text2Pay
    description: Documentation for invoice API
  - name: Estimate
    description: Documentation for invoice API
paths:
  /invoices/template:
    get:
      tags:
        - Template
      summary: List templates
      description: API to get list of templates
      operationId: list-invoice-templates
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
        - name: altId
          required: true
          in: query
          description: location Id / company Id based on altType
          schema:
            example: 6578278e879ad2646715ba9c
            type: string
        - name: altType
          required: true
          in: query
          description: Alt Type
          schema:
            example: location
            enum:
              - location
            type: string
        - name: status
          required: false
          in: query
          description: status to be filtered
          schema:
            type: string
        - name: startAt
          required: false
          in: query
          description: startAt in YYYY-MM-DD format
          schema:
            example: '2023-01-01'
            type: string
        - name: endAt
          required: false
          in: query
          description: endAt in YYYY-MM-DD format
          schema:
            example: '2023-01-01'
            type: string
        - name: search
          required: false
          in: query
          description: To search for an invoice by id / name / email / phoneNo
          schema:
            example: Alex
            type: string
        - name: paymentMode
          required: false
          in: query
          description: payment mode
          schema:
            example: live
            enum:
              - default
              - live
              - test
            type: string
        - name: limit
          required: true
          in: query
          description: Limit the number of items to return
          schema:
            example: 10
            type: string
        - name: offset
          required: true
          in: query
          description: Number of items to skip
          schema:
            example: 10
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTemplatesResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - Location-Access:
            - invoices/template.readonly
        - Agency-Access:
            - invoices/template.readonly
components:
  schemas:
    ListTemplatesResponseDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/GetTemplateResponseDto'
        totalCount:
          type: number
          description: Total number of Templates
          example: 100
      required:
        - data
        - totalCount
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    GetTemplateResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Template Id
          example: 6578278e879ad2646715ba9c
        altId:
          type: string
          description: Location Id or Agency Id
          example: 6578278e879ad2646715ba9c
        altType:
          type: string
          enum:
            - location
        name:
          type: string
          description: Name of the Template
          example: New Template
        businessDetails:
          $ref: '#/components/schemas/BusinessDetailsDto'
          example:
            name: Alex
            address:
              addressLine1: 9931 Beechwood
              city: St. Houston
              state: TX
              countryCode: USA
              postalCode: 559-6993
            phoneNo: +1-214-559-6993
            website: www.example.com
        currency:
          type: string
          description: Currency
          example: USD
        discount:
          $ref: '#/components/schemas/DiscountDto'
          example:
            type: percentage
            value: 0
        items:
          description: Invoice Items
          example:
            - taxes: []
              _id: c6tZZU0rJBf30ZXx9Gli
              productId: c6tZZU0rJBf30ZXx9Gli
              priceId: c6tZZU0rJBf30ZXx9Gli
              currency: USD
              name: Macbook Pro
              qty: 1
              amount: 999
          type: array
          items:
            type: string
        invoiceNumberPrefix:
          type: string
          description: prefix for invoice number
          example: INV-
        total:
          type: number
          description: Total Amount
          example: 999
        createdAt:
          type: string
          description: created at
          example: '2023-12-12T09:27:42.355Z'
        updatedAt:
          type: string
          description: updated at
          example: '2023-12-12T09:27:42.355Z'
      required:
        - _id
        - altId
        - altType
        - name
        - businessDetails
        - currency
        - items
        - total
        - createdAt
        - updatedAt
    BusinessDetailsDto:
      type: object
      properties:
        logoUrl:
          type: string
          description: Business Logo URL
          example: https://example.com/logo.png
        name:
          type: string
          description: Business Name
          example: ABC Corp.
        phoneNo:
          type: string
          description: Business Phone Number
          example: +1-214-559-6993
        address:
          $ref: '#/components/schemas/AddressDto'
          example: 9931 Beechwood, TX
        website:
          type: string
          description: Business Website Link
          example: wwww.example.com
        customValues:
          description: Custom Values
          type: array
          items:
            type: string
    DiscountDto:
      type: object
      properties:
        value:
          type: number
          description: Discount Value
          example: 10
          default: 0
        type:
          type: string
          description: Discount type
          enum:
            - percentage
            - fixed
          example: percentage
          default: percentage
        validOnProductIds:
          description: Product Ids on which discount is applicable
          example: '[ ''6579751d56f60276e5bd4154'' ]'
          type: array
          items:
            type: string
      required:
        - type
    AddressDto:
      type: object
      properties:
        addressLine1:
          type: string
          description: Address Line 1
          example: 9931 Beechwood
        addressLine2:
          type: string
          description: Address Line 2
          example: Beechwood
        city:
          type: string
          description: City
          example: St. Houston
        state:
          type: string
          description: State
          example: TX
        countryCode:
          type: string
          description: Country Code
          example: US
        postalCode:
          type: string
          description: Postal Code
          example: 559-6993

````