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

# Create invoice from data (no PDF)

> Create an invoice from JSON, without a file. Every call creates **a new invoice** on the claim; its amounts
add to the claim's `total_claim_amount`. No automatic reading runs on this path, so `data_extraction_status`
is `manual`. Amounts take at most two decimal places.

Reminder fees (`creditor_reminder_fees_incurred`) can no longer be added once a collection letter including
them has gone out (`400`).

**Partly paid before handover:** keep `invoice_amount_gross` at the amount on the invoice and send what the
debtor already paid you in `amount_paid` (optionally with `last_payment_date`). We then collect only the open
rest. Send reminder fees the debtor has paid only for the part still open. Do not report such a payment
through `/payments` — that endpoint records money paid during collection.


## Overview

Create an invoice by submitting the invoice data as structured **JSON**, without uploading a PDF document. Use this endpoint when you have no invoice file and want to pass all fields manually.

Unlike the PDF upload endpoint, no OCR runs on this path, so the created invoice is marked with `data_extraction_status: "manual"`. The invoice amounts automatically update the claim's `total_claim_amount` via database triggers.

> [!NOTE]
>
> Need to attach an actual PDF invoice (with OCR extraction)? Use
> `POST /openapi/claims//invoices` (multipart/form-data) instead.

### Request Format

* Content-Type: `application/json`
* All fields are optional unless your partner agreement requires them (see *Partner intake rules* in the API description: `default_date`, `creditor_reminder_dates`, `contract_date`, `subject`). Amounts must be non-negative and dates must be valid ISO 8601 (`YYYY-MM-DD`); invalid values return a `400`.
* `default_date`, `creditor_reminder_dates`, `default_basis` and `contract_date` state how and when the debtor fell into default. `default_basis: "bgb_286_3"` (default 30 days after the due date and receipt of the invoice, § 286 (3) BGB) needs no reminder dates; against a consumer it applies only if the invoice pointed this out.
* If your agreement prohibits health data, `subject`, `invoice_issuer` and `invoice_recipient` are checked; a match returns `400 PROHIBITED_DATA` naming the field.

## Authentication

Requires API Token authentication via Bearer token.

## Path Parameters

**claim\_id** `string` *required*

UUID of the claim you are attaching an invoice to

## Request Body (JSON)

**invoice\_number** `string`

Invoice number/reference

**invoice\_issuer** `string`

Name of the invoice issuer (creditor)

**invoice\_recipient** `string`

Name of the invoice recipient (debtor)

**subject** `string`

Invoice subject/description

**invoice\_amount\_net** `number`

Net invoice amount (before tax). Must be ≥ 0.

**invoice\_amount\_gross** `number`

Gross amount on the invoice. Must be ≥ 0. Feeds `claims.total_claim_amount` (minus `amount_paid`).

**invoice\_issue\_date** `string`

Invoice issue date in ISO 8601 format (`YYYY-MM-DD`)

**invoice\_due\_date** `string`

Invoice due date in ISO 8601 format (`YYYY-MM-DD`)

**creditor\_reminder\_fees\_incurred** `number`

Reminder fees already incurred by creditor and still unpaid. Must be ≥ 0. Feeds `claims.total_claim_amount`.

**amount\_paid** `number`

Amount the debtor already paid you on this invoice **before** you handed it over. Requires `invoice_amount_gross` in the same request and must be less than it (a fully paid invoice is not handed over). We collect only the open rest; interest and our collection fees are calculated on it, and the collection letter shows "invoice amount – paid – open". It is **not** recorded as a payment and sends no payment notification.

**last\_payment\_date** `string`

Date of the (last) payment counted in `amount_paid`, ISO 8601 (`YYYY-MM-DD`), not in the future. Requires `amount_paid`. Shown on the letter when given.

## Examples

```bash cURL theme={null}
curl -X POST \
  'https://<host>/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/invoices/manual' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "invoice_number": "RE-2026-0042",
    "invoice_issuer": "Muster GmbH",
    "invoice_recipient": "Max Mustermann",
    "subject": "Consulting services March 2026",
    "invoice_amount_net": 1000.00,
    "invoice_amount_gross": 1190.00,
    "invoice_issue_date": "2026-03-01",
    "invoice_due_date": "2026-03-15",
    "creditor_reminder_fees_incurred": 0
  }'
```

```javascript JavaScript theme={null}
const res = await fetch(
  'https://<host>/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/invoices/manual',
  {
    method: 'POST',
    headers: {
      Authorization: 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      invoice_number: 'RE-2026-0042',
      invoice_issuer: 'Muster GmbH',
      invoice_recipient: 'Max Mustermann',
      subject: 'Consulting services March 2026',
      invoice_amount_net: 1000.0,
      invoice_amount_gross: 1190.0,
      invoice_issue_date: '2026-03-01',
      invoice_due_date: '2026-03-15',
      creditor_reminder_fees_incurred: 0,
    }),
  }
)
const json = await res.json()
```

```python Python theme={null}
import requests

url = 'https://<host>/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/invoices/manual'
headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
}
payload = {
    'invoice_number': 'RE-2026-0042',
    'invoice_issuer': 'Muster GmbH',
    'invoice_recipient': 'Max Mustermann',
    'subject': 'Consulting services March 2026',
    'invoice_amount_net': 1000.00,
    'invoice_amount_gross': 1190.00,
    'invoice_issue_date': '2026-03-01',
    'invoice_due_date': '2026-03-15',
    'creditor_reminder_fees_incurred': 0,
}

response = requests.post(url, headers=headers, json=payload)
print(response.status_code, response.text)
```

## Responses

```json Success theme={null}
{
  "success": true,
  "data": {
    "id": "b7c2d6ba-9d2c-42b6-8e1f-4a8e3d9e9c77",
    "claim_id": "3c90c3cc-0d44-4b50-8888-8dd257363052",
    "invoice_number": "RE-2026-0042",
    "invoice_issuer": "Muster GmbH",
    "invoice_recipient": "Max Mustermann",
    "subject": "Consulting services March 2026",
    "invoice_amount_net": 1000.00,
    "invoice_amount_gross": 1190.00,
    "invoice_issue_date": "2026-03-01",
    "invoice_due_date": "2026-03-15",
    "creditor_reminder_fees_incurred": 0,
    "amount_paid": null,
    "last_payment_date": null,
    "amount_open": 1190.00,
    "data_extraction_status": "manual",
    "created_at": "2026-03-01T10:30:00Z"
  }
}
```

```json Error - Validation Failed theme={null}
{
  "success": false,
  "error": "VALIDATION_ERROR",
  "message": "Validation failed",
  "details": []
}
```

```json Error - Claim Not Found theme={null}
{
  "success": false,
  "message": "Claim not found"
}
```

## Notes

* This endpoint **only accepts JSON**; it does not handle file uploads.
* No OCR runs; the invoice is stored with `data_extraction_status: "manual"`.
* `invoice_amount_gross` (minus `amount_paid`) and `creditor_reminder_fees_incurred` automatically update the claim's `total_claim_amount` via database triggers.
* **Partly paid before handover:** send the invoice amount in `invoice_amount_gross` and the paid part in `amount_paid`, e.g. `"invoice_amount_gross": 59.56, "amount_paid": 43.57, "last_payment_date": "2024-11-05"`. The response then shows `invoice_amount_gross: 59.56`, `amount_paid: 43.57`, `amount_open: 15.99`. Do not report such a payment through `/payments` — that endpoint records money paid during collection. Reminder fees the debtor has paid are sent only for the part still open.


## OpenAPI

````yaml post /openapi/claims/{claim_id}/invoices/manual
openapi: 3.0.3
info:
  title: incaseof.law Partner API
  version: 1.0.0
  description: >
    The incaseof.law partner API (`/openapi/*`): create claims and debtors,
    attach invoices and documents, record

    payments, follow a claim through collection and take the judicial-step
    decision.


    This document is the contract the API is tested against: every path, request
    body and response field here is

    compared with the implementation on each change. A field that is not listed
    here is not part of the API.


    ## Authentication


    Every `/openapi` request carries `Authorization: Bearer <api key>`. API keys
    are opaque strings starting with

    `ico_live_` (not JWTs). Request a key at https://app.incaseof.law/openapi;
    incaseof.law reviews the request and

    sends the key by e-mail.


    - **Organisation keys** act for one creditor organisation.

    - **Partner keys** act for a partner (software vendor, reseller) and its
    customers. Requests that create a claim
      or a debtor name the customer with `customer_id`; reads and updates reach every object of the partner's own
      customers without it. A `customer_id` that does not exist answers `400`, one of another partner `403`.

    ## Errors


    Every error answers `{ "success": false, "message": "…" }`, some with an
    `error` code. Validation errors list the

    failed fields in `details` (see `BadRequest`). Every response carries the
    rate-limit headers (see

    `TooManyRequests`).


    ## Partner intake rules


    Some partner agreements require more than the API's own required fields, and
    some prohibit data. They apply to

    partner keys only, are set per partner account by incaseof.law, and are
    checked **before anything is stored** — a

    refused request leaves no claim, invoice, PDF, payment, document or customer
    behind.


    - **Required fields.** The fields marked *optional unless your partner
    agreement requires it* exist for every
      caller. When your agreement requires one, a request without it answers `400` naming each missing field
      (`"message": "default_date required"`, one `details` entry per field). They are checked on creation only: on
      `POST /openapi/claims` (`creditor_confirmation`), both invoice endpoints (`default_date`,
      `creditor_reminder_dates` — not with `default_basis: bgb_286_3` —, `contract_date`, `subject`),
      `POST /openapi/debtors` (`legal_representative`) and `POST /openapi/customers` (`legal_form`,
      `legal_representative` — `owner` for a sole trader —, `billing_email`, `payout_account`, `vat_deductible`).
    - **Prohibited data (health data).** When your agreement prohibits health
    data, these free-text fields are checked:
      invoice `subject` (on the PDF upload also `description`), `invoice_issuer`, `invoice_recipient`; payment `notes`;
      document `description`; customer `metadata`. A value that looks like a health insurance number (KVNR: a capital
      letter and nine digits), an institution code (IK: a nine-digit number on its own), the word `PZN`, `Pflegegrad`,
      `Diagnose`, the word `ICD` or an ICD code with its dot (`F32.1`) answers `400` with
      `"error": "PROHIBITED_DATA"` and the field in `details` (the value is never echoed). Use neutral wording, e.g.
      "Privatärztliche Leistung vom 01.09.2026".

    ## Webhooks


    incaseof.law can push events to a partner-controlled HTTPS endpoint whenever
    a claim's lifecycle changes:

    `claim.collection_stage_changed` and `claim.status_changed`. See the
    **Webhooks** section at the bottom of this

    document for the payload shape, header reference, signature scheme and retry
    policy.
servers:
  - url: https://service.incaseof.law
    description: Production API
  - url: https://sandbox.incaseof.law
    description: Partner sandbox (test data only, sandbox keys — see "Partner sandbox")
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Service availability
  - name: Claims
    description: Claims, their status and the judicial-step decision
  - name: Debtors
    description: Debtors of your claims
  - name: Invoices
    description: The invoices a claim is based on
  - name: Payments
    description: Payments the debtor made
  - name: Documents
    description: Supporting documents of a claim
  - name: Customers
    description: A partner's customers (the creditors it works for)
paths:
  /openapi/claims/{claim_id}/invoices/manual:
    post:
      tags:
        - Invoices
      summary: Create invoice from data (no PDF)
      description: >
        Create an invoice from JSON, without a file. Every call creates **a new
        invoice** on the claim; its amounts

        add to the claim's `total_claim_amount`. No automatic reading runs on
        this path, so `data_extraction_status`

        is `manual`. Amounts take at most two decimal places.


        Reminder fees (`creditor_reminder_fees_incurred`) can no longer be added
        once a collection letter including

        them has gone out (`400`).


        **Partly paid before handover:** keep `invoice_amount_gross` at the
        amount on the invoice and send what the

        debtor already paid you in `amount_paid` (optionally with
        `last_payment_date`). We then collect only the open

        rest. Send reminder fees the debtor has paid only for the part still
        open. Do not report such a payment

        through `/payments` — that endpoint records money paid during
        collection.
      operationId: createManualInvoice
      parameters:
        - in: path
          name: claim_id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvoiceInput'
            examples:
              full:
                summary: Manual invoice with all fields
                value:
                  invoice_number: RE-2026-0042
                  invoice_issuer: Muster GmbH
                  invoice_recipient: Max Mustermann
                  subject: Consulting services March 2026
                  invoice_amount_net: 1000
                  invoice_amount_gross: 1190
                  invoice_issue_date: '2026-03-01'
                  invoice_due_date: '2026-03-15'
                  creditor_reminder_fees_incurred: 0
              partly_paid:
                summary: Invoice partly paid before handover
                value:
                  invoice_number: 2024/1/005365
                  subject: Rauchfangkehrergebühren
                  invoice_amount_gross: 59.56
                  amount_paid: 43.57
                  last_payment_date: '2024-11-05'
                  invoice_issue_date: '2024-09-30'
                  invoice_due_date: '2024-10-14'
                  creditor_reminder_fees_incurred: 15
      responses:
        '201':
          description: Invoice created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/Invoice'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreateInvoiceInput:
      type: object
      properties:
        invoice_number:
          type: string
        invoice_issuer:
          type: string
          description: The creditor's name on the invoice
        invoice_recipient:
          type: string
          description: The debtor's name on the invoice
        subject:
          type: string
        invoice_amount_net:
          type: number
          minimum: 0
        invoice_amount_gross:
          type: number
          minimum: 0
          description: Adds to the claim's `total_claim_amount`
        invoice_issue_date:
          type: string
          format: date
        invoice_due_date:
          type: string
          format: date
        creditor_reminder_fees_incurred:
          type: number
          minimum: 0
          description: Reminder fees the creditor already charged and that are still unpaid
        amount_paid:
          type: number
          minimum: 0.01
          description: >
            Amount the debtor already paid you on this invoice before you handed
            it over to us. Requires

            `invoice_amount_gross` in the same request and must be less than it.
            We collect only the rest

            (`amount_open`); interest and our collection fees are calculated on
            it, and the letter shows

            "invoice amount – paid – open". It is not recorded as a payment.
        last_payment_date:
          type: string
          format: date
          description: >-
            Date of the (last) payment counted in `amount_paid`; not in the
            future. Requires `amount_paid`
        default_date:
          type: string
          format: date
          description: The date the debtor fell into default (Verzug)
        creditor_reminder_dates:
          type: array
          minItems: 1
          items:
            type: string
            format: date
          description: >-
            The dates of your own reminders before you handed the invoice over.
            Not needed when `default_basis` is `bgb_286_3`.
        default_basis:
          type: string
          enum:
            - reminder
            - bgb_286_3
          description: >
            How the default arose. `reminder` (the default when not sent): by a
            reminder after the due date (§ 286 (1)

            BGB). `bgb_286_3`: 30 days after the due date and receipt of the
            invoice without a reminder (§ 286 (3) BGB)

            — against a consumer only when the invoice pointed out this
            consequence.
        contract_date:
          type: string
          format: date
          description: The date of the contract the invoice is based on
    Invoice:
      type: object
      properties:
        id:
          type: string
          format: uuid
        claim_id:
          type: string
          format: uuid
        invoice_number:
          type: string
          nullable: true
          example: INV-1001
        invoice_issuer:
          type: string
          nullable: true
        invoice_recipient:
          type: string
          nullable: true
        subject:
          type: string
          nullable: true
        invoice_amount_net:
          type: number
          nullable: true
        invoice_amount_gross:
          type: number
          nullable: true
          description: The amount on the invoice
        invoice_issue_date:
          type: string
          format: date
          nullable: true
        invoice_due_date:
          type: string
          format: date
          nullable: true
        creditor_reminder_fees_incurred:
          type: number
          nullable: true
        amount_paid:
          type: number
          nullable: true
          description: >-
            Paid by the debtor to the creditor before handover, as you reported
            it; `null` when nothing was reported
        last_payment_date:
          type: string
          format: date
          nullable: true
          description: Date of that payment, when reported
        amount_open:
          type: number
          nullable: true
          description: >-
            The part of the invoice amount we collect: `invoice_amount_gross` −
            `amount_paid`
        default_date:
          type: string
          format: date
          nullable: true
          description: The date the debtor fell into default, as you sent it
        creditor_reminder_dates:
          type: array
          nullable: true
          items:
            type: string
            format: date
          description: The dates of your own reminders before handover, as you sent them
        default_basis:
          type: string
          enum:
            - reminder
            - bgb_286_3
          nullable: true
          description: >-
            How the default arose, as you sent it; `null` when not sent (read as
            `reminder`)
        contract_date:
          type: string
          format: date
          nullable: true
          description: The date of the contract the invoice is based on
        data_extraction_status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
            - manual
          description: >-
            State of the automatic reading of an uploaded PDF; `manual` for an
            invoice created from data.
        data_extraction_confidence:
          type: number
          nullable: true
          description: 0–100
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  responses:
    BadRequest:
      description: >
        The request is invalid. A body that fails validation answers `error:
        VALIDATION_ERROR` with one entry per

        problem in `details` (`path` — the field, as a list of keys and indexes;
        `message`; `code`). Other `400`s carry

        only `message`.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: VALIDATION_ERROR
              message:
                type: string
                example: Validation failed
              details:
                type: array
                items:
                  type: object
                  properties:
                    path:
                      type: array
                      items:
                        oneOf:
                          - type: string
                          - type: integer
                    message:
                      type: string
                    code:
                      type: string
                      example: invalid_type
          examples:
            validationError:
              value:
                success: false
                error: VALIDATION_ERROR
                message: Validation failed
                details:
                  - code: invalid_type
                    expected: string
                    received: undefined
                    path:
                      - invoice_number
                    message: Required
            businessRule:
              value:
                success: false
                message: >-
                  Payment invoice number must match an active collection letter
                  or cost invoice. Active document numbers: ICO-2026-000123
    Unauthorized:
      description: The `Authorization` header is missing, or the key is invalid or expired.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Unauthorized
              message:
                type: string
                example: >-
                  Invalid API token. Please check your token or request a new
                  one.
    NotFound:
      description: The object does not exist or is not reachable with this key.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                example: Claim not found
    TooManyRequests:
      description: >
        The key's hourly limit is used up — every `/openapi` request can answer
        this. Requests are counted per key and

        clock hour (UTC); the limit is agreed per key (default 1 000 per hour).
        Retry after `Retry-After` seconds.

        Every answer — not only this one — carries `X-RateLimit-Limit`,
        `X-RateLimit-Remaining` and `X-RateLimit-Reset`.
      headers:
        Retry-After:
          description: Seconds until the next hour starts and requests are admitted again.
          schema:
            type: integer
            example: 1260
        X-RateLimit-Limit:
          description: Requests allowed per hour for this key.
          schema:
            type: integer
            example: 1000
        X-RateLimit-Remaining:
          description: Requests left in the current hour (0 here).
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Unix time (seconds) at which the count starts again.
          schema:
            type: integer
            example: 1790002800
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Too Many Requests
              message:
                type: string
                example: >-
                  Rate limit exceeded. Your limit is 1000 requests per hour.
                  Please try again later.
              details:
                type: object
                properties:
                  limit:
                    type: integer
                    example: 1000
                  window:
                    type: string
                    example: 1 hour
                  resets_at:
                    type: string
                    format: date-time
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                example: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key (`ico_live_…`), sent as `Authorization: Bearer <key>`. Not a
        JWT.

````

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