> ## 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.

# Send invoice

> API to send invoice by invoice id



## OpenAPI

````yaml /api-reference/invoices/openapi.json post /invoices/{invoiceId}/send
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/{invoiceId}/send:
    post:
      tags:
        - Invoice
      summary: Send invoice
      description: API to send invoice by invoice id
      operationId: send-invoice
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
        - name: invoiceId
          required: true
          in: path
          description: Invoice Id
          schema:
            example: 6578278e879ad2646715ba9c
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendInvoiceDto'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendInvoicesResponseDto'
        '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.write
        - Agency-Access:
            - invoices.write
components:
  schemas:
    SendInvoiceDto:
      type: object
      properties:
        altId:
          type: string
          description: location Id / company Id based on altType
          example: 6578278e879ad2646715ba9c
        altType:
          type: string
          description: Alt Type
          enum:
            - location
          example: location
        userId:
          type: string
          description: >-
            Please ensure that the UserId corresponds to an authorized
            personnel, either by an employee ID or agency ID, to access this
            location. This account will serve as the primary channel for all
            future communications and updates.
          example: 6578278e879ad2646715ba9c
        action:
          type: string
          enum:
            - sms_and_email
            - send_manually
            - email
            - sms
        liveMode:
          type: boolean
        sentFrom:
          $ref: '#/components/schemas/InvoiceSettingsSenderConfigurationDto'
        autoPayment:
          $ref: '#/components/schemas/AutoPaymentDetailsDto'
      required:
        - altId
        - altType
        - userId
        - action
        - liveMode
    SendInvoicesResponseDto:
      type: object
      properties:
        invoice:
          $ref: '#/components/schemas/DefaultInvoiceResponseDto'
        smsData:
          type: object
        emailData:
          type: object
      required:
        - invoice
        - smsData
        - emailData
    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
    InvoiceSettingsSenderConfigurationDto:
      type: object
      properties:
        fromName:
          type: string
          description: Sender name to be used while sending email notification
          example: Alex
        fromEmail:
          type: string
          description: Email id to be used while sending email notification
          example: alex@example.com
    AutoPaymentDetailsDto:
      type: object
      properties:
        enable:
          type: boolean
        type:
          type: string
        paymentMethodId:
          type: string
        customerId:
          type: string
        card:
          $ref: '#/components/schemas/CardDto'
        usBankAccount:
          $ref: '#/components/schemas/USBankAccountDto'
        sepaDirectDebit:
          $ref: '#/components/schemas/SepaDirectDebitDTO'
        bacsDirectDebit:
          $ref: '#/components/schemas/BacsDirectDebitDTO'
        becsDirectDebit:
          $ref: '#/components/schemas/BecsDirectDebitDTO'
        cardId:
          type: string
        provider:
          type: object
      required:
        - enable
    DefaultInvoiceResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Invoice Id
          example: 6578278e879ad2646715ba9c
        status:
          type: string
          description: Invoice Status
          example: draft
          enum:
            - draft
            - sent
            - payment_processing
            - paid
            - void
            - partially_paid
        liveMode:
          type: boolean
          description: Live Mode
          example: false
        amountPaid:
          type: number
          description: Amount Paid
          example: 0
        altId:
          type: string
          description: Location Id or Agency Id
          example: 6578278e879ad2646715ba9c
        altType:
          type: string
          enum:
            - location
        name:
          type: string
          description: Name of the invoice
          example: New Invoice
        businessDetails:
          type: object
          description: Business Details
          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
        invoiceNumber:
          type: number
          description: Invoice Number
          example: '19'
        currency:
          type: string
          description: Currency
          example: USD
        contactDetails:
          type: object
          description: Contact Details
          example:
            id: c6tZZU0rJBf30ZXx9Gli
            phoneNo: +1-214-559-6993
            email: alex@example.com
            customFields: []
            name: Alex
            address:
              countryCode: US
        issueDate:
          type: string
          description: Issue date in YYYY-MM-DD format
          example: '2023-01-01'
        dueDate:
          type: string
          description: Due date in YYYY-MM-DD format
          example: '2023-01-01'
        discount:
          type: object
          description: Discount
          example:
            type: percentage
            value: 0
        invoiceItems:
          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
        total:
          type: number
          description: Total Amount
          example: 999
        title:
          type: string
          description: Title
          example: INVOICE
        amountDue:
          type: number
          description: Total Amount Due
          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'
        automaticTaxesEnabled:
          type: boolean
          description: Automatic taxes enabled for the Invoice
          example: true
        automaticTaxesCalculated:
          type: boolean
          description: Is Automatic taxes calculated for the Invoice items
          example: true
        paymentSchedule:
          type: object
          description: >-
            split invoice into payment schedule summing up to full invoice
            amount
      required:
        - _id
        - status
        - liveMode
        - amountPaid
        - altId
        - altType
        - name
        - businessDetails
        - invoiceNumber
        - currency
        - contactDetails
        - issueDate
        - dueDate
        - invoiceItems
        - total
        - title
        - amountDue
        - createdAt
        - updatedAt
    CardDto:
      type: object
      properties:
        brand:
          type: string
        last4:
          type: string
      required:
        - brand
        - last4
    USBankAccountDto:
      type: object
      properties:
        bank_name:
          type: string
        last4:
          type: string
      required:
        - bank_name
        - last4
    SepaDirectDebitDTO:
      type: object
      properties:
        bank_code:
          type: string
        last4:
          type: string
        branch_code:
          type: string
      required:
        - bank_code
        - last4
        - branch_code
    BacsDirectDebitDTO:
      type: object
      properties:
        sort_code:
          type: string
        last4:
          type: string
      required:
        - sort_code
        - last4
    BecsDirectDebitDTO:
      type: object
      properties:
        bsb_number:
          type: string
        last4:
          type: string
      required:
        - bsb_number
        - last4

````