curl --request POST \
--url https://service.incaseof.law/openapi/claims/{claim_id}/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form invoice_number=INV-1001 \
--form total_amount=3000 \
--form maturity_date=2025-10-30 \
--form issue_date=2025-09-18 \
--form 'invoice_issuer=ACME Corp' \
--form 'invoice_recipient=John Doe' \
--form 'subject=Original invoice PDF' \
--form invoice_amount_net=2500 \
--form creditor_reminder_fees_incurred=50 \
--form file='@example-file'
{
"success": true,
"data": {
"id": "b7c2d6ba-9d2c-42b6-8e1f-4a8e3d9e9c77",
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd257363052",
"invoice_number": "INV-2025-001",
"invoice_amount_gross": 123.45,
"invoice_due_date": "2025-10-01",
"invoice_issue_date": "2025-09-15",
"invoice_issuer": "Acme GmbH",
"invoice_recipient": "John Doe",
"subject": "Original invoice PDF",
"created_at": "2025-10-11T10:30:00Z"
}
}
{
"success": false,
"message": "Claim not found"
}
{
"success": false,
"message": "Invalid file type. Only PDF files are allowed for invoice uploads."
}
{
"success": false,
"message": "Invalid request. This endpoint only supports PDF invoice uploads via multipart/form-data. Please use multipart/form-data with a file field. The original filename will be automatically preserved."
}
Invoices
Upload invoice PDF to claim
Upload a PDF invoice and attach it to a claim. The invoice amount will automatically update the claim’s total_claim_amount via database triggers.
Important: Only PDF files are accepted. This endpoint requires multipart/form-data with a PDF file upload.
Field Mapping:
total_amount→ Stored asinvoice_amount_grossmaturity_date→ Stored asinvoice_due_dateissue_date→ Stored asinvoice_issue_date
POST
/
openapi
/
claims
/
{claim_id}
/
invoices
curl --request POST \
--url https://service.incaseof.law/openapi/claims/{claim_id}/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form invoice_number=INV-1001 \
--form total_amount=3000 \
--form maturity_date=2025-10-30 \
--form issue_date=2025-09-18 \
--form 'invoice_issuer=ACME Corp' \
--form 'invoice_recipient=John Doe' \
--form 'subject=Original invoice PDF' \
--form invoice_amount_net=2500 \
--form creditor_reminder_fees_incurred=50 \
--form file='@example-file'
{
"success": true,
"data": {
"id": "b7c2d6ba-9d2c-42b6-8e1f-4a8e3d9e9c77",
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd257363052",
"invoice_number": "INV-2025-001",
"invoice_amount_gross": 123.45,
"invoice_due_date": "2025-10-01",
"invoice_issue_date": "2025-09-15",
"invoice_issuer": "Acme GmbH",
"invoice_recipient": "John Doe",
"subject": "Original invoice PDF",
"created_at": "2025-10-11T10:30:00Z"
}
}
{
"success": false,
"message": "Claim not found"
}
{
"success": false,
"message": "Invalid file type. Only PDF files are allowed for invoice uploads."
}
{
"success": false,
"message": "Invalid request. This endpoint only supports PDF invoice uploads via multipart/form-data. Please use multipart/form-data with a file field. The original filename will be automatically preserved."
}
This endpoint requires
multipart/form-data with a PDF file upload.
The interactive playground cannot send file uploads; use Insomnia/Postman for testing.Overview
Upload a PDF invoice and attach it to a claim. When you upload a PDF, it is stored and linked to the claim, and OCR attempts to extract invoice data and populate the invoice record.PDF files only: Only PDF format is accepted. Other file formats (images, Word, Excel, etc.) will be rejected.
Request Format
- Content-Type:
multipart/form-data - Required field:
file(PDF only) - Optional text fields:
invoice_number,total_amount,maturity_date,issue_date,invoice_issuer,invoice_recipient,subject,invoice_amount_net,creditor_reminder_fees_incurred
Authentication
Requires API Token authentication via Bearer token.Path Parameters
string
required
UUID of the claim you are attaching an invoice to
Request Body (Multipart Form)
file
required
PDF invoice file to upload. Only PDF format is accepted.
string
Invoice number
string
Gross amount of the invoice (maps to
invoice_amount_gross)string
Due date in ISO 8601 format (maps to
invoice_due_date)string
Issue date in ISO 8601 format (maps to
invoice_issue_date)string
Invoice issuer name
string
Invoice recipient name
string
Optional subject/description
string
Net amount
string
Reminder fees
Testing Instructions
- Create a new request: Method
POST, URL/openapi/claims//invoices - Auth tab: Type
Bearer, Token = your API token - Body tab: Type
Multipart Form- Add field
filewith typeFile, select your.pdf(original filename is automatically preserved) - Optional text fields:
invoice_number,total_amount,maturity_date,issue_date,invoice_issuer,invoice_recipient,subject,invoice_amount_net,creditor_reminder_fees_incurred
- Add field
- Send request and verify
201response
Filename Preservation: When using
multipart/form-data, the original PDF filename is automatically preserved.The Mintlify playground cannot send multipart/form-data with files. Use Insomnia/Postman for testing.Examples
cURL
curl -X POST \
'https://<host>/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/invoices' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-F 'file=@/path/to/invoice.pdf' \
-F 'invoice_number=INV-2025-001' \
-F 'total_amount=123.45' \
-F 'maturity_date=2025-10-01' \
-F 'issue_date=2025-09-15' \
-F 'invoice_issuer=Acme GmbH' \
-F 'invoice_recipient=John Doe' \
-F 'subject=Original invoice PDF'
JavaScript
const formData = new FormData()
formData.append('file', yourFileInput.files[0])
formData.append('invoice_number', 'INV-2025-001')
formData.append('total_amount', '123.45')
formData.append('maturity_date', '2025-10-01')
formData.append('issue_date', '2025-09-15')
formData.append('invoice_issuer', 'Acme GmbH')
formData.append('invoice_recipient', 'John Doe')
formData.append('subject', 'Original invoice PDF')
const res = await fetch('https://<host>/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/invoices', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_TOKEN' },
body: formData,
})
const json = await res.json()
Python
import requests
url = 'https://<host>/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/invoices'
headers = { 'Authorization': 'Bearer YOUR_API_TOKEN' }
files = { 'file': ('invoice.pdf', open('invoice.pdf', 'rb'), 'application/pdf') }
data = {
'invoice_number': 'INV-2025-001',
'total_amount': '123.45',
'maturity_date': '2025-10-01',
'issue_date': '2025-09-15',
'invoice_issuer': 'Acme GmbH',
'invoice_recipient': 'John Doe',
'subject': 'Original invoice PDF',
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code, response.text)
Responses
{
"success": true,
"data": {
"id": "b7c2d6ba-9d2c-42b6-8e1f-4a8e3d9e9c77",
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd257363052",
"invoice_number": "INV-2025-001",
"invoice_amount_gross": 123.45,
"invoice_due_date": "2025-10-01",
"invoice_issue_date": "2025-09-15",
"invoice_issuer": "Acme GmbH",
"invoice_recipient": "John Doe",
"subject": "Original invoice PDF",
"created_at": "2025-10-11T10:30:00Z"
}
}
{
"success": false,
"message": "Claim not found"
}
{
"success": false,
"message": "Invalid file type. Only PDF files are allowed for invoice uploads."
}
{
"success": false,
"message": "Invalid request. This endpoint only supports PDF invoice uploads via multipart/form-data. Please use multipart/form-data with a file field. The original filename will be automatically preserved."
}
Notes
- This endpoint only accepts PDF file uploads via
multipart/form-data - OCR runs on uploaded PDFs and may populate invoice fields automatically
- The invoice amount will automatically update the claim’s total_claim_amount via database triggers
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
UUID of the claim to attach invoice to
Body
multipart/form-data
Invoice PDF file to upload (only PDF files are accepted)
Invoice number/reference
Total invoice amount (gross) in EUR
Invoice due/maturity date
Invoice issue/creation date
Name of the invoice issuer (creditor)
Name of the invoice recipient (debtor)
Invoice subject/description
Net invoice amount (before tax)
Reminder fees already incurred by creditor