Skip to main content

Case Submission

Submit debt collection cases for your linked clients using the Customer API.

Overview

After onboarding a client, you submit cases through the Customer API (not the Referral Partner API). This is the two-API architecture in action:

  1. Mint a bearer token via the Referral Partner API
  2. Submit the case via the Customer API using that token
  3. Revenue is automatically attributed to your partnership

Step 1: Mint a Bearer Token

POST /oauth/token HTTP/1.1
Host: referral-api.debitura.com
XApiKey: YOUR_API_KEY
Content-Type: application/json

{
"ExternalTenantId": "your-client-id"
}
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"tokenType": "Bearer",
"expiresIn": 1800
}

The token is valid for 30 minutes and scoped to this specific client. See Authentication for caching and retry patterns.

:::warning Client must be onboarded Token minting returns 404 if there is no active, non-archived client link for the supplied ExternalTenantId — typically because the client was never created, is still mid-onboarding (SDCA not signed), or has been withdrawn. Check the client status before retrying. :::

Step 2: Submit the Case

Use the bearer token with the Customer API (different base URL):

POST /cases HTTP/1.1
Host: customer-api.debitura.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json

{
"currencyCode": "EUR",
"amountToRecover": 5000.00,
"date": "2025-06-01",
"dueDate": "2025-07-01",
"claimDescription": "Invoice INV-2025-001 for consulting services",
"debtor": {
"type": "Company",
"name": "Debtor GmbH",
"contactPerson": "Hans Mueller",
"address": "Hauptstrasse 10",
"city": "Munich",
"zipCode": "80331",
"countryAlpha2": "DE",
"email": "billing@debtor.de"
}
}

The case is automatically attributed to your partnership because you used a bearer token minted through the Referral Partner API.

Key fields

FieldRequiredNotes
currencyCodeYesISO 4217 (EUR, GBP, USD, etc.)
amountToRecoverYesTotal principal amount
dateYesInvoice date (must not be in the future)
dueDateNoWhen payment was due. Must be in the past and not earlier than date
debtor.typeYes"Company" or "Private"
debtor.nameYesLegal name
debtor.countryAlpha2YesISO 3166-1 alpha-2
debtor.stateAlpha2US onlyRequired for US debtors (e.g. "CA", "NY")
isTestNoSet true for test cases that won't trigger real collection

For the complete field reference and debtor validation rules, see Create a Case.

:::note isTest vs isTestCase You send isTest in the request body. The API returns isTestCase in the response. They represent the same flag -- the naming differs between request and response models. :::

Handling Pending Signing After Submission

When the linked client has not yet signed the SDCA or another required contract and the request is sent with allowPendingContracts: true, the case is created in the PendingContractSigning lifecycle and the response includes a signingHandoff object:

{
"lifecycle": "PendingContractSigning",
"signingHandoff": {
"combinedSigningUrl": "https://app.debitura.com/Signing/PendingContracts?returnUrl=..."
},
...
}

Use signingHandoff.combinedSigningUrl to render a signing prompt before the user can continue. The URL walks the full pending chain (SDCA upgrade → PoA → JPA → KYC) in one flow, so no client-side decision logic is needed. When everything is already signed, signingHandoff is null.

Pass returnUrl (absolute https:// URL, max 2048 chars) on the POST /cases request to deep-link the user back to your app once signing is complete. Invalid values are silently dropped and the URL falls back to the Creditors-app default landing.

For pricing previews before submission, see Preview Case Pricing — the preview endpoint reports which signing steps the matched partner will require via a pendingActions array.

Submitting Cases During Onboarding

You can include cases directly in the POST /clients request. Debitura validates all cases upfront:

  • If all cases are valid and have matching collection partners, they're created alongside the client
  • Cases without available partners are reported in CaseResults.FailedCases (the client is still created)
  • If validation errors exist (missing fields, duplicate references), the entire request returns 400

This is useful for platforms where the user submits their first invoice at the same time as signing up.

See Client Onboarding — Including Cases for details.

Uploading Files to a Case

Upload supporting documents to an existing case with POST /cases/{caseId}/files on the Referral Partner API. The case must belong to one of your linked clients.

POST https://referral-api.debitura.com/cases/{caseId}/files?sendChatNotification=true
XApiKey: YOUR_API_KEY
Content-Type: multipart/form-data

file: <binary>
ParameterTypeNotes
fileform-dataMax 25 MB. Allowed extensions: .pdf, .doc, .docx, .xls, .xlsx, .csv, .txt, .jpg, .jpeg, .png
sendChatNotificationquery (bool)Defaults to true. When true, a system chat message ("System message: New file uploaded under 'Files': <filename>") is posted to the case thread so the assigned collection partner sees the upload in-app. Set false for silent uploads

Returns 200 on success with { id, fileName, dateCreated }. Returns 404 if the case is not linked to one of your clients, 413 if the file exceeds 25 MB, and 415 for unsupported file types.

Submitting KYC Verification

Submit director identity data for a linked client with POST /clients/{externalTenantId}/kyc-verification. See KYC Verification for the payload. Returns 201 Created with the saved KYC record, or 404 if the client is not linked to your partner account.

The endpoint supports an optional ?sendChatNotification=true (default true) query flag. When enabled, a system chat message ("System message: KYC/AML information provided — find it under the 'KYC Status' section") is posted on each of the client's cases that are not yet closed (Active, Paused, or NeedsAdditionalDetails lifecycle) and are assigned to a collection partner that requires KYC. Cases assigned to partners that don't require KYC are skipped, and closed cases are never touched. Pass false to submit silently.

Tracking Cases

After submission, track cases using either API:

What you needAPIEndpoint
All cases across all clientsReferral PartnerGET /cases (with API key)
Single case detailCustomerGET /cases/{id} (with bearer token)
Real-time updatesReferral PartnerWebhooks (case.created, case.updated, case.closed)

Error Handling

StatusCommon causes
400Missing required fields, invalid debtor data, duplicate creditor reference
401Expired bearer token — mint a new one and retry
422Business rule violation (e.g. MissingKycVerification, MissingPowerOfAttorney, unsupported jurisdiction)

For 422 errors related to KYC, see KYC Verification.

What's Next