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

# Add an attachment to an Invoice



## OpenAPI

````yaml POST /invoice/attachment/upload
openapi: 3.1.0
info:
  title: OpenAPI Valyx API
  description: To demonstrate features in the Valyx
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.valyx.com
security:
  - bearerAuth:
      - demo-api
tags:
  - name: billing
    description: External Billing APIs
  - name: external
    description: External APIs for customers
  - name: invoice
    description: Invoice APIs
  - name: creditNote
    description: Credit Note APIs
paths:
  /invoice/attachment/upload:
    post:
      tags:
        - invoice
      operationId: post_invoice_attachment_upload
      parameters:
        - name: X-Valyx-Attachment-Upload-Signature
          in: header
          required: true
          schema:
            type: string
          description: Auth key for attachment upload
        - name: X-Fields
          in: header
          description: An optional fields mask
          schema:
            type: string
            format: mask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                invoiceNumber:
                  type: string
                attachmentUrl:
                  type: string
                purpose:
                  type: string
                  enum:
                    - INVOICE_FOR_BUYER
                    - INVOICE_SUPPORTING
                    - PURCHASE_ORDER
                    - SALES_ORDER
                    - DELIVERY_DOCUMENT
                    - PAYMENT_PROOF
                    - DISPUTE
                    - DISPUTE_RESOLUTION
                    - ENQUIRY
                    - ENQUIRY_RESOLUTION
                    - TAX_DOCUMENT
                    - COMMERCIAL_AGREEMENT
                    - COMMERCIAL_AGREEMENT_SUPPORTING
                    - LEGAL
                    - GENERAL
                    - CREDITNOTE_FOR_BUYER
                    - CREDITNOTE_SUPPORTING
                    - TICKET
                    - USAGE_ESTIMATE
                    - MAIL_ATTACHMENT
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadInvoiceAttachmentResponseModel'
components:
  schemas:
    UploadInvoiceAttachmentResponseModel:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        data:
          $ref: '#/components/schemas/UploadInvoiceAttachmentResponseDataModel'
    UploadInvoiceAttachmentResponseDataModel:
      type: object
      properties:
        invoiceId:
          type: string
        invoiceNumber:
          type: string
        customerName:
          type: string
        buyerId:
          type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/AttachmentForInvoice'
    AttachmentForInvoice:
      type: object
      properties:
        filename:
          type: string
        purpose:
          type: string
        createdAt:
          type: string

````