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

# Create a client invoice



## OpenAPI

````yaml /swagger.yaml post /client_invoices
openapi: 3.1.0
info:
  title: Fohlio REST API
  description: This is the documentation for the Fohlio REST API.
  version: 1.0.0
servers:
  - url: /openapi
  - url: https://app.fohlio.com/be/openapi
security: []
tags:
  - name: Webhooks
    description: Webhook event notifications
paths:
  /client_invoices:
    post:
      tags:
        - Client Invoice
      summary: Create a client invoice
      operationId: client_invoices#create
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyClientInvoiceCreate'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/clientInvoice'
        '403':
          description: Forbidden
      security:
        - apiKey: []
components:
  schemas:
    requestBodyClientInvoiceCreate:
      type: object
      description: >-
        Send project_id and client_id to create an empty invoice, or send
        purchase_order_id to create the invoice from a purchase order. With a
        purchase order, the project, the client and the items come from the
        purchase order, and project_id and client_id are not needed.
      properties:
        purchase_order_id:
          type: integer
          description: Create the invoice from this purchase order.
        project_id:
          type: integer
          description: Required when purchase_order_id is not sent.
        client_id:
          type: integer
          description: Required when purchase_order_id is not sent.
        document_template_id:
          type: integer
          description: Defaults to the current client invoice template of the project.
        label:
          type: string
        project_name:
          type: string
        invoice_date:
          type: string
          format: date
        note:
          type: string
        tax_rate_id:
          type: integer
        metadata:
          type: object
          description: >-
            Custom key-value data. Up to 50 keys; key up to 40 characters;
            string value up to 500 characters.
          additionalProperties:
            type: string
            maxLength: 500
    clientInvoice:
      type: object
      properties:
        id:
          type: integer
        project_id:
          type: integer
        status:
          type: string
          enum:
            - draft
            - sent
            - paid
            - overdue
            - deposited
            - void
            - paid_partially
            - revised
        invoice_date:
          type: string
          nullable: true
        note:
          type: string
          nullable: true
        payment_terms:
          type: array
          items:
            $ref: '#/components/schemas/paymentTerm'
        label:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        tax_amount:
          type: number
        taxable_amount:
          type: number
        amount:
          type: number
        amount_with_tax:
          type: number
        balance:
          type: number
        products_amount:
          type: number
        services_amount:
          type: number
        balance_transactions_amount:
          type: number
        client:
          $ref: '#/components/schemas/contact'
        items:
          type: array
          items:
            $ref: '#/components/schemas/lineItem'
        client_proposal_id:
          type: integer
          nullable: true
        purchase_order_ids:
          type: array
          items:
            type: integer
        metadata:
          type: object
          description: >-
            Custom key-value data. Up to 50 keys; key up to 40 characters;
            string value up to 500 characters.
          additionalProperties:
            type: string
            maxLength: 500
        payments:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              amount:
                type: number
              date:
                type: string
                format: date
              note:
                type: string
                nullable: true
    paymentTerm:
      type: object
      properties:
        id:
          type: string
        amount:
          type: string
        due_date:
          type: string
          nullable: true
        payment_terms:
          type: string
    contact:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        data:
          type: object
          additionalProperties: true
          description: The details of the contact encoded in JSON format.
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/contactAddress'
        people:
          type: array
          items:
            $ref: '#/components/schemas/contactPerson'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/contactCategory'
        metadata:
          type: object
          description: >-
            Custom key-value data. Up to 50 keys; key up to 40 characters;
            string value up to 500 characters.
          additionalProperties:
            type: string
            maxLength: 500
    lineItem:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        unit_type:
          type: string
          nullable: true
        quantity:
          type: number
        price:
          type: number
        taxable:
          type: boolean
        second_taxable:
          type: boolean
          nullable: true
        project_item_id:
          type: integer
          nullable: true
    contactAddress:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        phone:
          type: string
          nullable: true
        post_code:
          type: string
          nullable: true
        address_line_1:
          type: string
          nullable: true
        address_line_2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        priority:
          type: boolean
    contactPerson:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        position:
          type: string
          nullable: true
        note:
          type: string
          nullable: true
        priority:
          type: boolean
    contactCategory:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum:
            - client
            - supplier
            - general_contractor
            - manufacture
            - warehouse
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.