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

# Create attachment for Credit Note



## OpenAPI

````yaml POST /creditNote/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:
  /creditNote/attachment/upload:
    post:
      tags:
        - creditNote
      summary: Upload a credit note attachment
      operationId: post_credit_note_attachment_upload
      parameters:
        - name: X-Valyx-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:
                creditNoteNumber:
                  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/UploadCreditNoteAttachmentResponseModel'
components:
  schemas:
    UploadCreditNoteAttachmentResponseModel:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        data:
          $ref: '#/components/schemas/UploadCreditNoteAttachmentResponseDataModel'
    UploadCreditNoteAttachmentResponseDataModel:
      type: object
      properties:
        id:
          type: string

````