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

# Create Customer Invoice

> Add a new Customer Invoice to your portal.\
 \
**Important!** Note that this request is not JSON, but a `multipart/form-data` post.



## OpenAPI

````yaml /openapi.yaml post /customer-invoices
openapi: 3.1.1
info:
  title: MijnKlantportaal API
  version: v1
servers:
  - url: https://api.mijnklantportaal.nl/v1
security:
  - APIKey: []
tags:
  - name: Agreements API
  - name: Appointments API
  - name: Customers API
  - name: Customer Groups API
  - name: Customer Invoices API
  - name: Customer Offers API
  - name: Customer Subscriptions API
  - name: Customer Subscription Packages API
  - name: Files API
  - name: File Request API
  - name: File Share API
  - name: Invoices API
  - name: Payment Links API
  - name: Punch Cards API
  - name: Tickets API
  - name: Webhooks API
paths:
  /customer-invoices:
    post:
      tags:
        - Customer Invoices API
      summary: Create Customer Invoice
      description: >-
        Add a new Customer Invoice to your portal.\
         \
        **Important!** Note that this request is not JSON, but a
        `multipart/form-data` post.
      operationId: create-customer-invoice
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - customerId
                - invoiceNumber
                - issuedAt
                - amount
                - pdf
              properties:
                customerId:
                  type: string
                  example: cst_abc12345def678
                  description: ID of the customer this invoice is meant for
                invoiceNumber:
                  type: string
                  example: 2014-001
                  description: Number of the invoice, as `string`
                issuedAt:
                  type: string
                  example: '2024-04-31'
                  description: Date when the invoice is issued, in `YYYY-mm-dd` format
                dueAt:
                  type: string
                  example: '2024-05-28'
                  description: >-
                    Date when the invoice should be paid at, in `YYYY-mm-dd`
                    format
                paidAt:
                  type: string
                  example: '2024-05-11 12:59:00'
                  description: >-
                    Date and time when the invoice is paid, in `YYYY-mm-dd
                    HH:mm:ss` format. Leave empty when the invoice is still due.
                amount:
                  type: string
                  example: '12.95'
                  description: >-
                    Amount of the invoice, as `string`. Only Euro (EUR) is
                    supported at the moment.
                sendNotification:
                  type: boolean
                  example: true
                  description: >-
                    Indicates if MijnKlantportaal should send out the
                    notification to inform the customer about the new invoice
                pdf:
                  type: string
                  format: binary
                  description: The PDF file of the invoice
      responses:
        '201':
          description: Returning the created Customer Invoice
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerInvoice'
        '422':
          description: Something is wrong with the posted data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_ApiError'
        '426':
          description: The amount of invoices this month reached the license's limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_ApiError'
components:
  schemas:
    CustomerInvoice:
      type: object
      description: Customer Invoice
      properties:
        id:
          type: string
          example: inv_abc12345def678
          description: ID of the invoice, always starting with `inv_`.
        customerId:
          type: string
          example: cst_abc12345def678
          description: ID of the customer which the invoice belongs to.
        invoiceNumber:
          type: string
          example: 2024-001
          description: Number of the invoice as `string`.
        issuedAt:
          type: string
          example: '2024-04-29'
          description: Issue date of the invoice. Formatted as `YYYY-mm-dd`.
        dueAt:
          type: string
          example: '2024-05-28'
          description: Due date for the invoice, if available. Formatted as `YYYY-mm-dd`.
          nullabe: true
        currency:
          type: string
          example: EUR
          description: Currency of the invoice amount.
        amount:
          type: string
          example: '12.95'
          description: Invoice amount as `string`.
        paidAt:
          type: string
          nullable: true
          example: '2024-05-28T21:00:00+02:00'
          description: Date the invoice is marked as paid. Written in ATOM format.
        createdAt:
          type: string
          example: '2024-04-29T21:00:00+02:00'
          description: >-
            Date and time when the invoice was added to MijnKlantportaal.
            Written in ATOM format.
        links:
          type: object
          properties:
            customer:
              type: object
              properties:
                href:
                  type: string
                  description: Endpoint to the Get Customer API
                  example: >-
                    https://api.mijnklantportaal.nl/v1/customers/cst_abc12345def678
                type:
                  type: string
                  example: application/json
                  description: Type of the content the endpoint will return
            onlinePaymentLink:
              type: object
              properties:
                href:
                  type: string
                  description: >-
                    Link towards the payment page for this invoice. ***Be
                    aware:*** This link will be returned, no matter if a payment
                    integration is active.
                  example: >-
                    https://portal.mijnklantportaal.nl/public-invoice/inv_abc123/pay/123-abc
                type:
                  type: string
                  example: text/html
                  description: Type of the content the endpoint will return
    Error_ApiError:
      type: object
      properties:
        message:
          type: string
          description: Explanation what went wrong
  securitySchemes:
    APIKey:
      type: http
      scheme: bearer

````