> ## 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.

# Estimate the judicial step

> What taking the claim to court would cost, and which rules a decision will be checked against. Call it when a
claim reaches `dunning_action_recommended` (the webhook tells you) and before you send a decision.

- Germany (`jurisdiction: DE`): a Mahnbescheid — court fee under the GKG, no lawyer through the platform
  (`lawyer_allowed: false`).
- Austria (`AT`): a Mahnklage — a lawyer is required when `lawyer_required` is true (`streitwert`: 5 000 EUR or
  above; `no_org_cert`: the creditor has no ERV certificate), and then the decision must name one.

Answers `400` when no Mahnverfahren is available for the debtor (a debtor outside the EU or in Denmark).




## OpenAPI

````yaml get /openapi/claims/{claim_id}/lawsuit-decision/estimate
openapi: 3.0.3
info:
  title: incaseof.law API
  version: 0.1.0
  description: >
    Draft OpenAPI blueprint for future implementation. Update paths as endpoints
    evolve.


    ## Webhooks


    incaseof.law can push events to a partner-controlled HTTPS endpoint

    whenever a claim's lifecycle changes. Today the single supported event

    type is `claim.collection_stage_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://ico-app-staging.up.railway.app
    description: Partner sandbox (test data only, sandbox keys — see "Partner sandbox")
security:
  - bearerAuth: []
paths:
  /openapi/claims/{claim_id}/lawsuit-decision/estimate:
    get:
      tags:
        - Claims
      summary: Estimate the judicial step
      description: >
        What taking the claim to court would cost, and which rules a decision
        will be checked against. Call it when a

        claim reaches `dunning_action_recommended` (the webhook tells you) and
        before you send a decision.


        - Germany (`jurisdiction: DE`): a Mahnbescheid — court fee under the
        GKG, no lawyer through the platform
          (`lawyer_allowed: false`).
        - Austria (`AT`): a Mahnklage — a lawyer is required when
        `lawyer_required` is true (`streitwert`: 5 000 EUR or
          above; `no_org_cert`: the creditor has no ERV certificate), and then the decision must name one.

        Answers `400` when no Mahnverfahren is available for the debtor (a
        debtor outside the EU or in Denmark).
      parameters:
        - in: path
          name: claim_id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The estimate
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/LawsuitDecisionEstimate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    LawsuitDecisionEstimate:
      type: object
      properties:
        claim_id:
          type: string
          format: uuid
        collection_stage:
          type: string
        decision_open:
          type: boolean
          description: >-
            True while a decision can be sent: the claim is at
            `dunning_action_recommended` and no decision has been recorded yet.
        decided:
          type: boolean
          description: >-
            True once a decision has been recorded (read it with `GET
            /openapi/claims/{claim_id}/lawsuit-decision`).
        jurisdiction:
          type: string
          enum:
            - AT
            - DE
        streitwert:
          type: number
        court_fees:
          type: number
        lawyer_fees_net:
          type: number
        lawyer_fees_gross:
          type: number
        lawyer_required:
          type: boolean
        lawyer_required_reason:
          type: string
          enum:
            - streitwert
            - no_org_cert
          nullable: true
        lawyer_allowed:
          type: boolean
          description: >-
            False on German claims — the Mahnbescheid takes no lawyer through
            the platform.
  responses:
    BadRequest:
      description: Bad Request - Invalid input data
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Bad Request
              message:
                type: string
                example: Invalid request data
              details:
                type: array
                items:
                  type: object
                  properties:
                    field:
                      type: string
                    message:
                      type: string
          examples:
            validationError:
              value:
                success: false
                error: VALIDATION_ERROR
                message: Validation failed
                details:
                  - field: amount
                    message: Amount must be positive
    Unauthorized:
      description: Unauthorized - Missing or invalid authentication
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Unauthorized
              message:
                type: string
                example: Invalid or expired token
          examples:
            missingToken:
              value:
                success: false
                error: Unauthorized
                message: Missing or invalid authorization header
            expiredToken:
              value:
                success: false
                error: Unauthorized
                message: Invalid or expired token
    NotFound:
      description: Not Found - Resource does not exist
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Not Found
              message:
                type: string
                example: Resource 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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````