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

# Create a client invoice upload

> OAuth scope: `client_invoice.write`

Uploads a file (PDF, JPEG, or PNG) for client invoices or quotes. The uploaded file can later be referenced when creating or updating a client invoice or quote by providing the upload ID.

<Tip>
If you're looking to send an invoice via e-invoice in France, please make sure you upload a PDF file following the Factur-X standards.
</Tip>



## OpenAPI

````yaml post /v2/client_invoices/uploads
openapi: 3.1.1
info:
  version: v2
  title: Qonto
servers:
  - url: https://thirdparty.qonto.com
    description: Production URL
  - url: https://thirdparty-sandbox.staging.qonto.co
    description: Sandbox URL
security:
  - OAuth:
      - organization.read
      - membership.read
      - membership.write
      - attachment.write
      - internal_transfer.write
      - payment.write
      - supplier_invoice.write
      - supplier_invoice.read
      - client_invoices.read
      - client_invoice.write
      - client.read
      - client.write
      - product.read
      - product.write
      - request_review.write
      - request_review.read
      - team.read
      - team.write
      - request_transfers.write
      - insurance_contract.read
      - insurance_contract.write
      - card.read
      - card.write
      - bank_account.write
      - beneficiary.trust
      - webhook
      - payment_link.write
      - payment_link.read
      - sepa_direct_debit.read
      - sepa_direct_debit.write
      - terminal.read
      - terminal.write
  - SecretKey: []
paths:
  /v2/client_invoices/uploads:
    post:
      tags:
        - Client Invoices Uploads
      summary: Create a client invoice upload
      description: >-
        OAuth scope: `client_invoice.write`


        Uploads a file (PDF, JPEG, or PNG) for client invoices or quotes. The
        uploaded file can later be referenced when creating or updating a client
        invoice or quote by providing the upload ID.


        <Tip>

        If you're looking to send an invoice via e-invoice in France, please
        make sure you upload a PDF file following the Factur-X standards.

        </Tip>
      operationId: create_client_invoice_upload
      parameters:
        - $ref: '#/components/parameters/X-Qonto-Staging-Token'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                client_invoices_upload:
                  type: string
                  format: binary
                  description: |-
                    The file to upload. Supported formats:
                    - PDF (.pdf)
                    - JPEG (.jpeg, .jpg)
                    - PNG (.png)
              required:
                - client_invoices_upload
      responses:
        '201':
          description: Returns the client invoice upload created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - client_invoices_upload
                        example: client_invoices_upload
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier for the upload
                        example: 019c688e-4adc-795b-b0fb-c9be149262dd
                      attributes:
                        $ref: '#/components/schemas/ClientInvoiceUpload'
                    required:
                      - type
                      - id
                      - attributes
                required:
                  - data
        '400':
          $ref: '#/components/responses/400-Client-Invoice-Bad-Request'
        '401':
          $ref: '#/components/responses/401-Client-Invoice-Unauthorized'
        '403':
          $ref: '#/components/responses/403-Client-Invoice-Forbidden'
        '422':
          $ref: '#/components/responses/422-Client-Invoice-Unprocessable-Entity'
        '500':
          $ref: '#/components/responses/500-Client-Invoice-Internal-Server-Error'
      security:
        - OAuth:
            - client_invoice.write
        - SecretKey: []
components:
  parameters:
    X-Qonto-Staging-Token:
      name: X-Qonto-Staging-Token
      in: header
      description: >-
        Required only for Sandbox API requests; to get one, please sign up to
        the [Developer Portal](https://developers.qonto.com/).
      schema:
        type: string
  schemas:
    ClientInvoiceUpload:
      type: object
      description: >-
        Represents a file upload that can be attached to client invoices or
        quotes.
      properties:
        id:
          type: string
          format: uuid
          description: >-
            Unique identifier for the upload. Use this ID when creating or
            updating client invoices or quotes.
          example: 4d5418bb-bd0d-4df4-865c-c07afab8bb48
        organization_id:
          type: string
          format: uuid
          description: ID of the organization that owns this upload
          example: 9f8e7d6c-5b4a-3c2d-1e0f-1a2b3c4d5e6f
        filename:
          type: string
          description: Original filename of the uploaded file
          example: invoice_document.pdf
        content_type:
          type: string
          description: MIME type of the file
          example: application/pdf
          enum:
            - application/pdf
            - image/jpeg
            - image/png
        file_size:
          type: integer
          description: Size of the file in bytes
          example: 524288
        url:
          type: string
          format: uri
          description: URL to access/download the uploaded file
          example: >-
            https://qonto-uploads.s3.eu-central-1.amazonaws.com/uploads/4d5418bb-bd0d-4df4-865c-c07afab8bb48/invoice_document.pdf
        created_at:
          type: string
          format: date-time
          description: Timestamp when the upload was created
          example: '2022-03-04T17:58:30+02:00'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the upload was last updated
          example: '2022-03-04T17:58:30+02:00'
      required:
        - id
        - organization_id
        - filename
        - content_type
        - file_size
        - url
        - created_at
        - updated_at
  responses:
    400-Client-Invoice-Bad-Request:
      description: Returns a bad request error specific to client invoices.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    status:
                      type: string
                      example: '400'
                    code:
                      type: string
                      enum:
                        - bad_request
                        - invalid_request_format
                        - malformed_json
                      example: bad_request
                    detail:
                      type: string
                      example: The request is malformed or contains invalid data
          examples:
            bad_request:
              value:
                errors:
                  - status: '400'
                    code: bad_request
                    detail: The request is malformed or contains invalid data
    401-Client-Invoice-Unauthorized:
      description: Returns an unauthorized error specific to client invoices.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    status:
                      type: string
                      example: '401'
                    code:
                      type: string
                      enum:
                        - unauthorized
                        - invalid_token
                        - token_expired
                      example: unauthorized
                    detail:
                      type: string
                      example: Authentication is required to access this resource
          examples:
            unauthorized:
              value:
                errors:
                  - status: '401'
                    code: unauthorized
                    detail: Authentication is required to access this resource
    403-Client-Invoice-Forbidden:
      description: Returns a forbidden error specific to client invoices.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    status:
                      type: string
                      example: '403'
                    code:
                      type: string
                      enum:
                        - forbidden
                        - insufficient_permissions
                        - access_denied
                      example: forbidden
                    detail:
                      type: string
                      example: You do not have permission to access this resource
          examples:
            forbidden:
              value:
                errors:
                  - status: '403'
                    code: forbidden
                    detail: You do not have permission to access this resource
    422-Client-Invoice-Unprocessable-Entity:
      description: Returns a validation error specific to client invoices.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    status:
                      type: string
                      example: '422'
                    code:
                      type: string
                      enum:
                        - invalid
                        - missing_field
                        - invalid_format
                        - invalid_client_id
                        - invalid_invoice_data
                      example: invalid
                    detail:
                      type: string
                      example: due_date should be greater or equal than issue_date.
                    source:
                      type: object
                      properties:
                        pointer:
                          type: string
                          example: /data/attributes/due_date
                    meta:
                      type: object
                      properties:
                        validation_param:
                          type: string
                          example: IssueDate
          examples:
            invalid:
              value:
                errors:
                  - status: '422'
                    code: invalid
                    detail: '`due_date` should be greater or equal than `issue_date`.'
                    source:
                      pointer: /data/attributes/due_date
                    meta:
                      validation_param: IssueDate
    500-Client-Invoice-Internal-Server-Error:
      description: Returns an internal server error specific to client invoices.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    status:
                      type: string
                      example: '500'
                    code:
                      type: string
                      enum:
                        - internal_server_error
                        - service_unavailable
                        - processing_error
                      example: internal_server_error
                    detail:
                      type: string
                      example: >-
                        An internal server error occurred while processing the
                        request
          examples:
            internal_server_error:
              value:
                errors:
                  - status: '500'
                    code: internal_server_error
                    detail: >-
                      An internal server error occurred while processing the
                      request
  securitySchemes:
    OAuth:
      type: oauth2
      description: >
        Bearer authorization header: `Bearer <token>`, where `<token>` is the
        access token received from the authorization server at the end of the
        [OAuth 2.0
        flow](/get-started/business-api/authentication/oauth/oauth-flow).
      flows:
        authorizationCode:
          refreshUrl: https://oauth.qonto.com/oauth2/token
          authorizationUrl: https://oauth.qonto.com/oauth2/auth
          scopes:
            attachment.read: Retrieve attachments
            attachment.write: Upload attachments and remove attachments from transactions
            bank_account.write: Create, update and close bank accounts
            beneficiary.trust: Trust SEPA beneficiaries
            card.read: Retrieve cards
            card.write: Create or update cards
            client.read: Retrieve clients
            client.write: Create clients
            client_invoice.write: Create client invoices
            client_invoices.read: Retrieve client invoices and credit notes
            einvoicing.read: Retrieve e-invoicing settings
            embed_auth_link.write: Create Embed auth links
            insurance_contract.read: Retrieve insurance contracts
            insurance_contract.write: Create and update insurance contracts
            internal_transfer.write: >-
              Create internal transfers (between 2 Qonto accounts of the same
              organization)
            international_transfer.write: Create international transfers
            membership.read: Retrieve the authentified membership
            membership.write: Invite team members
            offline_access: Retrieve a refresh token
            organization.read: >-
              Retrieve organization, bank accounts, transactions, transfers,
              beneficiaries, labels, memberships, requests & statements
            payment.write: Create external transfers and untrust beneficiaries
            payment_link.read: >-
              Retrieve payment links, their payments, and the available payment
              methods
            payment_link.write: >-
              Connect to the payment links provider, create and deactivate
              payment links
            product.read: Retrieve products
            product.write: Create products
            request_cards.write: Create card requests
            request_review.write: Approve or decline requests
            request_transfers.write: Create transfer requests
            sepa_direct_debit.read: View SEPA Direct Debit payments
            sepa_direct_debit.write: Manage SEPA Direct Debit payments
            supplier_invoice.read: Retrieve supplier invoices
            supplier_invoice.write: Create supplier invoices
            team.read: Retrieve teams
            team.write: Create teams
            terminal.read: View your payment terminals
            terminal.write: Configure your terminals and initiate payments
            webhook: >-
              Receive a notification each time a particular event occurs in
              Qonto
          tokenUrl: https://oauth.qonto.com/oauth2/token
    SecretKey:
      type: apiKey
      description: cf. [API key](/get-started/business-api/authentication/api-key)
      name: Authorization
      in: header

````