Reset Test Clients
Delete test clients to re-run the onboarding flow from scratch.
Overview
When testing the client onboarding flow multiple times with the same email, the matching algorithm returns 409 conflicts. The reset endpoints let you delete test clients so you can start fresh.
Available on test environment only. These endpoints return 403 Forbidden in production.
Check if Deletable
Before deleting, verify the client has no blocking data:
GET https://testreferral-api.debitura.com/clients/{externalTenantId}/is-deletable
XApiKey: YOUR_API_KEY
Response:
{
"isDeletable": true,
"blockers": []
}
If isDeletable is false, each entry in the blockers array carries a reason string explaining why. Only active state blocks deletion — already-closed cases do not:
Blocker reason | Solution |
|---|---|
Active case — must be closed before account deletion. | Close the active case first |
You have pending lead quotes that must be resolved before deleting your account. | Resolve leads with open quotes first |
Unpaid partner commission — must be reconciled before account deletion. | Reconcile the outstanding partner commission first |
Delete the Client
Once verified deletable:
DELETE https://testreferral-api.debitura.com/clients/{externalTenantId}
XApiKey: YOUR_API_KEY
Returns 204 No Content on success.
What gets deleted (cascade):
- All collection cases and invoices for the client (including invoice lines, payments, blobs)
- All leads for the client
- The Creditor account (soft-deleted)
- The ReferralPartnerClientLink (archived)
- Associated users (if they have no other creditor relations)
Nothing is retained — the reset removes the client and all of its child data so you can re-run onboarding from scratch.
After Reset
Call POST /clients with the same email:
- The matching algorithm won't find the deleted client
- A new client is created
IsAttributedClientistrue(treated as new introduction)
Constraints
- Your clients only — You can only delete clients linked to your partner account
- Pending approvals unaffected — If a client hasn't approved a link request (409 scenario), there's nothing to delete yet. The link request expires after the configured per-partner TTL (
ApprovalTtlDays, default 7 days, clamped 1–30 days).
Error Handling
| Status | Cause | Solution |
|---|---|---|
403 Forbidden | Production environment | Only available on test |
404 Not Found | No active link for this externalTenantId | Verify the tenant ID and that the client was fully onboarded |
422 Unprocessable | Client has blockers | Check is-deletable first and resolve blockers |
See Error Handling for the full error response format.