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

# Create a new invoice



## OpenAPI

````yaml openapi.json post /invoices
openapi: 3.1.0
info:
  title: Pink Platform
  version: 0.0.1
servers:
  - url: http://localhost/api
security: []
paths:
  /invoices:
    post:
      tags:
        - Invoice
      summary: Create a new invoice
      operationId: invoices.create
      requestBody:
        description: '`Invoice`'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Invoice'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Invoice created successfully
                  '':
                    type: string
                  transmission_id:
                    type: string
                required:
                  - message
                  - null
                  - transmission_id
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid request data
                  errors:
                    type: string
                required:
                  - error
                  - errors
components:
  schemas:
    Invoice:
      type: object
      properties:
        identification:
          $ref: '#/components/schemas/InvoiceIdentification'
          description: Invoice identification
        issue_date:
          type: string
          format: date-time
          description: Invoice date
        period_start:
          type: string
          format: date-time
          description: Invoice period start date
        period_end:
          type: string
          format: date-time
          description: Invoice period end date
        currency:
          $ref: '#/components/schemas/Currency'
        payment_due_date:
          type: string
          format: date-time
        payment_terms:
          type: string
        buyer:
          $ref: '#/components/schemas/InvoiceParty'
          description: Buyer information
        invoice_recipient:
          $ref: '#/components/schemas/InvoiceParty'
          description: Invoice recipient information
        supplier:
          $ref: '#/components/schemas/InvoiceParty'
          description: Supplier information
        lines:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLine'
        total_amount:
          $ref: '#/components/schemas/PriceRequest'
        net_amount:
          $ref: '#/components/schemas/PriceRequest'
        tax_details:
          type: array
          items:
            $ref: '#/components/schemas/TaxDetail'
      required:
        - identification
        - issue_date
        - currency
        - buyer
        - invoice_recipient
        - supplier
        - lines
        - total_amount
        - net_amount
        - tax_details
      title: Invoice
    InvoiceIdentification:
      type: object
      properties:
        pink_id:
          type: string
          description: Internal platform UUID
        seller_invoice_id:
          type: string
          description: Invoice number from the source system
        seller:
          $ref: '#/components/schemas/PartnerIdentification'
          description: Seller identification
        buyer:
          $ref: '#/components/schemas/PartnerIdentification'
          description: Buyer identification
      required:
        - seller
        - buyer
      title: InvoiceIdentification
    Currency:
      type: string
      enum:
        - EUR
        - USD
        - GBP
      title: Currency
    InvoiceParty:
      type: object
      properties:
        name:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        identification:
          $ref: '#/components/schemas/InvoicePartyIdentification'
      required:
        - name
        - address
      title: InvoiceParty
    InvoiceLine:
      type: object
      properties:
        line_number:
          type: string
        product_id:
          type: string
        product_name:
          type: string
        quantity:
          type: number
        unit:
          $ref: '#/components/schemas/Unit'
        delivery_date:
          type: string
          format: date-time
        free_text:
          type: string
        references:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineReference'
        tax_details:
          type: array
          items:
            $ref: '#/components/schemas/TaxDetail'
        unit_price:
          $ref: '#/components/schemas/Price'
        net_amount:
          $ref: '#/components/schemas/Price'
        total_amount:
          $ref: '#/components/schemas/Price'
      required:
        - line_number
        - product_id
        - product_name
        - quantity
        - unit
        - references
        - tax_details
      title: InvoiceLine
    PriceRequest:
      type: object
      properties:
        amount:
          type: integer
          description: Amount in the smallest currency unit (e.g., cents for EUR)
        currency:
          $ref: '#/components/schemas/Currency'
      required:
        - amount
        - currency
      title: PriceRequest
    TaxDetail:
      type: object
      properties:
        type:
          type: string
          description: Tax type (e.g., VAT)
        rate:
          type: number
          description: Tax rate percentage
        amount:
          $ref: '#/components/schemas/Price'
        taxable_amount:
          $ref: '#/components/schemas/Price'
          description: Taxable basis amount
      required:
        - rate
        - amount
      title: TaxDetail
    PartnerIdentification:
      type: object
      properties:
        pink_id:
          type: string
          description: Internal platform UUID
        gln:
          type: string
          description: Global Location Number (GLN)
      title: PartnerIdentification
    Address:
      type: object
      properties:
        line1:
          type: string
          description: Address line 1 (e.g., street name and number)
        line2:
          type: string
          description: Address line 2 (e.g., apartment, suite, unit, building)
        city:
          type: string
          description: City name
        postal_code:
          type: string
        country:
          $ref: '#/components/schemas/Country'
      required:
        - line1
        - city
        - postal_code
        - country
      title: Address
    InvoicePartyIdentification:
      type: object
      properties:
        gln:
          type: string
          description: Global Location Number (GLN)
        tax_id:
          type: string
          description: Tax identification number (e.g., VAT number)
      title: InvoicePartyIdentification
    Unit:
      type: string
      enum:
        - pc
        - box
        - ctn
        - plt
        - pack
        - bundle
        - kg
        - g
        - mg
        - t
        - l
        - ml
        - m3
      title: Unit
    InvoiceLineReference:
      type: object
      properties:
        identification:
          $ref: '#/components/schemas/InvoiceLineReferenceIdentification'
        line_number:
          type:
            - integer
            - 'null'
      required:
        - identification
        - line_number
      title: InvoiceLineReference
    Price:
      type: object
      properties:
        amount:
          type: integer
          description: Amount in the smallest currency unit (e.g., cents for EUR)
        currency:
          $ref: '#/components/schemas/Currency'
      required:
        - amount
        - currency
      title: Price
    Country:
      type: string
      enum:
        - AT
        - BE
        - BG
        - HR
        - CY
        - CZ
        - DK
        - EE
        - FI
        - FR
        - DE
        - GR
        - HU
        - IE
        - IT
        - LV
        - LT
        - LU
        - MT
        - NL
        - PL
        - PT
        - RO
        - SK
        - SI
        - ES
        - SE
        - AL
        - AD
        - BY
        - BA
        - IS
        - LI
        - MD
        - MC
        - ME
        - MK
        - 'NO'
        - RU
        - SM
        - RS
        - CH
        - TR
        - UA
        - GB
        - VA
      title: Country
    InvoiceLineReferenceIdentification:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/DocumentType'
        vendor_id:
          type: string
        pink_id:
          type:
            - string
            - 'null'
      required:
        - type
        - vendor_id
        - pink_id
      title: InvoiceLineReferenceIdentification
    DocumentType:
      type: string
      enum:
        - DELIVERY_NOTE
        - ORDER
      title: DocumentType
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message

````