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

# Create Invoices

> Create a new invoice with comprehensive details including issuer/receiver relationships, payment terms, line items, and document attachments. Supports both basic invoice creation and complex scenarios with detailed billing contexts.



## OpenAPI

````yaml POST /v1/invoices
openapi: 3.1.0
info:
  title: Well Document API
  version: 1.0.0
  description: API for uploading and managing financial documents in the Well platform
servers:
  - url: https://api.wellapp.ai
security: []
paths:
  /v1/invoices:
    post:
      tags:
        - Invoices
      summary: Create a new invoice
      description: >-
        Create a new invoice with comprehensive details including
        issuer/receiver relationships, payment terms, line items, and document
        attachments. Supports both basic invoice creation and complex scenarios
        with detailed billing contexts.
      operationId: createInvoice
      parameters:
        - $ref: '#/components/parameters/AuthorizationHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoicePost'
            examples:
              complete_invoice:
                summary: Complete invoice with payment and relationships
                description: >-
                  Example of creating a comprehensive invoice with all
                  relationships and payment details
                value:
                  type: invoices
                  attributes:
                    reference_number: INV-2025-0456
                    issue_date: '2025-06-19'
                    due_date: '2025-07-19'
                    document_type_code: '380'
                    local_currency: EUR
                    local_totals:
                      items_total: 2500
                      tax_total: 500
                      grand_total: 3000
                    terms: Net 30
                    status: sent
                    payment_status:
                      paid: true
                      local_amount_paid: 3000
                      local_amount_remaining: 0
                    billing_context: subscription
                    description: Monthly cloud hosting subscription
                  relationships:
                    issuer:
                      data:
                        type: company
                        id: company_id
                    receiver:
                      data:
                        type: company
                        id: company_id_2
                    payment_type:
                      data:
                        - type: payment_means
                          id: id1
                        - type: payment_means
                          id: id2
                    invoice_items:
                      data:
                        - type: invoice_item
                          id: id1
                        - type: invoice_item
                          id: id2
                    documents:
                      data:
                        type: document
                        id: doc_original_invoice
      responses:
        '201':
          description: Invoice created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceResponse'
              example:
                data:
                  type: invoice
                  id: invoice_550e8400-e29b-41d4-a716-446655440000
                  attributes:
                    reference_number: INV-2025-001
                    document_type: commercial_invoice
                    document_type_code: '380'
                    issue_date: '2025-01-15'
                    due_date: '2025-02-15'
                    local_currency: EUR
                    local_totals:
                      subtotal: '1000.00'
                      tax_total: '200.00'
                      total_amount: '1200.00'
                    terms: Payment due within 30 days
                    billing_context: subscription
                    payment_status:
                      paid: true
                      amount_paid: 123
                      amount_remaining: 123
                    status: draft
                    description: Professional services invoice for January 2025
                    created_at: '2025-01-15T10:30:00Z'
                    updated_at: '2025-01-15T10:30:00Z'
                  relationships:
                    issuer:
                      data:
                        type: company
                        id: company-issuer-uuid
                    receiver:
                      data:
                        type: company
                        id: company-receiver-uuid
                    payment_means:
                      data:
                        - type: payment_means
                          id: pm_1
                    invoice_items:
                      data:
                        - type: invoice_item
                          id: item_1
                    documents:
                      data:
                        type: document
                        id: doc_original_invoice
                    people:
                      data:
                        - type: people
                          id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                included:
                  - type: people
                    id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    attributes:
                      first_name: John
                      last_name: Smith
                      full_name: John Smith
                      email: jsmith@example.com
                      created_at: '2023-11-07T05:31:56Z'
                      updated_at: '2023-11-07T05:31:56Z'
                  - type: document
                    id: doc_original_invoice
                    attributes:
                      file_name: invoice_2025_001.pdf
                      status: processed
                      uploaded_at: '2023-11-07T05:31:56Z'
                      processed_at: '2023-11-07T05:31:56Z'
                      file_type: application/pdf
                      size_bytes: 245678
                      created_at: '2023-11-07T05:31:56Z'
                      updated_at: '2023-11-07T05:31:56Z'
                  - type: invoice_item
                    id: item_1
                    attributes:
                      line_id: '1'
                      sku: WM-1001
                      name: Wireless Mouse
                      description: Ergonomic wireless mouse with USB receiver
                      unit_price: 25
                      currency: EUR
                      unit: EA
                      min_quantity: 1
                      max_quantity: 500
                      tax:
                        rate: 20
                        category: standard
                        scheme: VAT
                      period:
                        start: '2025-06-26'
                        end: '2025-06-27'
                      created_at: '2025-05-11T13:42:12Z'
                      updated_at: '2025-05-11T13:45:20Z'
                  - type: payment_means
                    id: pm_1
                    attributes:
                      type: card_details
                      scheme: SEPA
                      status: active
                      account_details:
                        iban: DE89370400440532013000
                        bic: COBADEFFXXX
                        account_number: '532013000'
                        routing_number: '37040044'
                        currency: EUR
                      bank_details:
                        bank_name: Commerzbank AG
                        bank_code: '37040044'
                        branch_name: Main Branch
                        branch_code: '440'
                      card_details:
                        masked_pan: '****1234'
                        brand: visa
                        card_type: credit
                        expiry_month: 12
                        expiry_year: 2027
                        cardholder_name: John Smith
                      digital_wallet:
                        provider: paypal
                        wallet_id: john.smith@example.com
                        wallet_type: personal
                      compliance:
                        kyc_status: verified
                        aml_status: cleared
                        sanctions_check: passed
                        last_compliance_check: '2023-11-07T05:31:56Z'
                      metadata:
                        source: api
                        external_id: ext_pm_12345
                      nickname: Primary Payment Method
                      description: Main company payment account
                      tags:
                        - primary
                        - sepa
                      created_at: '2023-11-07T05:31:56Z'
                      updated_at: '2023-11-07T05:31:56Z'
                  - type: company
                    id: company-receiver-uuid
                    attributes:
                      name: ACME Corporation
                      description: Technology solutions provider
                      domain_name_primary_link_url: acme.com
                      locale: en
                      tax_id:
                        value: DE123456789
                        type: VAT
                      registration:
                        trade_name: TechSol
                        registered_name: ACME Corporation GmbH
                      registration_number:
                        business_type: GmbH
                        value: HRB 123456
                        registry_name: Handelsregister Berlin
                        registry_country: DE
                      workspace_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                      created_at: '2023-11-07T05:31:56Z'
                      updated_at: '2023-11-07T05:31:56Z'
                  - type: company
                    id: company-issuer-uuid
                    attributes:
                      name: Service Provider Inc
                      description: Professional services company
                      domain_name_primary_link_url: serviceprovider.com
                      locale: en
                      tax_id:
                        value: FR987654321
                        type: VAT
                      registration:
                        trade_name: Service Provider
                        registered_name: Service Provider Inc.
                      registration_number:
                        business_type: Inc
                        value: RCS 987654
                        registry_name: Paris Commercial Registry
                        registry_country: FR
                      workspace_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                      created_at: '2023-11-07T05:31:56Z'
                      updated_at: '2023-11-07T05:31:56Z'
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
              examples:
                missing_required_fields:
                  summary: Missing required invoice fields
                  value:
                    error:
                      message: Missing required fields
                      code: validation_error
                      details:
                        missing_fields:
                          - reference_number
                          - issue_date
                          - local_currency
                        provided_data:
                          due_date: '2025-02-15'
                invalid_currency:
                  summary: Invalid currency code provided
                  value:
                    error:
                      message: Invalid currency code
                      code: validation_error
                      details:
                        field: local_currency
                        provided_value: INVALID
                        allowed_values:
                          - EUR
                          - USD
                          - GBP
                          - CHF
                invalid_date_range:
                  summary: Due date before issue date
                  value:
                    error:
                      message: Due date must be after issue date
                      code: validation_error
                      details:
                        issue_date: '2025-01-15'
                        due_date: '2025-01-10'
                        field: due_date
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
      description: Bearer token for authentication
  schemas:
    InvoicePost:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              enum:
                - invoice
              description: Resource type identifier
            attributes:
              $ref: '#/components/schemas/InvoiceCreateAttributes'
            relationships:
              $ref: '#/components/schemas/InvoiceRelationsShipPost'
            included:
              $ref: '#/components/schemas/InvoiceIncludedPost'
          required:
            - type
            - attributes
            - relationships
      required:
        - data
      description: Schema for creating a new invoice
    InvoiceResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              enum:
                - invoice
              description: Resource type identifier
            id:
              type: string
              format: uuid
              description: Unique identifier for the created invoice
              example: invoice_550e8400-e29b-41d4-a716-446655440000
            attributes:
              type: object
              properties:
                reference_number:
                  type: string
                  description: Unique reference number for the invoice
                  example: INV-2025-001
                document_type:
                  type: string
                  description: Type of invoice document
                  example: commercial_invoice
                document_type_code:
                  type: string
                  description: Standard document type code
                  example: '380'
                issue_date:
                  type: string
                  format: date
                  description: Date when the invoice was issued
                  example: '2025-01-15'
                due_date:
                  type: string
                  format: date
                  description: Payment due date
                  example: '2025-02-15'
                local_currency:
                  type: string
                  description: Currency code for the invoice
                  example: EUR
                local_totals:
                  type: object
                  properties:
                    subtotal:
                      type: string
                      description: Subtotal before taxes and discounts
                      example: '1000.00'
                    tax_total:
                      type: string
                      description: Total tax amount
                      example: '200.00'
                    total_amount:
                      type: string
                      description: Final total amount
                      example: '1200.00'
                terms:
                  type: string
                  description: Contractual payment terms
                billing_context:
                  type: string
                  description: Billing context identifier
                  example: subscription
                payment_status:
                  type: object
                  properties:
                    paid:
                      type: boolean
                    amount_paid:
                      type: number
                    amount_remaining:
                      type: number
                status:
                  type: string
                  enum:
                    - draft
                    - sent
                    - viewed
                    - accepted
                    - rejected
                    - cancelled
                  description: Invoice lifecycle status
                  example: draft
                description:
                  type: string
                  description: Invoice description or notes
                  example: Professional services invoice for January 2025
                created_at:
                  type: string
                  format: date-time
                  description: Timestamp when the invoice was created
                  example: '2025-01-15T10:30:00Z'
                updated_at:
                  type: string
                  format: date-time
                  description: Timestamp when the invoice was last updated
                  example: '2025-01-15T10:30:00Z'
            relationships:
              type: object
              properties:
                issuer:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: company
                        id:
                          type: string
                          example: company-uuid
                          description: uuid of company
                  description: Company issuing the invoice
                receiver:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: company
                        id:
                          type: string
                          example: company-uuid
                          description: uuid of company
                  description: Company receiving the invoice
                payment_means:
                  type: object
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            const: payment_means
                          id:
                            type: string
                            example: pm_1
                  description: Associated payment methods
                invoice_items:
                  type: object
                  properties:
                    data:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            const: payment_means
                          id:
                            type: string
                            example: pm_1
                  description: Line items included in the invoice
                document:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: document
                        id:
                          type: string
                          example: document-uuid
                          description: uuid of document
                  description: Supporting document attached to the invoice
                people:
                  $ref: '#/components/schemas/PersonsRelationshipData'
              description: Relationships with other resources
            included:
              type: object
              properties:
                documents:
                  type: object
                  description: Supporting document attached to the invoice
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: company
                        id:
                          type: string
                          format: uuid
                          description: UUID of the parent company
                        attributes:
                          $ref: '#/components/schemas/DocumentAttributes'
                invoice_items:
                  type: object
                  description: Correspondent/intermediary banks for routing (optional)
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: company
                        id:
                          type: string
                          format: uuid
                          description: UUID of the parent company
                        attributes:
                          $ref: '#/components/schemas/InvoiceItemsAttributes'
                payment_means:
                  type: object
                  description: Correspondent/intermediary banks for routing (optional)
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: company
                        id:
                          type: string
                          format: uuid
                          description: UUID of the parent company
                        attributes:
                          $ref: '#/components/schemas/PaymentMeansAttributes'
                receiver:
                  type: object
                  description: Correspondent/intermediary banks for routing (optional)
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: company
                        id:
                          type: string
                          format: uuid
                          description: UUID of the parent company
                        attributes:
                          $ref: '#/components/schemas/CompanyAttributes'
                issuer:
                  type: object
                  description: Correspondent/intermediary banks for routing (optional)
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          const: company
                        id:
                          type: string
                          format: uuid
                          description: UUID of the parent company
                        attributes:
                          $ref: '#/components/schemas/CompanyAttributes'
      description: Response schema for successfully created invoice
    BadRequestError:
      type: object
      properties:
        code:
          type: string
          example: SCHEMA_VALIDATION_ERROR
          description: Error code identifier
        status:
          type: integer
          example: 400
          description: HTTP status code
        title:
          type: string
          example: Validation Error
          description: Error title
        message:
          type: string
          example: The request is invalid
          description: Detailed error message
        details:
          type: array
          items:
            type: object
            properties:
              instancePath:
                type: string
                description: Path to the invalid field in the request
              schemaPath:
                type: string
                description: Path to the validation rule in the schema
              keyword:
                type: string
                description: Validation keyword that failed
              params:
                type: object
                description: Parameters related to the validation failure
              message:
                type: string
                description: Human-readable validation error message
          description: Array of detailed validation errors
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta
    UnauthorizedError:
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
          description: Error code identifier
        status:
          type: integer
          example: 401
          description: HTTP status code
        title:
          type: string
          example: Unauthorized
          description: Error title
        message:
          type: string
          example: You are not authorized to access this resource
          description: Detailed error message
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta
    InvoiceCreateAttributes:
      type: object
      properties:
        reference_number:
          type: string
          description: Unique reference number for the invoice
          example: INV-2025-001
        document_type_code:
          type: string
          description: Standard document type code (UN/EDIFACT)
          example: '380'
        issue_date:
          type: string
          format: date
          description: Date when the invoice was issued
          example: '2025-01-15'
        due_date:
          type: string
          format: date
          description: Payment due date
          example: '2025-02-15'
        local_currency:
          type: string
          description: Currency code for the invoice (ISO 4217)
          pattern: ^[A-Z]{3}$
          example: EUR
        local_totals:
          type: object
          properties:
            items_total:
              type: number
              description: Subtotal before taxes or discounts
              example: 2500
            tax_total:
              type: number
              description: Total tax amount
              default: 0
              example: 0
            grand_total:
              type: number
              description: Total after tax/discounts
              example: 50
          required:
            - items_total
          description: Financial totals for the invoice
        terms:
          type: string
          example: Net 30
          description: Contractual payment terms
        billing_context:
          type: string
          description: Billing context identifier
          example: subscription
        payment_status:
          type: object
          properties:
            paid:
              type: boolean
              description: Whether the invoice has been paid
              example: true
            local_amount_paid:
              type: number
              description: Amount paid in local currency
              example: 3000
            local_amount_remaining:
              type: number
              description: Remaining unpaid amount in local currency
              example: 0
          required:
            - paid
          description: Payment status and amounts
        description:
          type: string
          description: Invoice description or notes
          example: Professional services invoice for January 2025
      required:
        - reference_number
        - document_type_code
        - local_currency
        - local_totals
      description: Invoice attributes and data
    InvoiceRelationsShipPost:
      type: object
      properties:
        issuer:
          type: object
          properties:
            data:
              type: object
              properties:
                type:
                  type: string
                  const: company
                id:
                  type: string
                  example: company-uuid
                  description: >-
                    UUID of an existing company or temp-id that references a
                    company defined in the included array
          required:
            - data
          description: Company issuing the invoice
        receiver:
          type: object
          properties:
            data:
              type: object
              properties:
                type:
                  type: string
                  const: company
                id:
                  type: string
                  example: company-uuid
                  description: >-
                    UUID of an existing company or temp-id that references a
                    company defined in the included array
          required:
            - data
          description: Company receiving the invoice
        payment_means:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: payment_means
                  id:
                    type: string
                    example: pm_1
                    description: >-
                      UUID of an existing payment means or temp-id that
                      references a payment means defined in the included array
          description: Associated payment methods
        invoice_items:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: invoice_item
                  id:
                    type: string
                    example: pm_1
                    description: >-
                      UUID of an existing invoice item or temp-id that
                      references an invoice item defined in the included array
          description: Line items included in the invoice
        documents:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: document
                  id:
                    type: string
                    example: doc_original_invoice
                    description: >-
                      UUID of an existing document or temp-id that references a
                      document defined in the included array
          description: Supporting documents attached to the invoice
        people:
          $ref: '#/components/schemas/WorkspaceRelationRequest'
      required:
        - issuer
        - receiver
      description: Relationships with other resources
    InvoiceIncludedPost:
      type: object
      properties:
        issuer:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: company
                  id:
                    type: string
                    example: company-2
                    description: Temp-id that references a company in the relationships
                  attributes:
                    $ref: '#/components/schemas/CompanyCreateAttributes'
                required:
                  - type
                  - id
                  - attributes
        receiver:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: company
                  id:
                    type: string
                    example: company-2
                    description: Temp-id that references a company in the relationships
                  attributes:
                    $ref: '#/components/schemas/CompanyCreateAttributes'
                required:
                  - type
                  - id
                  - attributes
        payment_means:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: payment_means
                  id:
                    type: string
                    example: pm-1
                    description: >-
                      Temp-id that references a payment means in the
                      relationships
                  attributes:
                    $ref: '#/components/schemas/PaymentMeansCreateAttributes'
                required:
                  - type
                  - id
                  - attributes
        invoice_items:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: invoice_item
                  id:
                    type: string
                    example: item-1
                    description: >-
                      Temp-id that references an invoice item in the
                      relationships
                  attributes:
                    $ref: '#/components/schemas/InvoiceItemsCreateAttributes'
                required:
                  - type
                  - id
                  - attributes
        documents:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: document
                  id:
                    type: string
                    example: doc-1
                    description: Temp-id that references a document in the relationships
                  attributes:
                    $ref: '#/components/schemas/DocumentCreateAttributes'
                required:
                  - type
                  - id
                  - attributes
        people:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: people
                  id:
                    type: string
                    example: person-1
                    description: Temp-id that references a person in the relationships
                  attributes:
                    $ref: '#/components/schemas/PeopleCreateAttributes'
                required:
                  - type
                  - id
                  - attributes
    PersonsRelationshipData:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PersonReference'
    DocumentAttributes:
      type: object
      properties:
        file_name:
          type: string
        status:
          type: string
        uploaded_at:
          type: string
          format: date-time
        processed_at:
          type: string
          format: date-time
        file_type:
          type: string
        size_bytes:
          type: integer
    InvoiceItemsAttributes:
      type: object
      properties:
        line_id:
          type: string
          description: Line identifier within the invoice
          example: '1'
        sku:
          type: string
          description: Stock Keeping Unit identifier
          example: WM-1001
        name:
          type: string
          description: Product or service name
          example: Wireless Mouse
        description:
          type: string
          description: Detailed description of the item
          example: Ergonomic wireless mouse with USB receiver
        unit_price:
          type: number
          format: decimal
          minimum: 0
          description: Unit price in local currency
          example: 25
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: ISO 4217 currency code
          example: EUR
        unit:
          type: string
          description: Unit of measurement
          example: EA
        min_quantity:
          type: integer
          minimum: 0
          description: Minimum quantity allowed
          example: 1
        max_quantity:
          type: integer
          minimum: 1
          description: Maximum quantity allowed
          example: 500
        tax:
          type: object
          properties:
            rate:
              type: number
              format: decimal
              minimum: 0
              maximum: 100
              description: Tax rate as percentage
              example: 20
            category:
              type: string
              description: Tax category
              example: standard
            scheme:
              type: string
              description: Tax scheme identifier
              example: VAT
        period:
          type: object
          properties:
            start:
              type: string
              format: date
              description: Service period start date
              example: '2025-06-26'
            end:
              type: string
              format: date
              description: Service period end date
              example: '2025-06-27'
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
          example: '2025-05-11T13:42:12Z'
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
          example: '2025-05-11T13:45:20Z'
    PaymentMeansAttributes:
      type: object
      properties:
        type:
          type: string
          enum:
            - card_details
            - account_details
            - wallet_details
            - cash_details
            - check_details
            - crypto_details
            - other
          description: >-
            Type of payment means. See [payment means
            types](/enums/payment-means) for details.
        scheme:
          type: string
          enum:
            - SEPA
            - SWIFT
            - ACH
            - FASTER_PAYMENTS
            - VISA
            - MASTERCARD
            - AMEX
            - PAYPAL
            - APPLEPAY
            - GOOGLEPAY
            - STRIPE
            - LOCAL
            - OTHER
          description: >-
            Payment scheme or network. See [scheme types](/enums/sheme-type) for
            details.
        status:
          type: string
          enum:
            - active
            - inactive
            - pending_verification
            - suspended
            - expired
            - blocked
          description: >-
            Current status of the payment means. See [payment means
            status](/enums/payment-means-status) for details.
        account_details:
          type: object
          description: Bank account details for account_details type
          properties:
            iban:
              type: string
              description: International Bank Account Number
            bic:
              type: string
              description: Bank Identifier Code (SWIFT)
            account_number:
              type: string
              description: Local account number (alternative to IBAN)
            routing_number:
              type: string
              description: Bank routing number (US ACH)
            currency:
              type: string
              description: Currency code (ISO 4217)
        bank_details:
          type: object
          description: Additional bank information
          properties:
            bank_name:
              type: string
              description: Name of the bank
            bank_code:
              type: string
              description: Bank code or identifier
            branch_name:
              type: string
              description: Bank branch name
            branch_code:
              type: string
              description: Bank branch code
        card_details:
          type: object
          description: Credit/debit card details for card_details type
          properties:
            masked_pan:
              type: string
              description: Masked Primary Account Number (PCI DSS compliant)
            brand:
              type: string
              enum:
                - visa
                - mastercard
                - amex
                - discover
                - diners
                - jcb
                - unionpay
                - other
              description: Card brand
            card_type:
              type: string
              enum:
                - credit
                - debit
                - prepaid
                - charge
              description: Type of card
            expiry_month:
              type: integer
              description: Card expiry month
            expiry_year:
              type: integer
              description: Card expiry year
            cardholder_name:
              type: string
              description: Name as printed on card
        digital_wallet:
          type: object
          description: Digital wallet details for wallet_details type
          properties:
            provider:
              type: string
              enum:
                - paypal
                - applepay
                - googlepay
                - stripe
                - square
                - venmo
                - cashapp
                - other
              description: Digital wallet provider
            wallet_id:
              type: string
              description: Wallet identifier (email, phone, etc.)
            wallet_type:
              type: string
              enum:
                - personal
                - business
                - merchant
              description: Type of wallet account
        compliance:
          type: object
          description: Compliance and verification status
          properties:
            kyc_status:
              type: string
              enum:
                - pending
                - in_progress
                - completed
                - failed
                - not_required
              description: Know Your Customer verification status
            aml_status:
              type: string
              enum:
                - pending
                - in_progress
                - cleared
                - flagged
                - not_required
              description: Anti-Money Laundering check status
            sanctions_check:
              type: string
              enum:
                - pending
                - passed
                - failed
                - not_required
              description: Sanctions screening status
            last_compliance_check:
              type: string
              format: date-time
              description: Last compliance check timestamp
        metadata:
          type: object
          description: System metadata
          properties:
            source:
              type: string
              enum:
                - api
                - dashboard
                - import
                - connector
              description: How the payment means was created
            external_id:
              type: string
              description: External system identifier
        nickname:
          type: string
          description: User-friendly name for the payment means
        description:
          type: string
          description: Additional description of the payment means
        tags:
          type: array
          items:
            type: string
          description: Tags for categorization
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
    CompanyAttributes:
      type: object
      properties:
        description:
          type: string
        domain_name_primary_link_url:
          type: string
          format: url
          maxLength: 500
          description: >-
            The domain url from the website or email address of the company.
            Used as unique identifier in some cases.
          examples:
            - acme.com
        tax_id:
          type: object
          properties:
            value:
              description: Tax ID issued by local or national tax authority.
              type: string
              examples:
                - DE123456789
            type:
              description: >-
                Type of tax ID, useful for applying formatting and validation
                rules.
              type: string
              examples:
                - VAT
        registration:
          type: object
          properties:
            trade_name:
              description: Commercial or branding name (if different from registered name).
              type: string
              examples:
                - TechSol
            registered_name:
              description: Legal company name.
              type: string
              minLength: 1
              maxLength: 100
              examples:
                - Red Hat Inc.
        registration_number:
          type: object
          properties:
            business_type:
              description: Legal entity structure type.
              type: string
              examples:
                - GmbH
            value:
              description: Official company registration number.
              type: string
              examples:
                - HRB 123456
            registry_name:
              description: Name of the official registration body.
              type: string
              examples:
                - Handelsregister Berlin
            registry_country:
              description: Country of the registry authority. (string (ISO 3166-1 alpha-2))
              type: string
              examples:
                - DE
        workspace_id:
          type: string
          format: uuid
          description: UUID of the workspace associated with this company
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    WorkspaceRelationRequest:
      type: object
      properties:
        data:
          type: array
          items:
            oneOf:
              - properties:
                  type:
                    type: string
                    enum:
                      - workspace
                  external_workspace_id:
                    type: string
                    description: External workspace identifier
                required:
                  - type
                  - external_workspace_id
              - properties:
                  type:
                    type: string
                    enum:
                      - workspace
                  id:
                    type: string
                    format: uuid
                    description: >-
                      UUID of an existing workspace or temp-id that references
                      an workspace defined in the included array
                required:
                  - type
                  - id
    CompanyCreateAttributes:
      type: object
      properties:
        locale:
          type: string
          pattern: ^[a-z]{2}(-[A-Z]{2})?$
          description: >-
            Language settings.That’s the locale for the business relationship.
            Emails or documents can be used to identify the locale. Default EN.
          example: en-US
        domain_name_primary_link_url:
          type: string
          format: uri
          description: >-
            The domain url from the website or email address of the company.
            Used as unique identifier in some cases.
          example: https://www.techcorp.com
        tax_id:
          type: object
          properties:
            value:
              type: string
              description: Tax ID issued by local or national tax authority.
              example: DE123456789
            type:
              type: string
              description: >-
                Type of tax ID, useful for applying formatting and validation
                rules.[all tax id types](/enums/tax-id) See all available labels
                for complete list.
              example:
                - VAT
                - TVA
                - IVA
                - ...
        registration:
          oneOf:
            - type: object
              properties:
                trade_name:
                  type: string
                  description: >-
                    Commercial or branding name (if different from registered
                    name).
                  example: TechSol
                registered_name:
                  type: string
                  description: Legal company name
                  example: TechCorp AI Solutions LLC
              required:
                - registered_name
            - type: object
              properties:
                trade_name:
                  type: string
                  description: >-
                    Commercial or branding name (if different from registered
                    name).
                  example: TechSol
                registered_name:
                  type: string
                  description: Legal company name
                  example: TechCorp AI Solutions LLC
              required:
                - trade_name
        registration_number:
          type: object
          properties:
            business_type:
              type: string
              enum:
                - Inc
                - Corp
                - LLC
                - GmbH
                - Ltd
                - SA
                - SAS
              description: >-
                Legal entity structure type. See [all business entity
                types](/enums/business-entity-by-country) for complete list.
              example: GmbH
            value:
              type: string
              description: Official company registration number.
              example: HRB 123456
            registry_name:
              type: string
              description: >-
                Name of the official registration body. See [all available
                registry name](/enums/registry-name) for complete list.
              example: Handelsregister Berlin
            registry_country:
              type: string
              pattern: ^[A-Z]{2}$
              description: |-
                Country of the registry authority. 
                 Must be valid ISO country code
              example: DE, FR, US, etc.
        description:
          type: string
          minLength: 1
          maxLength: 500
          description: Company description explaining business purpose in max 2 sentences.
          example: An innovative technology company focused on AI solutions
      required:
        - registration
    PaymentMeansCreateAttributes:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - card_details
            - account_details
            - wallet_details
            - ...
          description: >-
            Type of payment means. See [payment means
            types](/enums/payment-means) for details.
        scheme:
          type: string
          enum:
            - SEPA
            - SWIFT
            - ACH
            - ...
          description: >-
            Payment scheme or network. See [scheme types](/enums/sheme-type) for
            details.
        status:
          type: string
          enum:
            - active
            - inactive
            - pending_verification
            - suspended
            - expired
            - blocked
          description: >-
            Current status of the payment means. See [payment means
            status](/enums/payment-means-status) for details.
        account_details:
          type: object
          description: Bank account details for account_details type
          properties:
            iban:
              type: string
              pattern: ^[A-Z]{2}[0-9]{2}[A-Z0-9]+$
              description: International Bank Account Number
            bic:
              type: string
              pattern: ^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$
              description: Bank Identifier Code (SWIFT)
            sort_code:
              type: string
              pattern: ^[0-9]{6}$
              description: Bank sort code (UK)
            account_number:
              type: string
              description: Local account number (alternative to IBAN)
            routing_number:
              type: string
              description: Bank routing number (US ACH)
            currency:
              type: string
              pattern: ^[A-Z]{3}$
              description: Currency code (ISO 4217)
        bank_details:
          type: object
          description: Additional bank information
          properties:
            bank_name:
              type: string
              description: Name of the bank
            bank_code:
              type: string
              description: Bank code or identifier
            branch_name:
              type: string
              description: Bank branch name
            branch_code:
              type: string
              description: Bank branch code
        card_details:
          type: object
          description: Credit/debit card details for card_details type
          properties:
            masked_pan:
              type: string
              pattern: ^\*{4}-\*{4}-\*{4}-[0-9]{4}$
              description: Masked Primary Account Number (PCI DSS compliant)
            brand:
              type: string
              enum:
                - visa
                - mastercard
                - amex
                - discover
                - diners
                - jcb
                - unionpay
                - other
              description: Card brand
            card_type:
              type: string
              enum:
                - credit
                - debit
                - prepaid
                - charge
              description: Type of card
            expiry_month:
              type: integer
              minimum: 1
              maximum: 12
              description: Card expiry month
            expiry_year:
              type: integer
              minimum: 2024
              description: Card expiry year
            cardholder_name:
              type: string
              description: Name as printed on card
        digital_wallet:
          type: object
          description: Digital wallet details for wallet_details type
          properties:
            provider:
              type: string
              enum:
                - paypal
                - applepay
                - googlepay
                - stripe
                - square
                - venmo
                - cashapp
                - other
              description: Digital wallet provider
            wallet_id:
              type: string
              description: Wallet identifier (email, phone, etc.)
            wallet_type:
              type: string
              enum:
                - personal
                - business
                - merchant
              description: Type of wallet account
        compliance:
          type: object
          description: Compliance and verification status
          properties:
            kyc_status:
              type: string
              enum:
                - pending
                - in_progress
                - completed
                - failed
                - not_required
              description: Know Your Customer verification status
            aml_status:
              type: string
              enum:
                - pending
                - in_progress
                - cleared
                - flagged
                - not_required
              description: Anti-Money Laundering check status
        nickname:
          type: string
          maxLength: 100
          description: User-friendly name for the payment means
        description:
          type: string
          maxLength: 500
          description: Additional description of the payment means
        tags:
          type: array
          items:
            type: string
          description: Tags for categorization
    InvoiceItemsCreateAttributes:
      type: object
      properties:
        line_id:
          type: string
          description: Line identifier within the invoice
          example: '1'
        sku:
          type: string
          description: Stock Keeping Unit identifier
          example: WM-1001
        name:
          type: string
          description: Product or service name
          example: Wireless Mouse
        description:
          type: string
          description: Detailed description of the item
          example: Ergonomic wireless mouse with USB receiver
        unit_price:
          type: number
          format: decimal
          minimum: 0
          description: Unit price in local currency
          example: 25
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: ISO 4217 currency code
          example: EUR
        unit:
          type: string
          enum:
            - EA
            - HUR
            - KGM
            - ...
          description: >-
            Unit of measurement. See [all available
            units](/enums/invoice-line-unit) for complete list.
          example: EA
        min_quantity:
          type: integer
          minimum: 0
          description: Minimum quantity allowed
          example: 1
        max_quantity:
          type: integer
          minimum: 1
          description: Maximum quantity allowed
          example: 500
        tax:
          type: object
          properties:
            rate:
              type: number
              format: decimal
              minimum: 0
              maximum: 100
              description: Tax rate as percentage
              example: 20
            category:
              type: string
              enum:
                - standard
                - reduced
                - exempt
                - ...
              description: >-
                Tax category classification. See [all tax
                categories](/enums/tax-cat) for complete list.
              example: standard
            scheme:
              type: string
              enum:
                - VAT
                - EU_VAT
                - UK_VAT
                - ...
              description: >-
                Tax scheme classification. See [all tax
                schemes](/enums/tax-scheme) for complete list.
              example: VAT
        period:
          type: object
          properties:
            start:
              type: string
              format: date
              description: Service period start date
              example: '2025-06-26'
            end:
              type: string
              format: date
              description: Service period end date
              example: '2025-06-27'
      required:
        - line_id
        - name
        - unit_price
        - currency
    DocumentCreateAttributes:
      type: object
      properties:
        file_name:
          type: string
        status:
          type: string
        file_type:
          type: string
        size_bytes:
          type: integer
    PeopleCreateAttributes:
      type: object
      properties:
        first_name:
          type: string
          minLength: 1
          maxLength: 50
          description: First name of the person
          example: John
        last_name:
          type: string
          minLength: 1
          maxLength: 50
          description: Last name of the person (required)
          example: Doe
      required:
        - first_name
        - last_name
      additionalProperties: false
    PersonReference:
      type: object
      properties:
        type:
          type: string
          const: people
        id:
          type: string
          format: uuid
          description: UUID of the person
        attributes:
          type: object
          properties:
            first_name:
              type: string
            last_name:
              type: string
            full_name:
              type: string
            email:
              type: string
              format: email
            created_at:
              type: string
              format: date-time
      required:
        - type
        - id

````