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

# Finalize a draft invoice and send to integrator



## OpenAPI

````yaml https://dev.flextell.ai/docs/api.json post /v1/invoices/{id}/send
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: '## Flextell API'
servers:
  - url: https://dev.flextell.ai/api
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/invoices/{id}/send:
    post:
      tags:
        - Invoice
      summary: Finalize a draft invoice and send to integrator
      operationId: invoice.send
      parameters:
        - name: id
          in: path
          required: true
          description: The invoice identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceSendRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                      invoice:
                        $ref: '#/components/schemas/InvoiceResource'
                    required:
                      - message
                      - invoice
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
                    const: Invoice not found
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        const: Invoice not found
                    required:
                      - message
                  errors:
                    type: 'null'
                required:
                  - success
                  - error
                  - data
                  - errors
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    InvoiceSendRequest:
      type: object
      properties:
        id:
          type: integer
          description: The invoice send identifier.
          minimum: 1
      required:
        - id
      title: InvoiceSendRequest
    InvoiceResource:
      type: object
      properties:
        id:
          type: integer
        document_number:
          type: string
        document_class:
          type: string
        document_type:
          type: string
        profile_id:
          type:
            - string
            - 'null'
        issue_date:
          type: string
          format: date-time
        sent_at:
          type:
            - string
            - 'null'
          format: date-time
        sender_tax_number:
          type:
            - string
            - 'null'
        receiver_name:
          type:
            - string
            - 'null'
        receiver_tax_number:
          type:
            - string
            - 'null'
        receiver_email:
          type:
            - string
            - 'null'
        exchange_rate:
          type: string
        amount_tax_exclusive:
          type:
            - string
            - 'null'
        amount_tax_total:
          type:
            - string
            - 'null'
        amount_payable:
          type: string
        invoice_amount:
          type:
            - string
            - 'null'
        status:
          type: string
        status_label:
          type: string
        is_printed:
          type: boolean
        is_cancelled:
          type: boolean
        is_read:
          type: boolean
        is_draft:
          type: boolean
        is_archived:
          type: boolean
        series_name:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
        customer:
          $ref: '#/components/schemas/Customer'
        currency:
          $ref: '#/components/schemas/Currency'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - document_number
        - document_class
        - document_type
        - profile_id
        - issue_date
        - sent_at
        - sender_tax_number
        - receiver_name
        - receiver_tax_number
        - receiver_email
        - exchange_rate
        - amount_tax_exclusive
        - amount_tax_total
        - amount_payable
        - invoice_amount
        - status
        - status_label
        - is_printed
        - is_cancelled
        - is_read
        - is_draft
        - is_archived
        - series_name
        - notes
        - created_at
        - updated_at
      title: InvoiceResource
    Customer:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type: integer
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        phone_number:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        date_of_birth:
          type:
            - string
            - 'null'
          format: date-time
        gender:
          anyOf:
            - $ref: '#/components/schemas/Gender'
            - type: 'null'
        country_id:
          type:
            - integer
            - 'null'
        identity_number:
          type:
            - string
            - 'null'
        job:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        avatar_url:
          type:
            - string
            - 'null'
        avatar_updated_at:
          type:
            - string
            - 'null'
          format: date-time
        user_id:
          type:
            - integer
            - 'null'
        city_id:
          type:
            - integer
            - 'null'
        district_id:
          type:
            - integer
            - 'null'
        import_source_id:
          type:
            - integer
            - 'null'
        passport_number:
          type:
            - string
            - 'null'
        search_vector:
          type:
            - string
            - 'null'
        is_intake_completed:
          type: boolean
        default_channel_id:
          type:
            - integer
            - 'null'
      required:
        - id
        - tenant_id
        - first_name
        - last_name
        - phone_number
        - email
        - date_of_birth
        - gender
        - country_id
        - identity_number
        - job
        - address
        - deleted_at
        - created_at
        - updated_at
        - avatar_url
        - avatar_updated_at
        - user_id
        - city_id
        - district_id
        - import_source_id
        - passport_number
        - search_vector
        - is_intake_completed
        - default_channel_id
      title: Customer
    Currency:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        code:
          type:
            - string
            - 'null'
        symbol:
          type:
            - string
            - 'null'
        is_active:
          type: string
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        locale:
          type:
            - string
            - 'null'
        search_vector:
          type:
            - string
            - 'null'
      required:
        - id
        - name
        - code
        - symbol
        - is_active
        - deleted_at
        - created_at
        - updated_at
        - locale
        - search_vector
      title: Currency
    Gender:
      type: string
      enum:
        - male
        - female
        - other
      title: Gender
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````