Skip to main content
Get started with the incaseof.law API in minutes. This guide walks you through the most common workflows with practical code examples.

Prerequisites

  • API Token: Get your API token from the incaseof.law Admin dashboard (Settings → API Tokens)
  • Base URL: https://service.incaseof.law
  • Authentication: All requests require a Bearer token in the Authorization header

Authentication

Every API request must include your API token in the Authorization header:

Example Request Setup


Workflow 1: Create a Debtor

Create a debtor (person or company) that you’ll later associate with claims.

Step 1: Create a Person Debtor

Step 2: Create a Company Debtor

Response Example

Save the debtor ID: You’ll need the id from the response for the next step (creating a claim).

Workflow 2: Create a Claim

Create a claim (debt collection case) associated with a debtor.

Response Example

Minimal payload: The claim creation endpoint accepts a minimal payload. Financial details (amounts, dates, references) will be automatically extracted from invoices when you upload them via OCR processing.

Workflow 3: Upload Invoice to Claim

Upload an invoice PDF to a claim. The system will automatically extract invoice data using OCR.

Upload PDF File

Response Example

PDF files only: When uploading invoice files, only PDF format is accepted. Other file formats (images, Word, Excel, etc.) will be rejected. The original filename is automatically preserved.

Complete Workflow Example

Here’s a complete example that ties everything together:

Additional Common Operations

List All Debtors

Get a Specific Claim

List Invoices for a Claim


Error Handling

All API endpoints return errors in a consistent format:

Common HTTP Status Codes

  • 200 OK: Request successful
  • 201 Created: Resource created successfully
  • 400 Bad Request: Invalid request data or validation error
  • 401 Unauthorized: Missing or invalid API token
  • 404 Not Found: Resource not found
  • 500 Internal Server Error: Server error

Example Error Handling


Next Steps

Need help? Contact us at [email protected]