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

# Delete Invoice Attachment

> Deletes an attachment from an open invoice. Returns the updated invoice.



## OpenAPI

````yaml /api-reference/specs/billing.json delete /invoices/{clientId}/{invoiceId}/attachments/{attachmentId}
openapi: 3.0.1
info:
  title: Billing Service
  description: Billing API for FlowPayroll
  contact:
    name: FlowPayroll
    email: support@flowpayroll.com
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/billing
security:
  - X-Auth-Token: []
tags:
  - name: Account codes
    description: Create, update, archive, and delete accounting ledger codes.
  - name: Tax rates
    description: Manage default and custom tax rates.
  - name: Invoice & credit note templates
    description: >-
      Configure invoice and credit note templates, and list the available
      reference and description tokens.
  - name: Finance defaults
    description: >-
      Organisation finance defaults, pay element mappings, and attachment
      limits.
  - name: Invoices
  - name: Credit Notes
  - name: Clients
  - name: Integrations
  - name: Accounting Sync
paths:
  /invoices/{clientId}/{invoiceId}/attachments/{attachmentId}:
    delete:
      tags:
        - Invoices
      summary: Delete Invoice Attachment
      description: Deletes an attachment from an open invoice. Returns the updated invoice.
      operationId: DeleteInvoiceAttachment
      parameters:
        - name: clientId
          in: path
          required: true
          schema:
            type: string
        - name: invoiceId
          in: path
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_InvoiceDto'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_String'
components:
  schemas:
    ApiResponse_InvoiceDto:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/Content_InvoiceDto'
        metadata:
          $ref: '#/components/schemas/Metadata'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          nullable: true
        message:
          $ref: '#/components/schemas/Message'
      additionalProperties: false
    ApiResponse_String:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/Content_String'
        metadata:
          $ref: '#/components/schemas/Metadata'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          nullable: true
        message:
          $ref: '#/components/schemas/Message'
      additionalProperties: false
    Content_InvoiceDto:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/InvoiceDto'
        metadata:
          $ref: '#/components/schemas/Metadata'
      additionalProperties: false
    Metadata:
      type: object
      properties:
        dateFormat:
          type: string
          nullable: true
        dateTimeFormat:
          type: string
          nullable: true
      additionalProperties: false
    Error:
      type: object
      properties:
        field:
          type: string
          nullable: true
        reasonText:
          type: string
          nullable: true
        reasonId:
          type: string
          nullable: true
        reasonParameters:
          type: array
          items:
            $ref: '#/components/schemas/Pair'
          nullable: true
      additionalProperties: false
    Message:
      type: object
      properties:
        text:
          type: string
          nullable: true
        textId:
          type: string
          nullable: true
        textParameters:
          type: array
          items:
            $ref: '#/components/schemas/Pair'
          nullable: true
      additionalProperties: false
    Content_String:
      type: object
      properties:
        data:
          type: string
          nullable: true
        metadata:
          $ref: '#/components/schemas/Metadata'
      additionalProperties: false
    InvoiceDto:
      type: object
      properties:
        id:
          type: string
        organisationId:
          type: string
        clientId:
          type: string
        amount:
          type: number
          format: double
          nullable: true
        lineAmountTypes:
          type: string
          nullable: true
        subTotal:
          type: number
          format: double
          nullable: true
        totalTax:
          type: number
          format: double
          nullable: true
        totalCreditAmount:
          type: number
          format: double
          nullable: true
        balanceDue:
          type: number
          format: double
          nullable: true
        currencyCode:
          type: string
          nullable: true
        appliedCredits:
          type: array
          items:
            $ref: '#/components/schemas/AppliedCreditDto'
          nullable: true
        status:
          enum:
            - Draft
            - Issued
            - Paid
            - Voided
          type: string
        invoiceFormat:
          enum:
            - None
            - Date
            - PayElementId
            - PoNumber
            - TagGroup
            - PayrollConfigId
          type: string
        groupingKey:
          type: string
        invoiceFormatTagGroup:
          type: string
          nullable: true
        invoiceFormatTagName:
          type: string
          nullable: true
        date:
          type: string
          nullable: true
        dueDate:
          type: string
          nullable: true
        invoiceNumber:
          type: string
          nullable: true
        reference:
          type: string
          nullable: true
        invoiceType:
          enum:
            - Sales
            - Purchase
          type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/DocumentAttachmentDto'
          nullable: true
        lineItemAttachmentCount:
          type: integer
          format: int32
        linesWithoutAttachmentsCount:
          type: integer
          format: int32
        linesWithoutPoNumberCount:
          type: integer
          format: int32
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItemDto'
          nullable: true
        subtotalGroups:
          type: array
          items:
            $ref: '#/components/schemas/SubtotalGroupDto'
          nullable: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagDto'
          nullable: true
        externalId:
          type: string
          nullable: true
        externalProvider:
          type: string
          nullable: true
        lastSyncedAt:
          type: string
          nullable: true
        syncStatus:
          type: string
          nullable: true
        syncErrorMessage:
          type: string
          nullable: true
        syncErrorCode:
          type: string
          nullable: true
        externalProviderStatus:
          type: string
          nullable: true
        emailSent:
          type: boolean
        emailSentAt:
          type: string
          nullable: true
        emailSentBy:
          type: string
          nullable: true
        createdDate:
          type: string
        createdBy:
          type: string
        updatedDate:
          type: string
        updatedBy:
          type: string
      additionalProperties: false
    Pair:
      type: object
      properties:
        key:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
      additionalProperties: false
    AppliedCreditDto:
      type: object
      properties:
        creditNoteId:
          type: string
        amountApplied:
          type: number
          format: double
        appliedDate:
          type: string
      additionalProperties: false
    DocumentAttachmentDto:
      type: object
      properties:
        id:
          type: string
        fileName:
          type: string
        url:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        s3Key:
          type: string
          nullable: true
        contentType:
          type: string
          nullable: true
        fileSize:
          type: integer
          format: int64
          nullable: true
        uploadedDate:
          type: string
          nullable: true
        uploadedBy:
          type: string
          nullable: true
        downloadUrl:
          type: string
          nullable: true
        downloadUrlExpiresAt:
          type: string
          nullable: true
      additionalProperties: false
    InvoiceLineItemDto:
      type: object
      properties:
        id:
          type: string
        invoiceId:
          type: string
        organisationId:
          type: string
          nullable: true
        clientId:
          type: string
          nullable: true
        employeeId:
          type: string
          nullable: true
        employeeName:
          type: string
          nullable: true
        description:
          type: string
        amount:
          type: number
          format: double
        payElementId:
          type: string
          nullable: true
        units:
          type: number
          format: double
          nullable: true
        chargeRate:
          type: number
          format: double
          nullable: true
        chargeUnits:
          type: number
          format: double
          nullable: true
        chargeValue:
          type: number
          format: double
          nullable: true
        date:
          type: string
          nullable: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagDto'
          nullable: true
        createdDate:
          type: string
          nullable: true
        createdBy:
          type: string
          nullable: true
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItemAttachmentDto'
          nullable: true
        payElementDescription:
          type: string
          nullable: true
        accountCode:
          type: string
          nullable: true
        taxType:
          type: string
          nullable: true
        quantity:
          type: number
          format: double
          nullable: true
        unitAmount:
          type: number
          format: double
          nullable: true
        lineAmount:
          type: number
          format: double
          nullable: true
        taxAmount:
          type: number
          format: double
          nullable: true
        poNumber:
          type: string
          nullable: true
      additionalProperties: false
    SubtotalGroupDto:
      type: object
      properties:
        label:
          type: string
        amount:
          type: number
          format: double
        taxAmount:
          type: number
          format: double
        totalAmount:
          type: number
          format: double
        sortOrder:
          type: integer
          format: int32
      additionalProperties: false
    TagDto:
      type: object
      properties:
        name:
          type: string
        group:
          type: string
        value:
          type: string
      additionalProperties: false
    InvoiceLineItemAttachmentDto:
      type: object
      properties:
        id:
          type: string
        lineItemId:
          type: string
        filename:
          type: string
        contentType:
          type: string
        fileSize:
          type: integer
          format: int64
        uploadedDate:
          type: string
        uploadedBy:
          type: string
        s3Key:
          type: string
          nullable: true
        source:
          type: string
          nullable: true
        downloadUrl:
          type: string
          nullable: true
        downloadUrlExpiresAt:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: Authentication token for API access
      name: X-Auth-Token
      in: header

````