Clients
- Base URL
https://referral-api.debitura.com- Authentication
- API key in the
XApiKeyheader
List all linked clients
/clientsRetrieves a paginated list of all clients (creditors) linked to the authenticated referral partner.
Response Data For each client, the response includes:
- ExternalTenantId - Your unique identifier for this client
- OnboardingDone - Whether the client has completed onboarding (signed debt collection agreements)
- OnboardingLinks - If onboarding incomplete, contains URL to complete the process
- Client - Complete client information (ID, company name, registration number, country, address, contact details)
- Users - List of all users associated with this client (ID, email, name)
Filtering Parameters
- ExternalTenantId - Filter to specific client by your identifier
- IsAttributedClient - Filter by attribution status (true = created by you, false = linked later)
- DateCreatedFrom - Filter clients linked on or after this date (ISO 8601 format)
- DateCreatedTo - Filter clients linked on or before this date (ISO 8601 format)
- Query - Search across company name, email, and registration number (case-insensitive)
Pagination
- Page - Page number (default: 1, min: 1)
- PageSize - Results per page (default: 50, min: 1, max: 100)
- Response includes page metadata: total count, current page size, skip count
Sorting
- Sort - Sort field and direction (format: 'field:direction')
- Supported fields: dateCreated, name
- Examples: 'dateCreated:desc', 'name:asc'
- Default: dateCreated:desc (most recent first)
Use Cases
- List all your clients for dashboard display
- Search for specific client by name, email, or registration number
- Filter clients by onboarding status
- Identify clients created by you vs. existing clients you linked
- Monitor client link creation dates
- Paginate through large client lists
Client Attribution and Revenue Rules ⚠️ CRITICAL FOR REVENUE CALCULATIONS
-
IsAttributedClient=true - Client was created through the referral partner API
- Referral partner earns revenue on ALL cases (100% of cases)
- This is the default for clients created via POST /clients
-
IsAttributedClient=false - Client existed in Debitura before the link was established (409 conflict scenario)
- Referral partner earns revenue ONLY on cases created through the referral partnership
- Cases created directly by the client (not through partner) do NOT generate referral revenue
- This protects pre-existing client relationships
This distinction is the most important business rule for revenue calculations. Always check IsAttributedClient when forecasting or reconciling revenue.
Only active (non-archived) client links are returned.
Query parameters
PageintegerPage number (default: 1)
PageSizeintegerResults per page (default: 50, max: 100)
QuerystringSearch query across CompanyName, OfficeEmail, and CompanyRegistrationNumber
ExternalTenantIdstringFilter by exact external tenant ID
IsAttributedClientbooleanFilter by attribution status (true = attributed client, false = linked but not attributed)
DateCreatedFromdatetimeFilter by link creation date (from)
DateCreatedTodatetimeFilter by link creation date (to)
OnboardingDonebooleanFilter by onboarding status (true = completed, false = pending)
SortstringSort field and direction. Format: "field[:asc|desc]" Supported fields: dateCreated, name Examples: "dateCreated:desc", "name:asc" Default: dateCreated:desc
Returns
200 Clients retrieved successfully
pageobjectPaging metadata describing a paged result set.
summaryobjectclientsarray of objectsnullableList of linked clients
curl https://referral-api.debitura.com/clients \-H "XApiKey: $DEBITURA_API_KEY"
{"page": {"totalResults": 42,"pageSize": 25,"currentPage": 1,"responseCount": 42,"totalPages": 1},"summary": {"totalClients": 42,"attributedClients": 3,"onboardingComplete": 3,"onboardingPending": 3,"totalCases": 42},"clients": [{"externalTenantId": "string","onboardingDone": true,"onboardingLinks": {"url": "https://app.debitura.com/…"},"client": {"id": "3f2b6c1e-8a4d-4b7f-9c2e-5d1a0b9e7f31","companyName": "Muster GmbH","officeEmail": "finance@example.com","country": "Germany","address": "Friedrichstraße 68","city": "Berlin","zipCode": "10115","companyRegistrationNumber": "DE123456789"},"users": [{"id": {},"email": {},"firstName": {},"lastName": {}}],"isAttributedClient": true,"dateLinked": "2026-10-01T14:05:00Z","caseStats": {"casesTotal": 42,"casesClosed": 3,"earningsUsd": 1.5},"kycStatus": "NotRequired","kycVerification": {"directorFullName": "Muster GmbH","directorHomeAddress": "Friedrichstraße 68","directorDateOfBirth": "2026-10-01","dateCreated": "2026-10-01T14:05:00Z","verificationStatus": "Processing","verificationStatusUpdatedAt": "2026-10-01T14:05:00Z"},"caseResults": {"successfulCases": [{}],"failedCases": [{}]}}]}
Create and onboard a new client
/clientsCreates a new client (creditor) in the Debitura platform and links them to the authenticated referral partner.
Request Structure
- ExternalTenantId (required) - Your unique identifier for this client (for correlation and future lookups)
- Client (required) - Company information (name, registration number, country, address, contact details)
- Users (required, 1-N) - At least one user with email and name. For multiple users, exactly one must have IsOnboardingUser=true. Single-user requests auto-infer the onboarding user.
- Cases (optional) - Optionally create multiple collection cases during client creation (validated upfront to prevent orphaned clients)
Onboarding Flow
-
New Client (201/202)
- Client and users are created in Debitura
- ReferralPartnerClientLink is established with revenue sharing percentage
- If onboarding is complete (terms signed), returns 201
- If onboarding pending (terms not signed), returns 202 with OnboardingLinks.Url for completing the process
202 Response - Two URL Scenarios:
1a. New Client - Full Onboarding URL
- Scenario: Client has never signed the SDCA (Standard Debt Collection Agreement)
- URL Pattern:
{onboardingBase}/companydetails/{referralPartnerClientLinkId} - User Journey: Multi-step onboarding (company details → users → sign SDCA)
- Use Case: First-time client registration
1b. Existing Client - Contract Upgrade URL
- Scenario: Client previously signed SDCA but terms have been updated (NeedsRefresh=true)
- URL Pattern:
{onboardingBase}/ContractUpgrade/Sign/{referralPartnerClientLinkId} - User Journey: Streamlined contract re-signing only (no company details re-entry)
- Use Case: SDCA version upgrade (e.g., new pricing tiers, updated legal terms)
- Note: This can happen to previously-ready clients (201 → 202 state transition)
Important: Without
Idempotency-Key,externalTenantIdonly prevents a duplicate client/link; it does not make case-bearing retries safe or replay the original response. Exact response replay and case-safe retries requireIdempotency-Key. Client/link lookups still re-check SDCA status, so an unkeyed call for an existing client that previously returned201 Createdmay flip to202 Acceptedif Debitura releases a new SDCA version requiring re-signature. -
Existing Client - Needs Linking (409 Conflict) Business conflicts use ConflictResponse.Type; keyed requests can additionally return IdempotencyKeyInProgress while the winning request is still running:
2a. ClientExistsNeedsLinking (Type: "ClientExistsNeedsLinking")
- Client already exists in Debitura (matched by user email or support email)
- A link request is created with an expiration window configured per-partner (
ApprovalTtlDays, default 7 days, clamped 1–30) - Existing client must approve the referral partner link via OnboardingLinks.Url
- If approved, IsAttributedClient will be FALSE (revenue only on partner-referred cases)
- Cases submitted in the original request are persisted and replayed against the linked creditor automatically when the user approves.
AllowPendingContracts=trueis forced on replay so cases land inPendingContractSigningrather than 422-failing on missing SDCA/PoA/KYC. - Returns 409 with OnboardingLinks.Url pointing to approval page
2b. ClientAlreadyLinkedToAnotherPartner (Type: "ClientAlreadyLinkedToAnotherPartner")
- Client is already linked to a DIFFERENT referral partner
- Only one referral partner link per client is supported
- Cannot proceed - contact Debitura support for resolution
- Returns 409 with error message and support contact
-
Idempotency
- Without an Idempotency-Key, repeated calls with the same ExternalTenantId keep the existing business-key behaviour and return the current client status without duplicating the client or link
- Optionally send an Idempotency-Key of up to 255 characters. The key is scoped to the authenticated referral partner and retained for 24 hours
- The same key with the same effective request body replays the original terminal status and body, including approval-required 409 responses
- Effective comparison follows this endpoint's execution rules. For one user, IsOnboardingUser=false and true are equivalent because the user is always selected for onboarding. Omitted and empty Cases/ClaimLines are equivalent. Within Cases, AllowPendingContracts and AssignedUserEmail do not change referral-onboarding execution; unsafe ReturnUrl values are dropped; valid debtor Type casing is normalized; ContactPerson is ignored for Private debtors; and State is ignored when StateAlpha2 is supplied.
- The same key with a different effective body returns 422 with businessErrors[0].type = IdempotencyConflict; a retry while the first request is still running returns 409 with businessErrors[0].type = IdempotencyKeyInProgress and Retry-After: 2
- Field-validation 400 responses and failures before any durable effect do not consume the key. A failure after client, link, approval-request, or case work starts is sealed and replayed to prevent duplicates
-
Previously Withdrawn Client - Re-linked (201/202)
- Applies when you re-submit an ExternalTenantId you previously withdrew via POST /clients/{externalTenantId}/withdraw, AND the re-submission still identifies that same client — that is, it carries a user email or supportEmail already registered on it
- The ORIGINAL client is re-linked rather than duplicated: a new active link is created on the same Debitura client, IsAttributedClient stays true, and the archived link is retained for audit
- Cases in the re-submission are created against that client. A CreditorReference used by a case that the withdrawal closed can be reused — such a case no longer reserves it
- Any approval request still pending for this ExternalTenantId is resolved as declined, and a client.link_declined webhook is sent for it
- Falls back to the 409 handling in scenario 2 if the ExternalTenantId now resolves to a DIFFERENT client, if that client has since linked to another partner, or if the withdrawn link was not attributed to you
- Creates a new client as in scenario 1 — no re-link, no 409 — if the re-submission carries no contact email we recognise. A matching email is our only independent confirmation that this is the same client; without one we cannot tell a genuine re-submission apart from the same ExternalTenantId being reused for somebody else
- The re-link does not update the client or add users. Client details and Users in the re-submission are ignored, and the new link keeps the original onboarding user — send a new contact through the normal user-invitation flow instead
Response Codes
- 201 Created - Client created and fully onboarded (terms signed, ready to create cases, IsAttributedClient=true)
- 202 Accepted - Client created but onboarding incomplete (OnboardingLinks.Url provided to complete, IsAttributedClient=true)
- 400 Bad Request - Validation errors (missing required fields, invalid data, duplicate CreditorReferences within request). Most validation failures return a single-message ApiErrorResponseDto. Field-length violations (Client.Name, Client.SupportPhone, Client.RegistrationNumber, Client.SupportEmail, Users[].Email) are the one exception: they return a field-keyed error dictionary instead, e.g. { "Client.Name": ["Name must not exceed 80 characters (received 95)."] }, so multiple field problems can be reported together in one round-trip.
- 409 Conflict - Business conflicts or keyed-request contention:
- ConflictResponse.Type = "ClientExistsNeedsLinking" - Client exists, needs approval link (if approved, IsAttributedClient=false)
- ConflictResponse.Type = "ClientAlreadyLinkedToAnotherPartner" - Client already linked to different partner (cannot proceed)
- ConflictResponse.Type = "PartnerNotAcceptingReferrals" - The referral partner is paused or closed and takes no new clients; existing clients are unaffected
- businessErrors[0].type = "IdempotencyKeyInProgress" - Another request with the same partner, key, and effective body is still running; retry after the Retry-After delay
- 422 Unprocessable Entity - Business rule violation, including businessErrors[0].type = "IdempotencyConflict" when the same key is reused with a different effective body
- 500 Internal Server Error - Unexpected server error
Optional Multi-Case Creation If the Cases array is provided in the request:
- ALL cases are validated BEFORE client creation (checks field validation and duplicate references)
- Client is ALWAYS created to ensure referral partner link and future attribution
- Cases with available collection partners are created successfully (CaseResults.SuccessfulCases)
- Cases without available partners are NOT created and reported as failures (CaseResults.FailedCases)
- If validation errors exist (primitives, duplicates), client creation is aborted and 400 is returned
- Successful cases appear in CaseResults.SuccessfulCases with full case details
- Failed cases appear in CaseResults.FailedCases with CaseIndex, CreditorReference, and error details (e.g., "No collection partner available for jurisdiction")
Claim Amount and Aging on each case Each entry in Cases accepts the claim amount in one of three ways:
amountToRecoverplus a singledueDateamountToRecoverplus the cumulativeamountToRecoverOver6/12/24MonthsbucketsclaimLines[]— send the unpaid invoices and let us do the arithmetic (recommended for multi-invoice claims)
"claimLines": [
{ "dueDate": "2024-01-15", "amount": 423.42, "reference": "INV-1001" },
{ "dueDate": "2025-05-02", "amount": 700.87, "reference": "INV-1042" }
]
amountis the outstanding balance on that invoice, already net of payments and credit notes.- We derive
amountToRecoverand all three age buckets from the lines, so sendclaimLinesinstead ofamountToRecoverand the bucket fields. Sending both is a 400. - If you omit the case-level
dueDate, it is set to the oldest due date across that case's lines; an explicitdueDateis honoured. - Maximum 1000 lines per case, and a maximum of 1000 lines in total across all entries in Cases. Per-line errors are keyed by case and line index, e.g.
Cases[0].ClaimLines[2].DueDate. claimLinesis a pricing input only — it is not stored and is not shown to the collecting partner.
User Roles
- IsOnboardingUser=true - User receives CreditorAdmin role (full access)
- IsOnboardingUser=false - User receives CreditorUser role (limited access)
Revenue Sharing (Fee Percentage Locked at Link Creation)
- The referral fee percentage is snapshot from the partner's current configuration at the exact moment the client link is created
- This percentage is IMMUTABLE and will NEVER change for this client - even if the partner's global fee percentage is updated later
- The locked percentage is used for ALL revenue calculations for ALL cases created by this client, forever
- This ensures predictable, stable revenue sharing and prevents disputes over retroactive fee changes
- To see the locked percentage for a specific client, use GET /clients/{externalTenantId} (included in response)
Headers
Idempotency-KeystringOptional non-empty, non-whitespace idempotency key (max 255 characters) for safely retrying this request. If a previous request used the same key with the same effective request body, the original terminal response is replayed verbatim. Reusing the key for a different effective request returns 422 with
businessErrors[0].type: "IdempotencyConflict". Field-level 400 validation errors are not stored, so you may fix the request and retry with the same key. An approval-required 409 remains the stored response even after the client later approves; use the client lookup or webhooks for current state.Max 255 characters
Request body
externalTenantIdstringRequiredclientobjectRequiredusersarray of objectsRequiredcasesarray of objectsnullableOptional: Cases to create alongside the client. If provided, cases will be created with PendingContractSigning status. The onboarding URL will guide the client through contract signing for all required PoAs. Supports multi-invoice age bucket pricing fields (AmountToRecoverOver6Months, AmountToRecoverOver12Months, AmountToRecoverOver24Months).
Returns
201 Client created and fully onboarded (terms signed)
externalTenantIdstringnullableonboardingDonebooleanonboardingLinksobjectclientobjectusersarray of objectsnullableisAttributedClientbooleandateLinkeddatetimecaseStatsobjectkycStatusenumKYC (Know Your Customer) verification status for a client linked to a referral partner. Captures three distinct states that a simple boolean cannot express. Sent as snake_case string values: "not_required", "pending", "verified".
One ofNotRequiredPendingVerifiedkycVerificationobjectcaseResultsobjectResult of creating multiple cases during client creation. Groups successful and failed case creation attempts.
Errors
400 | Invalid request (validation errors). Field-length violations (Client.Name, Client.SupportPhone, Client.RegistrationNumber, Client.SupportEmail, Users[].Email) return this field-keyed error dictionary, e.g. { "Client.Name": ["Name must not exceed 80 characters (received 95)."] }. Most other validation failures on this endpoint instead return the single-message ApiErrorResponseDto shape. |
409 | Client/link conflict or an identical Idempotency-Key request still in progress. Approval-required responses use Type/Message/Data; in-progress responses use businessErrors[0].type = IdempotencyKeyInProgress and include Retry-After: 2. |
422 | Business rule violation, including businessErrors[0].type = IdempotencyConflict when the same Idempotency-Key is reused with a different effective request body. |
500 | Internal server error |
See Error handling.
curl -X POST https://referral-api.debitura.com/clients \-H "XApiKey: $DEBITURA_API_KEY" \-H "Content-Type: application/json" \-d '{"externalTenantId": "tenant-12345","client": {"name": "Acme Corp","registrationNumber": "12345678","address": "123 Business Street","zipCode": "1000","city": "Lisbon","state": "Lisbon","country": "Portugal","supportEmail": "billing@acme-corp.com","supportPhone": "+351 123 456 789"},"users": [{"name": "John Doe","email": "john.doe@acme-corp.com","isOnboardingUser": true}],"cases": [{"currencyCode": "EUR","amountToRecover": 4000,"date": "2026-03-01","dueDate": "2026-03-09","claimDescription": "Custom mobile app development services","comments": "Outstanding invoice INV 2024 00789 for custom mobile app development delivered 15 Nov 2024; payment 60 days overdue despite two reminders.","creditorReference": "INV‑2024‑00789","isTest": false,"debtor": {"type": "Company","name": "Acme Corp","contactPerson": "John Doe","companyRegistrationNumber": "12345678","address": "123 Business Street","zipCode": "1000","city": "Lisbon","state": "Lisbon","countryAlpha2": "PT","email": "billing@acme‑corp.com","phone": "+351 123 456 789"}}]}'
{"externalTenantId": "string","onboardingDone": true,"onboardingLinks": {"url": "https://app.debitura.com/…"},"client": {"id": "3f2b6c1e-8a4d-4b7f-9c2e-5d1a0b9e7f31","companyName": "Muster GmbH","officeEmail": "finance@example.com","country": "Germany","address": "Friedrichstraße 68","city": "Berlin","zipCode": "10115","companyRegistrationNumber": "DE123456789"},"users": [{"id": 3,"email": "finance@example.com","firstName": "Anna","lastName": "Schmidt"}],"isAttributedClient": true,"dateLinked": "2026-10-01T14:05:00Z","caseStats": {"casesTotal": 42,"casesClosed": 3,"earningsUsd": 1.5},"kycStatus": "NotRequired","kycVerification": {"directorFullName": "Muster GmbH","directorHomeAddress": "Friedrichstraße 68","directorDateOfBirth": "2026-10-01","dateCreated": "2026-10-01T14:05:00Z","verificationStatus": "Processing","verificationStatusUpdatedAt": "2026-10-01T14:05:00Z"},"caseResults": {"successfulCases": [{"id": "3f2b6c1e-8a4d-4b7f-9c2e-5d1a0b9e7f31","dateCreated": "2026-10-01T14:05:00Z","dateUpdated": "2026-10-01T14:05:00Z","reference": "INV-2026-0042","creditorReference": "INV-2026-0042","creditorComments": "Payment plan agreed with the debtor.","claimDescription": "string","grossAmount": 2500,"remainder": 1.5,"interestFees": 2500,"reminderFees": 2500,"collectionFees": 2500,"totalAddedFees": 2500,"currency": "EUR","isTestCase": true,"lifecycle": "string","dueDate": "2026-10-01T14:05:00Z","date": "2026-10-01T14:05:00Z","dateFinished": "2026-10-01T14:05:00Z","dateCollectionStarted": "2026-10-01T14:05:00Z","closeCode": "string","currentEngagementPhase": "string","claimType": "string","creditorDivisionId": "3f2b6c1e-8a4d-4b7f-9c2e-5d1a0b9e7f31","debtor": {"type": "Company","name": "Pacific Trading LLC","contactPerson": "John Smith","companyRegistrationNumber": "47-1234567","address": "123 Market Street, Suite 400","zipCode": "94105","city": "San Francisco","state": "California","stateAlpha2": "CA","countryAlpha2": "US","country": "United States","email": "accounts@pacifictrading.com","phone": "+1 415 555 0123"},"collectionPartner": {"name": {},"officeEmail": {},"officePhone": {},"publicSite": {},"surveyCadenceMode": {}},"creditor": {"id": {},"companyName": {},"companyRegistrationNumber": {},"officeEmail": {},"officePhone": {},"address": {},"city": {},"zipCode": {},"state": {},"country": {},"division": {}},"bankAccount": {"id": {},"label": {},"scheme": {},"currencyCode": {},"bankCountryCode": {},"accountHolderName": {},"iban": {},"bic": {},"accountNumber": {},"localIdentifier": {},"localIdentifierType": {},"bankName": {},"bankAddress": {},"bankCity": {},"bankZipCode": {},"bankState": {}},"blendedAgeUpliftPoints": 1.5,"preLegalSuccessFee": 2500,"solutionUrl": "https://app.debitura.com/…","signingHandoff": {"combinedSigningUrl": {}},"exclusivePeriodEndDate": "2026-10-01T14:05:00Z","disputeStatus": "string","validation": {"needsInfo": {}},"assignedUser": {"email": {},"name": {}},"allocationOutstanding": {"principal": {},"interest": {},"reminderFees": {},"collectionFees": {}}}],"failedCases": [{"caseIndex": 3,"creditorReference": "INV-2026-0042","errorType": null,"errorMessage": null,"validationErrors": {},"signingHandoff": {"combinedSigningUrl": {}}}]}}
Get client by external tenant ID
/clients/{externalTenantId}Retrieves detailed information for a specific client using your unique identifier (External Tenant ID).
Path Parameter
- externalTenantId - Your unique identifier for this client (the same value used during client creation)
Response Data The response includes complete client information:
- ExternalTenantId - Your unique identifier for this client
- OnboardingDone - Whether the client has completed onboarding (signed debt collection agreements)
- OnboardingLinks - If onboarding incomplete, contains URL to complete the process
- Client - Complete client information
- Debitura-assigned client ID (Guid)
- Company name and registration number
- Country and address details
- Contact information (email, phone)
- Users - List of all users associated with this client
- User ID, email, first name, last name
Use Cases
- Look up client details using your internal identifier
- Check client onboarding status
- Retrieve Debitura client ID for use with the Customer API (via OAuth token endpoint)
- Get client information before creating cases
- Verify client link is still active
Error Cases
- 404 Not Found - No active client link exists for this External Tenant ID and your partner account
- Client was never created
- Client link was archived
- External Tenant ID belongs to different referral partner
- 500 Internal Server Error - Unexpected server error
Important Notes
- Only returns active (non-archived) client links
- External Tenant ID is case-sensitive
- The client must be linked to your referral partner account
- Use the returned client ID with the OAuth token endpoint to generate bearer tokens for Customer API access
Path parameters
externalTenantIdstringRequired
Returns
200 Client retrieved successfully
externalTenantIdstringnullableonboardingDonebooleanonboardingLinksobjectclientobjectusersarray of objectsnullableisAttributedClientbooleandateLinkeddatetimecaseStatsobjectkycStatusenumKYC (Know Your Customer) verification status for a client linked to a referral partner. Captures three distinct states that a simple boolean cannot express. Sent as snake_case string values: "not_required", "pending", "verified".
One ofNotRequiredPendingVerifiedkycVerificationobjectcaseResultsobjectResult of creating multiple cases during client creation. Groups successful and failed case creation attempts.
curl https://referral-api.debitura.com/clients/string \-H "XApiKey: $DEBITURA_API_KEY"
{"externalTenantId": "string","onboardingDone": true,"onboardingLinks": {"url": "https://app.debitura.com/…"},"client": {"id": "3f2b6c1e-8a4d-4b7f-9c2e-5d1a0b9e7f31","companyName": "Muster GmbH","officeEmail": "finance@example.com","country": "Germany","address": "Friedrichstraße 68","city": "Berlin","zipCode": "10115","companyRegistrationNumber": "DE123456789"},"users": [{"id": 3,"email": "finance@example.com","firstName": "Anna","lastName": "Schmidt"}],"isAttributedClient": true,"dateLinked": "2026-10-01T14:05:00Z","caseStats": {"casesTotal": 42,"casesClosed": 3,"earningsUsd": 1.5},"kycStatus": "NotRequired","kycVerification": {"directorFullName": "Muster GmbH","directorHomeAddress": "Friedrichstraße 68","directorDateOfBirth": "2026-10-01","dateCreated": "2026-10-01T14:05:00Z","verificationStatus": "Processing","verificationStatusUpdatedAt": "2026-10-01T14:05:00Z"},"caseResults": {"successfulCases": [{"id": "3f2b6c1e-8a4d-4b7f-9c2e-5d1a0b9e7f31","dateCreated": "2026-10-01T14:05:00Z","dateUpdated": "2026-10-01T14:05:00Z","reference": "INV-2026-0042","creditorReference": "INV-2026-0042","creditorComments": "Payment plan agreed with the debtor.","claimDescription": "string","grossAmount": 2500,"remainder": 1.5,"interestFees": 2500,"reminderFees": 2500,"collectionFees": 2500,"totalAddedFees": 2500,"currency": "EUR","isTestCase": true,"lifecycle": "string","dueDate": "2026-10-01T14:05:00Z","date": "2026-10-01T14:05:00Z","dateFinished": "2026-10-01T14:05:00Z","dateCollectionStarted": "2026-10-01T14:05:00Z","closeCode": "string","currentEngagementPhase": "string","claimType": "string","creditorDivisionId": "3f2b6c1e-8a4d-4b7f-9c2e-5d1a0b9e7f31","debtor": {"type": "Company","name": "Pacific Trading LLC","contactPerson": "John Smith","companyRegistrationNumber": "47-1234567","address": "123 Market Street, Suite 400","zipCode": "94105","city": "San Francisco","state": "California","stateAlpha2": "CA","countryAlpha2": "US","country": "United States","email": "accounts@pacifictrading.com","phone": "+1 415 555 0123"},"collectionPartner": {"name": {},"officeEmail": {},"officePhone": {},"publicSite": {},"surveyCadenceMode": {}},"creditor": {"id": {},"companyName": {},"companyRegistrationNumber": {},"officeEmail": {},"officePhone": {},"address": {},"city": {},"zipCode": {},"state": {},"country": {},"division": {}},"bankAccount": {"id": {},"label": {},"scheme": {},"currencyCode": {},"bankCountryCode": {},"accountHolderName": {},"iban": {},"bic": {},"accountNumber": {},"localIdentifier": {},"localIdentifierType": {},"bankName": {},"bankAddress": {},"bankCity": {},"bankZipCode": {},"bankState": {}},"blendedAgeUpliftPoints": 1.5,"preLegalSuccessFee": 2500,"solutionUrl": "https://app.debitura.com/…","signingHandoff": {"combinedSigningUrl": {}},"exclusivePeriodEndDate": "2026-10-01T14:05:00Z","disputeStatus": "string","validation": {"needsInfo": {}},"assignedUser": {"email": {},"name": {}},"allocationOutstanding": {"principal": {},"interest": {},"reminderFees": {},"collectionFees": {}}}],"failedCases": [{"caseIndex": 3,"creditorReference": "INV-2026-0042","errorType": null,"errorMessage": null,"validationErrors": {},"signingHandoff": {"combinedSigningUrl": {}}}]}}
Reset a client (test environment only)
/clients/{externalTenantId}Deletes a client and all associated data, allowing you to re-create the client from scratch.
⚠️ TEST ENVIRONMENT ONLY - This endpoint is only available on the test environment (testreferral-api.debitura.com). Calling this endpoint on production will return 403 Forbidden.
Use Cases
- Testing the full onboarding flow multiple times
- Resetting after changing your internal tenant structure during development
- Cleaning up test data without manual intervention
What Gets Deleted (cascade)
- All collection cases and invoices for the client
- All leads for the client
- The Creditor account (removes email from matching algorithm)
- The ReferralPartnerClientLink is archived
- Associated users are cleaned up if they have no other relations
After Reset
- You can call POST /clients with any externalTenantId using the same email
- The matching algorithm will not find the deleted client
- A completely new client will be created (IsAttributedClient=true)
Important
- You can only reset clients that are linked to your partner account
- Pending link requests (409 scenario) cannot be reset - only actual links
Path parameters
externalTenantIdstringRequired
Returns
204 Client and all associated data successfully deleted — no response body.
Errors
403 | Endpoint not available in production environment |
404 | No active client link found for this externalTenantId |
500 | Internal server error |
See Error handling.
curl -X DELETE https://referral-api.debitura.com/clients/string \-H "XApiKey: $DEBITURA_API_KEY"
204 Client and all associated data successfully deleted. No response body.
Check if a client can be deleted (test environment only)
/clients/{externalTenantId}/is-deletableChecks whether a client can be safely deleted for testing purposes.
⚠️ TEST ENVIRONMENT ONLY - This endpoint is only available on the test environment.
Use this endpoint before calling DELETE to verify the client can be removed.
A client can be deleted if:
- They have no active collection cases (only pending cases are allowed)
- They have no leads with active quotes
Returns
- isDeletable: true if the client can be deleted
- blockers: list of reasons why deletion is blocked (if any)
Path parameters
externalTenantIdstringRequired
Returns
200 Deletability check completed
isDeletablebooleanTrue if the client can be safely deleted.
blockersarray of stringsnullableList of reasons why the client cannot be deleted (empty if IsDeletable is true).
Errors
403 | Endpoint not available in production environment |
404 | No active client link found for this externalTenantId |
500 | Internal server error |
See Error handling.
curl https://referral-api.debitura.com/clients/string/is-deletable \-H "XApiKey: $DEBITURA_API_KEY"
{"isDeletable": true,"blockers": ["string"]}
Withdraw an attributed client
/clients/{externalTenantId}/withdrawWithdraws a client that never completed onboarding. Archives the referral partner link and closes all pending cases with close code CaseNeverStartedInternal.
The same externalTenantId can be re-submitted via POST /clients after withdrawal.
Path Parameter
- externalTenantId - Your internal identifier for the client
Business Rules
- Only attributed clients (IsAttributedClient = true) can be withdrawn
- All cases for this client must be in PendingContractSigning status
What Happens
- The referral partner client link is archived
- All pending cases are closed with close code CaseNeverStartedInternal
What Does NOT Happen
- The client record itself is not deleted or anonymised. The company, its users, its KYC record and any signed agreements are all retained
After Withdrawal
- The same externalTenantId can be re-submitted via POST /clients
- Provided the re-submission still identifies the SAME client — that is, it carries a user email or supportEmail already registered on it — it re-links that original client rather than creating a second one: a new active link is established on the same Debitura client, attribution (IsAttributedClient=true) is preserved, and the archived link is kept for audit. The call returns 201/202 as normal — not a 409
- Any cases in the re-submission are created against that client. A CreditorReference used by a case that this withdrawal closed can be reused, because such a case no longer reserves it
- Any approval request left pending for this externalTenantId is resolved as declined, since the link it was asking the client to approve now exists
- Re-submitting with entirely different contact emails does NOT re-link. A matching email is our only independent confirmation that this is the same client; without one we cannot tell a genuine re-submission apart from the same externalTenantId being reused for somebody else — so a new client is created, exactly as before this behaviour existed
- The re-link does not update the client or add users. Client details and Users in the re-submission are ignored, and the new link keeps the original onboarding user
- Re-linking only applies to your own withdrawn client. If the externalTenantId now resolves to a different client, or that client has since linked to another partner, the normal 409 ClientExistsNeedsLinking / AlreadyLinkedToAnotherPartner handling applies unchanged
Error Cases
- 404 Not Found - No active client link exists for this externalTenantId and your partner account
- 409 Conflict - Client cannot be withdrawn because:
- IsAttributedClient = false (non-attributed clients cannot be withdrawn)
- One or more cases have progressed beyond PendingContractSigning
Path parameters
externalTenantIdstringRequired
Returns
204 Client withdrawn successfully — no response body.
Errors
404 | No active client link found for this externalTenantId |
409 | Cannot withdraw — client not attributed or cases have progressed beyond onboarding |
500 | Internal server error |
See Error handling.
curl -X POST https://referral-api.debitura.com/clients/string/withdraw \-H "XApiKey: $DEBITURA_API_KEY"
204 Client withdrawn successfully. No response body.
Submit KYC verification for a client
/clients/{externalTenantId}/kyc-verificationSubmits KYC/AML director verification data for an existing client. Multiple submissions are allowed; the latest record is used for verification checks. When sendChatNotification is true (default), a system message is posted on all active cases for this client to notify the collection partner.
Path parameters
externalTenantIdstringRequired
Query parameters
sendChatNotificationboolean
Headers
Idempotency-KeystringOptional non-empty, non-whitespace idempotency key (max 255 characters) for safely retrying this request. If a previous request used the same key with an identical body, the original terminal response is replayed verbatim. Reusing the key with a different body returns 422 with
businessErrors[0].type: "IdempotencyConflict". Field-level 400 validation errors are not stored, so you may fix the request and retry with the same key.Max 255 characters
Request body
directorFullNamestringRequiredMax 500 charactersdirectorHomeAddressstringRequiredMax 1000 charactersdirectorDateOfBirthdateRequired
Returns
201 KYC verification submitted
directorFullNamestringnullabledirectorHomeAddressstringnullabledirectorDateOfBirthdatedateCreateddatetimeverificationStatusenumnullablePartner/staff-set review status (Processing/Completed) for this submission. Null = not yet reviewed. Note: distinct from the sibling
ClientResponse.KycStatusfield, which describes whether KYC data has been submitted at all.One ofProcessingCompletednullverificationStatusUpdatedAtdatetimenullableWhen VerificationStatus was last set. Null until set.
curl -X POST https://referral-api.debitura.com/clients/string/kyc-verification \-H "XApiKey: $DEBITURA_API_KEY" \-H "Content-Type: application/json" \-d '{"directorFullName": "Muster GmbH","directorHomeAddress": "Friedrichstraße 68","directorDateOfBirth": "2026-10-01"}'
{"directorFullName": "Muster GmbH","directorHomeAddress": "Friedrichstraße 68","directorDateOfBirth": "2026-10-01","dateCreated": "2026-10-01T14:05:00Z","verificationStatus": "Processing","verificationStatusUpdatedAt": "2026-10-01T14:05:00Z"}