Skip to main content

Workflow: Case Creation

This guide provides a comprehensive overview of the case creation workflow in the Debitura Customer API, including best practices, validation rules, and advanced options.

Overview

Case creation is the starting point for all debt collection activities in Debitura. Understanding the complete workflow helps you integrate smoothly and avoid common pitfalls.

Workflow Steps

1. Data Preparation

Before creating a case, gather and validate all required information:

Required Fields:

  • Debtor identification (name, CVR/CPR for Danish entities)
  • Contact information (email, phone, address)
  • Debt details (principal amount, currency, due date)
  • Invoice or claim reference

Optional Fields:

  • Case priority level
  • Division assignment
  • Collection partner preferences
  • Payment plan preferences
  • Interest and fee calculations
  • Custom metadata

2. Validation

The API performs several validation checks:

  • Debtor validation: Valid CVR/CPR numbers, required contact information
  • Amount validation: Positive amounts, valid currency codes
  • Date validation: Due dates must be in the past
  • Business rules: Minimum claim amounts, geographic restrictions

3. Case Submission

Submit the case via the API endpoint:

Endpoint: POST /api/cases

Request structure:

{
"debtor": {
"name": "Debtor name",
"cvr": "12345678",
"contactInfo": { /* ... */ }
},
"claim": {
"principalAmount": 10000.00,
"currency": "DKK",
"invoiceNumber": "INV-123",
"dueDate": "2024-01-15"
},
"options": {
"priority": "normal",
"divisionId": "uuid",
"autoAssignPartner": true
}
}

4. Processing

Once submitted, Debitura processes the case:

  1. Initial validation: System validates all provided data
  2. Duplicate check: Checks for existing cases with same debtor/claim
  3. Credit check: Optional automatic credit assessment
  4. Partner assignment: Assigns to appropriate collection partner
  5. Status update: Case moves to active collection status

5. Confirmation

The API returns confirmation with case details:

{
"caseId": "uuid",
"caseNumber": "DEB-2024-12345",
"status": "Created",
"assignedPartner": "Partner Name",
"estimatedResolutionDate": "2024-06-15",
"createdAt": "2024-01-02T10:30:00Z"
}

Case States

Cases progress through several states:

  • Created: Initial state after submission
  • Validated: Passed all validation checks
  • Assigned: Assigned to collection partner
  • Active: Under active collection
  • On Hold: Temporarily paused
  • Resolved: Case completed (paid or closed)

Best Practices

Data Quality

  • Ensure debtor contact information is current and complete
  • Provide all available documentation upfront
  • Use consistent reference numbering
  • Include detailed claim descriptions

Error Handling

  • Implement retry logic with exponential backoff
  • Store failed submissions for manual review
  • Monitor validation error patterns
  • Keep audit logs of all submissions

Batch Processing

For multiple cases:

  • Use batch endpoints when available
  • Implement rate limiting
  • Process asynchronously where possible
  • Handle partial failures gracefully

Testing

  • Test in sandbox environment first
  • Verify all edge cases
  • Test error scenarios
  • Validate webhook integration

Advanced Options

Custom Workflows

Configure custom case workflows:

  • Pre-collection reminders
  • Escalation rules
  • Custom approval workflows
  • Multi-division routing

Integration Points

Key integration opportunities:

  • ERP system integration
  • Accounting software sync
  • Document management systems
  • CRM integration
  • Payment gateway connections

Automation

Automate case creation from:

  • Overdue invoice detection
  • Payment reminder systems
  • Account reconciliation processes
  • Contract breach events

Error Codes

Common errors and solutions:

  • INVALID_DEBTOR: Check debtor information format
  • DUPLICATE_CASE: Case already exists for this claim
  • AMOUNT_TOO_LOW: Principal amount below minimum threshold
  • INVALID_CURRENCY: Currency code not supported
  • DIVISION_NOT_FOUND: Division ID doesn't exist

Code Examples

Node.js Example

// Example: Create case with Node.js
const createCase = async (caseData) => {
const response = await fetch('https://api.debitura.com/api/cases', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(caseData)
});

return response.json();
};

C# Example

// Example: Create case with C#
public async Task<CaseResponse> CreateCase(CaseRequest request)
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);

var response = await client.PostAsJsonAsync(
"https://api.debitura.com/api/cases",
request
);

return await response.Content.ReadFromJsonAsync<CaseResponse>();
}

For complete API reference documentation, see the API Reference.