{
"openapi": "3.0.4",
"info": {
"title": "Debitura Customer API",
"description": "Welcome to the Debitura Customer API, your gateway to seamlessly integrating your debt collection workflow with our platform. Debitura connects customers with trusted debt collection firms specializing in pre-legal debt recovery. With this API, you can easily upload cases, track their status, and manage your debt collection process efficiently. For any support or inquiries, please reach out to us at contact@debitura.com. To setup an API key, log into your Debitura account and go here: https://app.debitura.com/CreditorApiKey\n\nπ Full documentation, guides, and integration walkthroughs: https://docs.debitura.com/clients\n\nNOTE: if you're representing a platform and want to provide this feature for your customers, you need a different API. Please contact us.",
"contact": {
"name": "Debitura Support",
"url": "https://www.debitura.com/integration/debt-collection-api",
"email": "contact@debitura.com"
},
"version": "v1"
},
"servers": [
{
"url": "https://customer-api.debitura.com",
"description": "Production"
}
],
"paths": {
"/cases": {
"post": {
"tags": [
"Cases"
],
"summary": "Create collection case",
"description": "Creates a new collection case for debt collection.\n\n**Test Mode:**\n- Set isTest=true to create a test case (case IS created in the database but marked as test data)\n- Test cases are excluded from production metrics and can be easily filtered or deleted\n- Use test mode for integration testing and development\n\n**Debtor Rules:**\n- debtor.type must be \"Company\" or \"Private\"\n - Company β debtor.name is mandatory (company name)\n - Private β debtor.name is mandatory (person's full name)\n\n**Geographic Rules:**\n- debtor.countryAlpha2 (ISO 3166-1 alpha-2) is always required\n- debtor.state is a free-text region description\n- For US debtors: debtor.stateAlpha2 (two-letter state code) is also required β debtor.state is ignored in that scenario\n\n**Optional Parameters:**\n- creditorDivisionId - Assign case to a specific division (for multi-division creditors)\n- collectionPartnerId - Override automatic partner assignment with a specific collection partner\n- skipDebituraVerification - Skip internal verification steps (advanced use)\n- skipCreationEmails - Deprecated: accepted for backwards compatibility but ignored server-side. Creation emails are always suppressed in favour of the hourly CasesStarted digest\n- allowPendingContracts - Accept cases with unsigned contracts in 'PendingContractSigning' status instead of returning 422\n\n**Error Responses:**\n- 400: Field validation errors (returns JSON object with field names as keys and error arrays as values)\n- 422: Business rule violations (returns BusinessErrorResponseApiDTO with type, message, and solutionUrl)\n- 500: Server errors",
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"description": "Optional 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 `Type: \"IdempotencyConflict\"`. Field-level 400 validation errors are not stored, so you may fix the request and retry with the same key.",
"schema": {
"maxLength": 255,
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.CreateCollectionCaseRequestApiViewModel"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.CreateCollectionCaseRequestApiViewModel"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.CreateCollectionCaseRequestApiViewModel"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.CreateCollectionCaseRequestApiViewModel"
}
}
}
},
"responses": {
"200": {
"description": "Case created",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"422": {
"description": "Business rule violation",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorResponseApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorResponseApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorResponseApiDTO"
}
}
}
},
"500": {
"description": "Server error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"get": {
"tags": [
"Cases"
],
"summary": "List collection cases",
"description": "Returns a paginated list of collection cases for your account.\n\n**Pagination:**\n- page (default: 1) - Page number, starting from 1\n- pageSize (default: 10, max: 100) - Number of results per page\n\n**Filters:**\n- statuses - Filter by case lifecycle status (comma-separated list)\n Valid values: PendingContractSigning, PendingVerificationInternal, PendingVerification,\n NeedsAdditionalDetails, Leads, LeadsQuoteGiven, Active, Paused, Closed, Merged\n (case-insensitive; both name and description forms accepted)\n- divisionIds - Filter by creditor division IDs (comma-separated GUIDs, for multi-division creditors)\n- debtorIds - Filter by specific debtor IDs (comma-separated GUIDs)\n- ids - Filter by specific case IDs (comma-separated GUIDs)\n\n**Sorting:**\n- sort - Sort field and direction (format: 'field:direction')\n Valid sort fields: DateCreated, DateUpdated, DateFinished, DateCollectionStarted,\n DueDate, Date, GrossAmount, Remainder, InterestFees, CollectionFees, ReminderFees,\n Lifecycle, CloseCode\n Examples: 'DateCreated:desc', 'DueDate:asc', 'GrossAmount:desc'\n Unknown fields are silently ignored.\n\n**Response:**\n- Returns InvoiceListApiDTO with page metadata and cases array\n- Page metadata includes: totalResults, currentPage, skipped, pageSize",
"parameters": [
{
"name": "Page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"name": "PageSize",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"name": "DebtorIds",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
{
"name": "Ids",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
{
"name": "Statuses",
"in": "query",
"description": "Filter by case lifecycle status. Valid values: PendingContractSigning, PendingVerificationInternal,\nPendingVerification, NeedsAdditionalDetails, Leads, LeadsQuoteGiven, Active, Paused, Closed, Merged\n(case-insensitive; both name and description forms accepted).",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "DivisionIds",
"in": "query",
"description": "Optional list of division IDs to filter by",
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
{
"name": "Sort",
"in": "query",
"description": "Optional sorting string \"Field[:asc|desc][,Field2[:asc|desc]]β¦\".\nValid sort fields: DateCreated, DateUpdated, DateFinished, DateCollectionStarted,\nDueDate, Date, GrossAmount, Remainder, InterestFees, CollectionFees, ReminderFees,\nLifecycle, CloseCode. Examples: 'DateCreated:desc', 'DueDate:asc'. Unknown fields are silently ignored.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceListDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceListDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceListDto"
}
}
}
},
"400": {
"description": "Invalid query parameters",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/preview": {
"post": {
"tags": [
"Cases"
],
"summary": "Preview case eligibility and requirements",
"description": "Preview what would happen if you submitted a case, without actually creating it.\n\n**What This Endpoint Returns:**\n- IsEligible - Whether the case can be submitted (partner available)\n- PartnerAssignment - Which collection partner would handle the case\n- RequiredActions - What contracts/documents need to be signed before submission\n - Standard Debt Collection Agreement (SDCA)\n - Power of Attorney (PoA) for the assigned partner\n- PricingPreview - Estimated success fee with age-based surcharges\n- Jurisdiction - Geographic details\n\n**Use This To:**\n1. Check if a jurisdiction is supported before submitting\n2. Determine which documents need signing before case creation\n3. Get signing URLs to guide users through required actions\n4. Estimate pricing including age surcharges\n\n**Required Fields:**\n- AmountToRecover - Total principal amount\n- CurrencyCode - ISO 4217 currency code (e.g., 'DKK', 'EUR', 'USD')\n- Debtor.Type - 'Company' or 'Private'\n- Debtor.CountryAlpha2 - ISO 3166-1 alpha-2 country code\n- Debtor.StateAlpha2 - Required for US cases only (e.g., 'CA', 'NY')\n\n**Optional Fields (Multi-Invoice Age Pricing):**\n- AmountToRecoverOver12Months - Portion over 12 months overdue\n- AmountToRecoverOver24Months - Portion over 24 months overdue\n(Both must be provided together if used)\n- AmountToRecoverOver6Months - Portion over 6 months overdue (optional, improves pricing tier accuracy at the 180-day threshold; requires Over12/Over24)\n\n**Solution URLs Are Context-Aware:**\n- Bearer token (referral partner) β referral onboarding URLs\n- XApiKey (creditor) β standard creditor app URLs\n\n**Important Notes:**\n- This endpoint does NOT create a case - it only previews what would happen\n- The preview uses the same eligibility logic as POST /cases\n- If multiple partners match (system limitation), the first match is returned\n- All required actions must be completed before calling POST /cases\n\n**Example Workflow:**\n```\n1. POST /cases/preview β Check eligibility and get signing URLs\n2. User completes required actions (signs SDCA, signs PoA)\n3. POST /cases β Create the actual case\n```",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.PreviewCaseRequestApiViewModel"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.PreviewCaseRequestApiViewModel"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.PreviewCaseRequestApiViewModel"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.PreviewCaseRequestApiViewModel"
}
}
}
},
"responses": {
"200": {
"description": "Preview completed",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.PreviewCaseResponseApiViewModel"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.PreviewCaseResponseApiViewModel"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.PreviewCaseResponseApiViewModel"
}
}
}
},
"400": {
"description": "Invalid request (validation errors)",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}": {
"get": {
"tags": [
"Cases"
],
"summary": "Fetch case by ID",
"description": "Returns case details for the provided Debitura case ID (a GUID).",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Case found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
}
}
},
"400": {
"description": "ID missing, empty, or ID is not a collection case",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found, deleted, or does not belong to your account",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/by-creditor-reference/{creditorReference}": {
"get": {
"tags": [
"Cases"
],
"summary": "Fetch case by creditor reference",
"description": "Returns case details for the provided creditor reference. The creditor reference is your own unique identifier for the case, as provided when the case was created.",
"parameters": [
{
"name": "creditorReference",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Case found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
}
}
},
"400": {
"description": "Creditor reference missing or empty",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "No case found with this creditor reference",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/contract-status": {
"get": {
"tags": [
"Cases"
],
"summary": "Get contract signing status for a case",
"description": "Returns the signing status of the SDCA (Standard Debt Collection Agreement), PoA (Power of Attorney), and Jurisdiction Pricing Appendix for a case.\n\n**Use case:** When a case is stuck in PendingContractSigning, use this endpoint to determine which contract is missing and get the signing URL.\n\n**Response:**\n- sdca: Always present β shows whether the debt collection agreement is signed\n- poa: Present only if a collection partner is assigned β shows whether the power of attorney is signed for that partner\n- NeedsPoaSigning: true when the case is blocked because a required PoA or Jurisdiction Pricing Appendix has not been signed\n- Each contract item includes a solutionUrl if signing or re-signing is needed\n- The solutionUrl is context-aware: referral partner bearer tokens get referral onboarding URLs, API keys get creditor app URLs",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Contract status returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseContractStatusApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseContractStatusApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseContractStatusApiDTO"
}
}
}
},
"400": {
"description": "ID missing, empty, or not a collection case",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found, deleted, or does not belong to your account",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/case-reference/{caseReference}": {
"get": {
"tags": [
"Cases"
],
"summary": "Fetch case by reference",
"description": "Returns case details for the provided Debitura case reference (example: Q8OAXF3W).",
"parameters": [
{
"name": "caseReference",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Case found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
}
}
}
},
"400": {
"description": "Reference missing or reference is not a collection case",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Reference not found or case does not belong to your account",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/timeline": {
"get": {
"tags": [
"Cases"
],
"summary": "Fetch case timeline",
"description": "Returns the full event timeline for the case along with the current engagement phase.\n\n**Response shape:**\n- `items` β chronological list of timeline events\n- `currentEngagementPhase` β current phase of the active engagement: \"Pre-legal\", \"Legal\", or \"Enforcement\". Null when no active engagement exists.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Timeline returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseTimelineResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseTimelineResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseTimelineResponse"
}
}
}
},
"400": {
"description": "ID missing",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/chats": {
"get": {
"tags": [
"Cases"
],
"summary": "Fetch case chats",
"description": "Returns all chat messages attached to the case.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Chats returned",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto"
}
}
}
}
},
"400": {
"description": "ID missing",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"post": {
"tags": [
"Cases"
],
"summary": "Send a chat message",
"description": "Posts a new chat message on a case, visible to both you and the collection partner.\n\n**Message Details:**\n- The message is attributed to the team member identified by `userId`\n- The collection partner will receive an email notification about the new message\n- Messages appear in the case chat timeline in chronological order\n\n**Prerequisites:**\n- The case must exist and belong to your account\n- The `userId` must be a valid user ID from `GET /users` belonging to your team\n\n**Use Case:**\nUse this endpoint to communicate with collection partners about case progress, provide additional information, or respond to partner questions. Messages sent via this endpoint are equivalent to messages sent through the creditor portal chat.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.SendChatRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.SendChatRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.SendChatRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.SendChatRequest"
}
}
}
},
"responses": {
"200": {
"description": "Chat message sent successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto"
}
}
}
},
"400": {
"description": "Validation error β missing fields, invalid userId, or invalid request body",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/payments": {
"get": {
"tags": [
"Cases"
],
"summary": "Fetch case payments",
"description": "Returns every payment recorded on the case.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Payments returned",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto"
}
}
}
}
},
"400": {
"description": "ID missing",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/files": {
"post": {
"tags": [
"Cases"
],
"summary": "Upload a file to a case",
"description": "Uploads a file and associates it with a case.\n\nFile requirements:\n- Maximum file size: 25MB\n- Allowed file types: PDF (.pdf), Excel (.xls, .xlsx), CSV (.csv), Text (.TXT), Images (.jpg, .jpeg, .png, .gif)\n\nThe file will be stored securely and associated with the specified case.\n\nDocument types:\n- OriginalInvoice (default) - The original invoice document\n- DebtorDocuments - Documents provided by the debtor\n- CreditorDocuments - Documents provided by the creditor\n- PartnerDocuments - Documents provided by collection partners\n- DemandLetter - Formal demand letter\n- Miscellaneous - Other supporting documents",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"required": [
"File"
],
"type": "object",
"properties": {
"Description": {
"type": "string"
},
"DocumentType": {
"type": "string"
},
"File": {
"type": "string",
"format": "binary"
}
}
},
"encoding": {
"Description": {
"style": "form"
},
"DocumentType": {
"style": "form"
},
"File": {
"style": "form"
}
}
}
}
},
"responses": {
"200": {
"description": "File uploaded successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Files.CaseFileDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Files.CaseFileDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Files.CaseFileDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"413": {
"description": "File too large",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"415": {
"description": "Unsupported file type",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"500": {
"description": "Server error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"get": {
"tags": [
"Cases"
],
"summary": "Get case files",
"description": "Returns all files associated with the specified case.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Files retrieved successfully",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Files.CaseFileDto"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Files.CaseFileDto"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Files.CaseFileDto"
}
}
}
}
},
"400": {
"description": "Invalid case ID",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"500": {
"description": "Server error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/quote-requests": {
"get": {
"tags": [
"Cases"
],
"summary": "List quote requests for a case",
"description": "Returns all quote requests for the specified case. Multiple quote requests can exist per case.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Quote requests returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadListDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadListDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadListDto"
}
}
}
},
"400": {
"description": "Invalid case ID",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/quote-requests/{quoteRequestId}": {
"get": {
"tags": [
"Cases"
],
"summary": "Get quote request details",
"description": "Returns detailed information for a specific quote request including computed properties.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "quoteRequestId",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Quote request found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadDetailDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadDetailDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadDetailDto"
}
}
}
},
"400": {
"description": "Invalid ID",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Quote request or case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/quote-requests/{quoteRequestId}/quotes": {
"get": {
"tags": [
"Cases"
],
"summary": "List quotes for a quote request",
"description": "Returns all partner quotes received for the specified quote request.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "quoteRequestId",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Quotes returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteListDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteListDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteListDto"
}
}
}
},
"400": {
"description": "Invalid ID",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Quote request or case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/quote-requests/{quoteRequestId}/quotes/{quoteId}": {
"get": {
"tags": [
"Cases"
],
"summary": "Get quote details",
"description": "Returns complete details for a specific quote including full pricing breakdown.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "quoteRequestId",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "quoteId",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Quote found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteDetailDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteDetailDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteDetailDto"
}
}
}
},
"400": {
"description": "Invalid ID",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Quote, quote request, or case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/exclusive-period": {
"get": {
"tags": [
"Cases"
],
"summary": "Get exclusive collection period chain",
"description": "Returns the full exclusive collection period chain for a case, including the initial period and any extensions triggered by debtor actions (promise to pay, payment agreement, or actual payment).",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Chain returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.ExclusivePeriodDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.ExclusivePeriodDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.ExclusivePeriodDto"
}
}
}
},
"400": {
"description": "ID missing or empty",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found, does not belong to your account, or no collection period exists",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/validation": {
"get": {
"tags": [
"Cases"
],
"summary": "Get full validation detail for a case",
"description": "Returns the full creditor-facing validation status for a case, including the resolution area and description for each outstanding item.\n\n**When to call:** Check `validation.needsInfo` on `GET /cases/{id}`. If `true`, call this endpoint to retrieve the item-level breakdown of what the creditor must supply.\n\n**Safety:** Only creditor-facing resolution areas are returned. Internal areas (InternalReview, AdminReview) and sensitive fields (Rationale, Confidence) are never exposed.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Full validation status returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Services.CaseValidation.CaseValidationStatusDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Services.CaseValidation.CaseValidationStatusDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Services.CaseValidation.CaseValidationStatusDto"
}
}
}
},
"400": {
"description": "ID missing, empty, or not a collection case",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found or does not belong to your account",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/cases/{id}/tasks": {
"get": {
"tags": [
"Cases"
],
"summary": "List tasks for a case",
"description": "Returns every open task (action-item) attached to this specific case. Same data as GET /tasks, scoped to one case β use this when you're already working a specific case and want just its outstanding tasks.\n\n**Note:** account-level tasks that aren't tied to a single case (e.g. SignContract, AssignBankAccount β these block your whole account, not one case) never appear here; call GET /tasks to see those.\n\n**Filtering:**\n- status (default: Open) β Open or Solved\n- type (repeatable, e.g. ?type=ReplyToChat) β restrict to specific task types\n\nNo pagination β a single case has few tasks.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string",
"default": "Open"
}
},
{
"name": "type",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
],
"responses": {
"200": {
"description": "Tasks returned",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto"
}
}
}
}
},
"400": {
"description": "ID missing, or invalid status/type filter",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Case not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/contracts/debt-collection/status": {
"get": {
"tags": [
"Contracts"
],
"summary": "Get debt collection contract status",
"description": "Returns the status of your standard Debt Collection Agreement with Debitura.\n\n**Response Fields:**\n- signed (boolean) - Whether the agreement has been signed\n- requiresResigning (boolean) - Whether the contract needs to be re-signed\n- invalidationReason (string) - Why re-signing is required (if applicable)\n Possible values: None, NewVersion, AdminInvalidated, Other, CreditorNameChanged\n- termsUrl (string, nullable) - URL to download the signed agreement PDF (only when signed=true)\n- solutionUrl (string, nullable) - URL to sign or re-sign the agreement (only when action required)\n\n**Use Case:**\nCheck this endpoint before creating cases to ensure you have signed the required agreement. If requiresResigning=true, navigate to the solutionUrl to complete the signing process.",
"responses": {
"200": {
"description": "Contract status returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CollectionContractStatusApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CollectionContractStatusApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CollectionContractStatusApiDTO"
}
}
}
}
}
}
},
"/coverage": {
"get": {
"tags": [
"Coverage"
],
"summary": "List all jurisdiction coverage",
"description": "Returns complete coverage information for all jurisdictions where Debitura operates, including power of attorney signing status and solution URLs.",
"responses": {
"200": {
"description": "Coverage list returned",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
}
}
}
}
}
}
},
"/coverage/{id}": {
"get": {
"tags": [
"Coverage"
],
"summary": "Get jurisdiction coverage by ID",
"description": "Returns a single jurisdiction with its geographic information, assigned collection partner, and power of attorney signing status.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "Coverage item returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
}
}
},
"404": {
"description": "Jurisdiction not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/coverage/search": {
"get": {
"tags": [
"Coverage"
],
"summary": "[DEPRECATED] Search for jurisdiction coverage",
"description": "β οΈ **DEPRECATED:** Use POST /coverage/check-eligibility instead.",
"parameters": [
{
"name": "q",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Coverage item returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
}
}
},
"400": {
"description": "Search query missing or invalid",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "No jurisdiction found matching the search query",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
},
"deprecated": true
}
},
"/coverage/:search": {
"get": {
"tags": [
"Coverage"
],
"summary": "[DEPRECATED] Search for jurisdiction coverage",
"description": "β οΈ **DEPRECATED:** Use POST /coverage/check-eligibility instead.",
"parameters": [
{
"name": "q",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Coverage item returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO"
}
}
}
},
"400": {
"description": "Search query missing or invalid",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "No jurisdiction found matching the search query",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
},
"deprecated": true
}
},
"/coverage/check-eligibility": {
"post": {
"tags": [
"Coverage"
],
"summary": "Check case eligibility and get assigned partner",
"description": "**Determine if a case can be submitted and get partner + PoA status.**\n\n**Request Fields:**\n- CountryAlpha2 (required) - Debtor country (e.g., 'DK', 'US', 'DE')\n- StateAlpha2 (conditional) - Required for US debtors (e.g., 'CA', 'NY')\n- DebtorType (required) - 'Company' or 'Private'\n- Amount (required) - Amount to recover\n- CurrencyCode (required) - Currency (e.g., 'USD', 'EUR', 'DKK')\n\n**Response:**\n- IsEligible (boolean) - Whether case can be submitted\n- Partner - Specific partner that will handle this case\n- PowerOfAttorneyStatus - PoA signing status for the matched partner\n\n**Note:** Does NOT check SDCA status. Use GET /contracts/debt-collection/status for that.",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityRequestApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityRequestApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityRequestApiDTO"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityRequestApiDTO"
}
}
}
},
"responses": {
"200": {
"description": "Eligibility check completed",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityResponseApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityResponseApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityResponseApiDTO"
}
}
}
},
"400": {
"description": "Invalid request (validation errors)",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/divisions": {
"post": {
"tags": [
"Divisions"
],
"summary": "Create a new division.",
"description": "Creates a new division for the authenticated creditor.\n\nDivisions allow creditors to organize cases under different business units, branches, or departments.\n\n**Required Fields:**\n- companyName - Name of the division\n- city - City where the division is located\n- countryCode - ISO 3166-1 alpha-2 country code (e.g. 'US', 'DE', 'DK')\n\n**Optional Fields:**\n- registrationNumber - Company registration number (CVR, VAT, etc.)\n- address, zipCode, state - Full address details\n- officeEmail, officePhone - Contact information",
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"description": "Optional 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 `Type: \"IdempotencyConflict\"`. Field-level 400 validation errors are not stored, so you may fix the request and retry with the same key.",
"schema": {
"maxLength": 255,
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.CreateDivisionRequestDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.CreateDivisionRequestDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.CreateDivisionRequestDto"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.CreateDivisionRequestDto"
}
}
}
},
"responses": {
"201": {
"description": "Division created successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"422": {
"description": "Business rule violation",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"get": {
"tags": [
"Divisions"
],
"summary": "List divisions for the authenticated creditor.",
"description": "Returns a paginated list of divisions for the authenticated creditor.\n\nBy default, archived divisions are excluded. Set `includeArchived=true` to include them.",
"parameters": [
{
"name": "page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 1
}
},
{
"name": "pageSize",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 10
}
},
{
"name": "includeArchived",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"200": {
"description": "List of divisions",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionListDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionListDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionListDto"
}
}
}
}
}
}
},
"/divisions/{id}": {
"get": {
"tags": [
"Divisions"
],
"summary": "Get a single division by ID.",
"description": "Returns details of a specific division. The division must belong to the authenticated creditor.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Division found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
}
}
},
"404": {
"description": "Division not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"put": {
"tags": [
"Divisions"
],
"summary": "Update a division.",
"description": "Replaces all fields of a division. All required fields must be provided.\n\n**Required Fields:**\n- companyName - Name of the division\n- city - City where the division is located\n- countryCode - ISO 3166-1 alpha-2 country code (e.g. 'US', 'DE', 'DK')",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.UpdateDivisionRequestDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.UpdateDivisionRequestDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.UpdateDivisionRequestDto"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.UpdateDivisionRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "Division updated successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Division not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"delete": {
"tags": [
"Divisions"
],
"summary": "Delete a division.",
"description": "Deletes a division.\n\n**Important:** A division cannot be deleted if it is referenced by active cases.\nIf you need to deactivate a division that has cases, use the archive endpoint instead.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"204": {
"description": "Division deleted successfully"
},
"404": {
"description": "Division not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"422": {
"description": "Division cannot be deleted because it has active cases",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/divisions/{id}/archive": {
"post": {
"tags": [
"Divisions"
],
"summary": "Archive a division.",
"description": "Archives a division, making it inactive. Archived divisions are excluded from list results by default.\n\n**Important:** This action is irreversible. Archived divisions can still be referenced by existing cases.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Division archived successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
}
}
},
"404": {
"description": "Division not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"422": {
"description": "Division is already archived",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/divisions/{id}:archive": {
"post": {
"tags": [
"Divisions"
],
"summary": "Archive a division.",
"description": "Archives a division, making it inactive. Archived divisions are excluded from list results by default.\n\n**Important:** This action is irreversible. Archived divisions can still be referenced by existing cases.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Division archived successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
}
}
}
},
"404": {
"description": "Division not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"422": {
"description": "Division is already archived",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/me": {
"get": {
"tags": [
"Me"
],
"summary": "Verifies the provided authentication and returns the current Creditor profile",
"description": "Returns your creditor profile when a valid `XApiKey` header or `Authorization: Bearer` token is provided.",
"responses": {
"200": {
"description": "Creditor found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Me.CreditorMeApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Me.CreditorMeApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Me.CreditorMeApiDTO"
}
}
}
},
"401": {
"description": "Missing or invalid API key or bearer token"
},
"404": {
"description": "Creditor not found"
}
}
}
},
"/Payments": {
"get": {
"tags": [
"Payments"
],
"summary": "List payments",
"description": "Returns a paginated list of all payments recorded on your account across all cases.\n\n**Pagination:**\n- Page (default: 1) - Page number, starting from 1\n- PageSize (default: 10, max: 100) - Number of results per page\n\n**Response:**\n- Returns PaymentListApiDTO with page metadata and payments array\n- Each payment includes case reference, amount, currency, date, payment type, and status\n- Page metadata includes: totalResults, currentPage, skipped, pageSize\n\n**Note:** This endpoint returns ALL payments across all your cases. To get payments for a specific case, use GET /cases/{id}/payments instead.",
"parameters": [
{
"name": "Page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 1
}
},
{
"name": "PageSize",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 10
}
}
],
"responses": {
"200": {
"description": "Payments returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Payments.Dtos.PaymentListApiDTO"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Payments.Dtos.PaymentListApiDTO"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Payments.Dtos.PaymentListApiDTO"
}
}
}
},
"400": {
"description": "Invalid pagination parameters",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/Payments/{id}": {
"get": {
"tags": [
"Payments"
],
"summary": "Fetch payment by ID",
"description": "Returns payment details for the supplied payment ID.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Payment found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto"
}
}
}
},
"400": {
"description": "ID missing or empty",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Payment not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/tasks": {
"get": {
"tags": [
"Tasks"
],
"summary": "List your open tasks",
"description": "Returns a paginated, account-wide list of every task (action-item) your account currently has β across ALL cases, not just one. Use GET /cases/{id}/tasks instead to scope this to a single case.\n\n**What is a task?**\nA task is something the platform needs YOU to do before a case can proceed β e.g. reply to a chat message, sign a contract, or assign a bank account for payouts. Tasks auto-resolve when the underlying condition clears (for example, once you reply to the case's chat, the ReplyToChat task disappears on its own) β this is a live work queue, not an append-only log. Poll it, don't assume a task you've seen before is still open.\n\n**Every task has a solutionUrl** β an absolute link, identical to the one used inside the Creditor app itself, that a human can open to resolve the task in one click, no matter the task type.\n\n**Some tasks also have an `action`** β a machine-readable hint pointing at the exact existing API call that resolves the task directly, with no human required. Today that's the chat-driven cluster (ReplyToChat, ClientInputRequired, MoreInfoNeeded) β post a message via POST /cases/{caseId}/chats and the task resolves itself once the case leaves its needs-info state. Tasks without an action are `action: null` β resolve those via solutionUrl.\n\n**Filtering:**\n- status (default: Open) β Open or Solved\n- type (repeatable, e.g. ?type=ReplyToChat&type=SignContract) β restrict to specific task types\n\n**Pagination:**\n- Page (default: 1), PageSize (default: 10, max: 100)",
"parameters": [
{
"name": "status",
"in": "query",
"schema": {
"type": "string",
"default": "Open"
}
},
{
"name": "type",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "Page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 1
}
},
{
"name": "PageSize",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 10
}
}
],
"responses": {
"200": {
"description": "Tasks returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskListDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskListDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskListDto"
}
}
}
},
"400": {
"description": "Invalid status, type, or pagination parameters",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/test/cases/{id}/advance": {
"post": {
"tags": [
"TestCases"
],
"summary": "Advance a test case to a known lifecycle state.",
"description": "Drives a test case to a well-known lifecycle state in a single call.\n\n**Purpose:**\nEnables CI pipelines and integrators to exercise the full collection lifecycle β including real webhooks and events β without manual intervention.\n\n**Target States:**\n- `Active` β Activates the case from PendingVerification or PendingVerificationInternal. No-op if already Active or Closed.\n- `Closed:Paid` β Records a payment for `amount` and closes the case as Paid. Activates the case first if needed. `amount` is required.\n- `Closed:NoPayment` β Closes the case with PreLegalExhaustedNoPayment. Activates the case first if needed.\n\n**Guards:**\n- Returns 400 if the case is not a test case (Classification != Test).\n- Returns 400 if `amount` is missing when `to` is `Closed:Paid`.\n- Returns 400 if `to` is not one of the valid values.\n- Returns 400 if the case is already closed with a different close code (e.g. already Closed:NoPayment when requesting Closed:Paid).\n- Returns 404 if the case is not found or not owned by the calling creditor.\n\n**No-op behaviour:**\nIf the case is already at the requested state, the call returns 200 with `advanced: false` and the current state β no changes are made.\n\n**Webhooks:**\nTransitions use the real internal service pipeline. Webhook delivery per target:\n\n- `β Active`: fires `case.updated` to Creditor subscriptions.\n- `β Closed:Paid`: fires `payment.created` and `case.updated` and `case.closed` to Creditor subscriptions.\n- `β Closed:NoPayment`: fires `case.updated` and `case.closed` to Creditor subscriptions.\n\nAll events carry `classification: test` and are only delivered to webhook subscriptions registered with `classification: test`.\n\n**How to Test:**\n\n1. **Create a test case** β `POST /cases` with `isTest: true` and `tag: suite-run-{uuid}`. Note the returned `id`.\n\n2. **Register a test webhook subscription** β subscribe to the events you want to assert on (`case.updated`, `payment.created`, `case.closed`) with `classification: test` and point the URL to your test receiver (e.g. a local ngrok tunnel or a CI webhook sink).\n\n3. **Advance to Active** β `POST /test/cases/{id}/advance` with `{ \"to\": \"Active\" }`. Expect `{ advanced: true, state: \"Active\" }` and a `case.updated` event on your Creditor subscription.\n\n4. **Advance to Closed:Paid** β `POST /test/cases/{id}/advance` with `{ \"to\": \"Closed:Paid\", \"amount\": 1000.00 }`. Expect `{ advanced: true, state: \"Closed:Paid\" }` and a `payment.created` event on your Creditor subscription.\n\n5. **Verify final state** β `GET /cases/{id}` and assert `lifecycle: Closed` and `closeCode: Paid`.\n\n6. **Test no-op** β Call the same advance again. Expect `{ advanced: false, state: \"Closed:Paid\" }` and no new webhook events.\n\n7. **Test mismatch error** β With the case closed as Paid, call `{ \"to\": \"Closed:NoPayment\" }`. Expect 400 with a message describing the conflict.\n\n8. **Assert webhooks** β `GET /webhooks/events?caseId={id}` to verify which events fired.\n\n9. **Reset between runs** β `DELETE /test/cases?tag=suite-run-{uuid}` to clean up all cases created in this run.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.AdvanceTestCaseRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.AdvanceTestCaseRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.AdvanceTestCaseRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.AdvanceTestCaseRequest"
}
}
}
},
"responses": {
"200": {
"description": "Advance result (advanced=true if state changed, advanced=false if already there)",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.AdvanceTestCaseResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.AdvanceTestCaseResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.AdvanceTestCaseResponse"
}
}
}
},
"400": {
"description": "Validation error β non-test case, missing amount, or unknown target state"
},
"404": {
"description": "Case not found or not owned by this creditor"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/test/cases/{id}": {
"delete": {
"tags": [
"TestCases"
],
"summary": "Hard-delete a single test case by ID.",
"description": "Permanently removes a test case and all its child entities (payments, chats, files, timeline entries, webhook delivery records) from the database.\n\n**This is a hard-delete.** The row is removed entirely β there is no soft-delete or recovery path. This is intentional for CI environments that create many test cases per day.\n\n**Guards:**\n- Returns 400 if the case is classified as Production. Only Test cases may be deleted via this endpoint.\n- Returns 404 if the case is not found or not owned by the calling creditor.\n\n**Idempotent:** Returns 204 even if the case is already deleted (no-op).",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"204": {
"description": "Case deleted (or already absent β idempotent)"
},
"400": {
"description": "Case is a Production case β deletion rejected"
},
"404": {
"description": "Case not found or not owned by this creditor"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/test/cases": {
"delete": {
"tags": [
"TestCases"
],
"summary": "Hard-delete all test cases with the given tag.",
"description": "Permanently removes all test cases created with the specified tag (and all their child entities) from the database.\n\n**Scoped cleanup:** Each CI pipeline run should create cases with a unique tag (e.g. `suite-run-{uuid}`) and use this endpoint at the end of the run to clean up, without affecting cases from parallel pipeline runs.\n\n**This is a hard-delete.** Rows are removed entirely with no recovery path. This is intentional for CI environments.\n\n**Guards:**\n- Returns 400 if any matched case is classified as Production. The entire operation is rejected and nothing is deleted.\n- Returns 400 if the tag query parameter is missing or blank.\n\n**Idempotent:** Returns 204 even if no cases match the tag β no error is raised.",
"parameters": [
{
"name": "tag",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "Cases deleted (or none matched β idempotent, no response body)"
},
"400": {
"description": "Tag is missing/blank, or matched cases include a Production case"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/test/webhooks/fire": {
"post": {
"tags": [
"TestWebhooks"
],
"summary": "Fire a named webhook event type for a test case.",
"description": "Fires a real current-state webhook event for any registered Customer API event type against a test case β even if the case hasn't naturally reached the state that would produce that event.\n\n**Purpose:**\nUnblocks testing webhook handlers for rare or hard-to-reach event types (e.g. `case.closed`, `chat.created`) without having to drive the case through its full lifecycle.\n\n**Payload:**\nThe event carries the real current state of the case β fields are read from the case as it exists now. No payload fabrication or override is supported in this version.\n\n**Event types:**\n- `case.created` β current lifecycle (use after case creation, or to re-test your handler)\n- `case.updated` β current lifecycle (oldLifecycle and newLifecycle both reflect current state)\n- `case.closed` β current close code and comment (use after case is already closed, or to test your handler regardless)\n- `payment.created` β most recent payment on the case (returns 422 if no payments exist)\n- `payment.deleted` β most recently deleted payment on the case (returns 422 if no payments have been deleted)\n- `chat.created` β most recent chat message on the case (returns 422 if no chats exist)\n\n**Target subscriptions:**\n- If `subscriptionId` is provided, fires only to that subscription. Returns 400 if the subscription is not found, not a test subscription, or not owned by this creditor.\n- If omitted, fires to all active test subscriptions registered for the given event type.\n\n**Event log (asynchronous):**\nThe synthetic fire is enqueued into the normal delivery pipeline, exactly like a real dispatch. A successful response (and its `enqueuedCount`) confirms the event was queued β it does **not** mean a row already exists in the webhook event log. The `WebhookEvent` row appears in `GET /webhooks/events` only after the worker drains the queue and attempts delivery β usually within a few seconds, but allow up to ~30 seconds, as the queue drain can lag under load. Do not assume the row is present the instant this call returns: poll `GET /webhooks/events?caseId={id}` with a short backoff until the event appears (or a ~30s timeout elapses) rather than reading it once immediately.\n\n**Guards:**\n- Returns 400 if the case is not a test case (`classification != test`), the event type is not valid, or the subscription is not found/not owned.\n- Returns 404 if the case is not found or not owned by this creditor.\n- Returns 422 if required data is missing (e.g. no payments for `payment.created`, no chats for `chat.created`).",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.FireWebhookRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.FireWebhookRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.FireWebhookRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.FireWebhookRequest"
}
}
}
},
"responses": {
"200": {
"description": "Event fired β delivery jobs enqueued",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.FireWebhookResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.FireWebhookResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.FireWebhookResponse"
}
}
}
},
"400": {
"description": "Validation error β non-test case, invalid event type, or subscription not found"
},
"404": {
"description": "Case not found or not owned by this creditor"
},
"422": {
"description": "Required data missing (e.g. no payments for payment.created)"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/users": {
"get": {
"tags": [
"Users"
],
"summary": "Lists team members belonging to the authenticated creditor.",
"description": "Returns a paginated list of users belonging to the authenticated creditor's team.\n\n**Use Case:**\nUse this endpoint to retrieve valid user IDs for the `userId` field when sending a chat message via `POST /cases/{id}/chats`.\n\n**Pagination:**\n- `page` (default: 1) β Page number, starting from 1\n- `pageSize` (default: 50, max: 100) β Number of results per page\n\n**Response:**\nEach user entry includes:\n- `id` (Guid) β Use this as `userId` in `POST /cases/{id}/chats`\n- `name` β Full name of the team member\n- `email` β Email address of the team member",
"parameters": [
{
"name": "Page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"name": "PageSize",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "Paginated list of team members returned",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Users.UserListDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Users.UserListDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Users.UserListDto"
}
}
}
},
"400": {
"description": "Invalid pagination parameters",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
}
}
},
"401": {
"description": "Missing or invalid API key",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
}
}
}
}
}
},
"/webhooks/events": {
"get": {
"tags": [
"WebhookEvents"
],
"summary": "List webhook events dispatched for a case.",
"description": "Returns all webhook events dispatched for the given case, scoped to your webhook subscriptions.\nResults are ordered newest-first.\n\n**Use cases:**\n- Verify that a specific event (e.g. `case.updated`) fired after a state transition.\n- Inspect the exact payload delivered on each attempt.\n- Find the event ID to replay via `POST /webhooks/events/{id}/replay`.\n\n**Filtering:**\n- `caseId` (required): restricts to events for this case.\n- `since` (optional): only returns events created at or after this ISO 8601 timestamp.\n\n**Note:** Only events for your subscriptions are returned β events from other creditors' subscriptions are never exposed.",
"parameters": [
{
"name": "caseId",
"in": "query",
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "since",
"in": "query",
"schema": {
"type": "string",
"format": "date-time"
}
}
],
"responses": {
"200": {
"description": "List of webhook events",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.WebhookEventDto"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.WebhookEventDto"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.WebhookEventDto"
}
}
}
}
},
"400": {
"description": "Missing or invalid query parameters"
}
}
}
},
"/webhooks/events/{id}/replay": {
"post": {
"tags": [
"WebhookEvents"
],
"summary": "Replay a specific webhook event.",
"description": "Re-enqueues the exact payload from a previously recorded event to its original subscription.\n\nThe event is re-queued as a fresh delivery attempt (attempt 1) using the original payload unchanged.\nDelivery follows the normal retry schedule if the endpoint is unavailable.\n\n**Replay signal:** Replayed deliveries include the header `X-Debitura-Replay: true` so your endpoint can distinguish a replay from a live event and implement idempotency correctly.\n\n**When to use:**\n- Your endpoint was temporarily unavailable and you want to re-deliver a specific event.\n- You want to test idempotency of your event handler.\n- Part of CI-loop ASSERT: confirm an event was dispatched, then replay to a different receiver.\n\n**Tenant isolation:** Only events belonging to your own subscriptions can be replayed.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Event re-enqueued for delivery",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayEventResultDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayEventResultDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayEventResultDto"
}
}
}
},
"404": {
"description": "Event not found or not owned by this creditor"
}
}
}
},
"/webhooks": {
"post": {
"tags": [
"Webhooks"
],
"summary": "Create a new webhook subscription.",
"description": "Creates a new webhook subscription for receiving real-time event notifications.\n\n**Available Events:**\n- `case.created` - New collection case created\n- `case.updated` - Case lifecycle changed (e.g., Active β Paused). Does not cover engagement phase\n changes (Pre-legal/Legal/Enforcement) β poll `GET /cases/{id}` or `GET /cases/{id}/timeline` for\n the current phase; there is no phase-change event today.\n- `case.closed` - Case closed\n- `payment.created` - Payment registered on case\n- `payment.deleted` - Payment reversed (deleted) on case\n- `chat.created` - Chat message created on case\n\n**Validation Rules:**\n- URL must be HTTPS\n- events array must contain only valid event types\n- URL must be publicly reachable\n- Private IP addresses are blocked (SSRF protection)\n\n**Returns:**\n- Webhook subscription details\n- Secret key for HMAC-SHA256 signature verification (shown only once)\n\n**IMPORTANT**: Save the secret immediately - it cannot be retrieved later.\n\n**Webhook Payload Structure:**\nEvery webhook delivery will contain these headers:\n- X-Debitura-Signature: HMAC-SHA256 signature (format: t={timestamp},v1={signature})\n- X-Debitura-Timestamp: Unix timestamp of the event\n- X-Debitura-Event: Event type (e.g., 'case.created')\n\n**Signature Verification (HMAC-SHA256):**\n1. Extract timestamp (t) and signature (v1) from X-Debitura-Signature header\n2. Construct signed payload: {timestamp}.{json_body}\n3. Compute HMAC-SHA256 using your webhook secret (Base64 decoded)\n4. Compare computed signature with v1 value (use constant-time comparison)\n5. Verify timestamp is within 5 minutes to prevent replay attacks\n\n**Example Payload:**\n```json\n{\n \"id\": \"evt_abc123\",\n \"event\": \"case.created\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"data\": {\n \"caseId\": \"guid-here\",\n \"reference\": \"Q8OAXF3W\",\n \"creditorReference\": \"INV-001\",\n \"status\": \"Active\",\n \"amount\": 1000.00,\n \"currency\": \"EUR\",\n \"debtorName\": \"Debtor Company Ltd\"\n }\n}\n```",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.CreateWebhookRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.CreateWebhookRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.CreateWebhookRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.CreateWebhookRequest"
}
}
}
},
"responses": {
"201": {
"description": "Webhook created successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"422": {
"description": "Business rule violation",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"get": {
"tags": [
"Webhooks"
],
"summary": "List all webhook subscriptions for the authenticated creditor.",
"description": "Returns all webhook subscriptions for the authenticated creditor. Secrets are never returned in list operations.",
"responses": {
"200": {
"description": "List of webhook subscriptions",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
}
}
}
}
}
}
},
"/webhooks/{id}": {
"get": {
"tags": [
"Webhooks"
],
"summary": "Get a single webhook subscription by ID.",
"description": "Returns details of a specific webhook subscription. Secret is never returned in this operation.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Webhook subscription found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
}
}
},
"404": {
"description": "Webhook not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"patch": {
"tags": [
"Webhooks"
],
"summary": "Update an existing webhook subscription.",
"description": "Partially updates an existing webhook subscription using HTTP PATCH.\n\nSupported Updates:\n- Change the webhook URL\n- Enable or disable the subscription\n- Regenerate the secret key\n\nNote: Event types cannot be changed after creation. To update event types, delete and recreate the subscription.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.UpdateWebhookRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.UpdateWebhookRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.UpdateWebhookRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.UpdateWebhookRequest"
}
}
}
},
"responses": {
"200": {
"description": "Webhook updated successfully",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Webhooks.Dtos.WebhookDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Webhook not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
},
"delete": {
"tags": [
"Webhooks"
],
"summary": "Delete a webhook subscription.",
"description": "Deletes a webhook subscription. This operation is permanent.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"204": {
"description": "Webhook deleted successfully"
},
"404": {
"description": "Webhook not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/webhooks/{id}/test": {
"post": {
"tags": [
"Webhooks"
],
"summary": "Send a test event to the webhook endpoint.",
"description": "Sends a synthetic case.created test event to the webhook endpoint.\n\nThis is useful for:\n- Verifying the webhook URL is reachable\n- Testing your webhook endpoint implementation\n- Validating signature verification\n\nThe test payload will be a realistic case.created event with synthetic data.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Test completed",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.TestResultDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.TestResultDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.TestResultDto"
}
}
}
},
"404": {
"description": "Webhook not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/webhooks/{id}:test": {
"post": {
"tags": [
"Webhooks"
],
"summary": "Send a test event to the webhook endpoint.",
"description": "Sends a synthetic case.created test event to the webhook endpoint.\n\nThis is useful for:\n- Verifying the webhook URL is reachable\n- Testing your webhook endpoint implementation\n- Validating signature verification\n\nThe test payload will be a realistic case.created event with synthetic data.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Test completed",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.TestResultDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.TestResultDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.TestResultDto"
}
}
}
},
"404": {
"description": "Webhook not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
}
}
},
"/webhooks/{id}/replay": {
"post": {
"tags": [
"Webhooks"
],
"summary": "[Deprecated] This endpoint is misnamed and does not actually replay events.\nUse `GET /webhooks/events?caseId={id}` to inspect delivery history,\nthen `POST /webhooks/events/{eventId}/replay` to re-deliver a specific event.",
"description": "This endpoint was never fully implemented β it counts cases created\nsince `sinceUtc` and returns the count as `eventsReplayed`, but does not\nre-enqueue or redeliver any events. The name \"replay\" collides with the real\n`POST /webhooks/events/{eventId}/replay` endpoint which actually re-delivers.\n \nThis endpoint is kept for backward compatibility (additive-only rule) but is deprecated.\nIntegrators should migrate to the event-log + replay-by-id pattern described above.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "Count of cases since sinceUtc (not events replayed)",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayResultDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayResultDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayResultDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Webhook not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
},
"deprecated": true
}
},
"/webhooks/{id}:replay": {
"post": {
"tags": [
"Webhooks"
],
"summary": "[Deprecated] This endpoint is misnamed and does not actually replay events.\nUse `GET /webhooks/events?caseId={id}` to inspect delivery history,\nthen `POST /webhooks/events/{eventId}/replay` to re-deliver a specific event.",
"description": "This endpoint was never fully implemented β it counts cases created\nsince `sinceUtc` and returns the count as `eventsReplayed`, but does not\nre-enqueue or redeliver any events. The name \"replay\" collides with the real\n`POST /webhooks/events/{eventId}/replay` endpoint which actually re-delivers.\n \nThis endpoint is kept for backward compatibility (additive-only rule) but is deprecated.\nIntegrators should migrate to the event-log + replay-by-id pattern described above.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "Count of cases since sinceUtc (not events replayed)",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayResultDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayResultDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayResultDto"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
},
"404": {
"description": "Webhook not found",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto"
}
}
}
}
},
"deprecated": true
}
}
},
"components": {
"schemas": {
"Debitura.Domain.Model.Base.PageData": {
"type": "object",
"properties": {
"totalResults": {
"type": "integer",
"format": "int32"
},
"pageSize": {
"type": "integer",
"format": "int32"
},
"currentPage": {
"type": "integer",
"format": "int32"
},
"responseCount": {
"type": "integer",
"format": "int32"
},
"totalPages": {
"type": "integer",
"format": "int32",
"readOnly": true
}
},
"additionalProperties": false
},
"Debitura.Domain.Model.CollectionPartnerLogics.CollectionPartners.SurveyCadenceMode": {
"enum": [
0,
1
],
"type": "integer",
"format": "int32"
},
"Debitura.Domain.Model.CommunicationCenter.Chats.ChatRole": {
"enum": [
0,
1,
2
],
"type": "integer",
"format": "int32"
},
"Debitura.Domain.Model.Webhooks.Dtos.CreateWebhookRequest": {
"required": [
"events",
"url"
],
"type": "object",
"properties": {
"url": {
"maxLength": 1024,
"minLength": 0,
"type": "string",
"format": "uri"
},
"events": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
},
"isTestMode": {
"type": "boolean"
}
},
"additionalProperties": false
},
"Debitura.Domain.Model.Webhooks.Dtos.UpdateWebhookRequest": {
"type": "object",
"properties": {
"url": {
"maxLength": 1024,
"minLength": 0,
"type": "string",
"format": "uri",
"nullable": true
},
"events": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"isActive": {
"type": "boolean",
"nullable": true
},
"regenerateSecret": {
"type": "boolean"
},
"isTestMode": {
"type": "boolean",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Domain.Model.Webhooks.Dtos.WebhookDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"url": {
"type": "string",
"nullable": true
},
"events": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"isActive": {
"type": "boolean"
},
"createdUtc": {
"type": "string",
"format": "date-time"
},
"updatedUtc": {
"type": "string",
"format": "date-time"
},
"disabledReason": {
"type": "string",
"nullable": true
},
"secret": {
"type": "string",
"nullable": true
},
"isTestMode": {
"type": "boolean"
}
},
"additionalProperties": false
},
"Debitura.Domain.Services.CaseValidation.CaseValidationItemDto": {
"type": "object",
"properties": {
"resolutionArea": {
"type": "string",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Domain.Services.CaseValidation.CaseValidationLeanDto": {
"type": "object",
"properties": {
"needsInfo": {
"type": "boolean"
}
},
"additionalProperties": false
},
"Debitura.Domain.Services.CaseValidation.CaseValidationStatusDto": {
"type": "object",
"properties": {
"needsInfo": {
"type": "boolean"
},
"creditorRespondedAt": {
"type": "string",
"format": "date-time",
"nullable": true
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Domain.Services.CaseValidation.CaseValidationItemDto"
},
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.AdvanceTestCaseResponse": {
"type": "object",
"properties": {
"advanced": {
"type": "boolean",
"description": "True if the case was advanced in this call; false if it was already at or past the target state (no-op)."
},
"state": {
"type": "string",
"description": "The current state of the case after this call.\nOne of: \"Active\", \"Closed:Paid\", \"Closed:NoPayment\", \"Closed\" (for other close codes).",
"nullable": true
}
},
"additionalProperties": false,
"description": "Response from POST /test/cases/{id}/advance."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.AssignedUserDto": {
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "The assigned user's email address.",
"nullable": true
},
"name": {
"type": "string",
"description": "The assigned user's full name.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Represents the creditor team member assigned to a case."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.BankAccountDto": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Bank account identifier",
"format": "int32"
},
"label": {
"type": "string",
"description": "User-friendly label (e.g., \"Main EUR Account\")",
"nullable": true
},
"scheme": {
"type": "string",
"description": "Account scheme: IBAN, SWIFT, or LOCAL",
"nullable": true
},
"currencyCode": {
"type": "string",
"description": "Currency code (ISO 4217)",
"nullable": true
},
"bankCountryCode": {
"type": "string",
"description": "Bank country code (ISO Alpha-2)",
"nullable": true
},
"accountHolderName": {
"type": "string",
"description": "Account holder name (beneficiary)",
"nullable": true
},
"iban": {
"type": "string",
"description": "IBAN (for IBAN scheme accounts)",
"nullable": true
},
"bic": {
"type": "string",
"description": "BIC/SWIFT code (for IBAN and SWIFT scheme accounts)",
"nullable": true
},
"accountNumber": {
"type": "string",
"description": "Account number (for SWIFT and LOCAL scheme accounts)",
"nullable": true
},
"localIdentifier": {
"type": "string",
"description": "Local identifier (for LOCAL scheme accounts, e.g., sort code + account number)",
"nullable": true
},
"localIdentifierType": {
"type": "string",
"description": "Type of local identifier (e.g., \"Sort Code\", \"Routing Number\")",
"nullable": true
},
"bankName": {
"type": "string",
"description": "Bank name (optional)",
"nullable": true
},
"bankAddress": {
"type": "string",
"description": "Bank address (optional)",
"nullable": true
},
"bankCity": {
"type": "string",
"description": "Bank city (optional)",
"nullable": true
},
"bankZipCode": {
"type": "string",
"description": "Bank zip/postal code (optional)",
"nullable": true
},
"bankState": {
"type": "string",
"description": "Bank state/region (optional)",
"nullable": true
}
},
"additionalProperties": false,
"description": "Bank account information for partner API.\nFull details provided as partners need this to:\n1. Provide payment instructions to debtors (when debtor pays client directly)\n2. Execute payouts to clients (when partner receives payment and pays out remainder)"
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorApiDTO": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The type of business error (e.g., \"MissingDebtCollectionContract\", \"MissingPowerOfAttorney\", \"NoPartnerAvailable\").",
"nullable": true
},
"message": {
"type": "string",
"description": "A human-readable description of the error.",
"nullable": true
},
"solutionUrl": {
"type": "string",
"description": "A URL where the user can resolve this specific error (e.g., sign a contract).\n \n\nPartners who want a single URL that walks the user through every pending\nsigning in one chain β instead of forwarding one URL per\n`BusinessErrorApiDTO` β should use\nDebitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorResponseApiDTO.SigningHandoff's `CombinedSigningUrl`.\nThe two are complementary: `SolutionUrl` is granular per-error;\n`CombinedSigningUrl` is the chain-walking alternative for signing-related errors.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Represents a business error in the API response."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorResponseApiDTO": {
"type": "object",
"properties": {
"businessErrors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorApiDTO"
},
"description": "List of business errors that must be resolved before the case can be created.",
"nullable": true
},
"signingHandoff": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.SigningHandoffDto"
}
},
"additionalProperties": false,
"description": "Response returned when business rule violations prevent case creation."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseContractStatusApiDTO": {
"type": "object",
"properties": {
"sdca": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.ContractItemDto"
},
"poa": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.ContractItemDto"
},
"pricingAppendix": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.ContractItemDto"
},
"collectionPartnerName": {
"type": "string",
"description": "Name of the assigned collection partner, if any.",
"nullable": true
},
"needsPoaSigning": {
"type": "boolean",
"description": "Whether the creditor needs to sign (or re-sign) a Power of Attorney.\nTrue when: POA is missing or stale, OR the debtor's country has an active jurisdiction pricing zone\nand the Jurisdiction Pricing Appendix (presented as POA) is missing or stale."
}
},
"additionalProperties": false,
"description": "Contract signing status for a case, showing SDCA and PoA status with signing URLs."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.CaseTimelineResponse": {
"required": [
"items"
],
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.TimelineItemDto"
},
"description": "Chronological list of events on the case.",
"nullable": true
},
"currentEngagementPhase": {
"type": "string",
"description": "The current engagement phase of the case, sourced from CaseEngagement.CurrentPhase.\nPossible values: \"Pre-legal\", \"Legal\", \"Enforcement\".\nNull when no active engagement exists (e.g. case not yet assigned to a partner).",
"nullable": true
}
},
"additionalProperties": false,
"description": "Response envelope for GET /cases/{id}/timeline.\nWraps the chronological event list with case-level context\nthat cannot be expressed as a single timeline entry."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.CollectionPartnerDto": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true
},
"officeEmail": {
"type": "string",
"nullable": true
},
"officePhone": {
"type": "string",
"nullable": true
},
"publicSite": {
"type": "string",
"nullable": true
},
"surveyCadenceMode": {
"$ref": "#/components/schemas/Debitura.Domain.Model.CollectionPartnerLogics.CollectionPartners.SurveyCadenceMode"
}
},
"additionalProperties": false,
"description": "V1 Collection Partner DTO for external partner APIs"
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.ContractItemDto": {
"type": "object",
"properties": {
"signed": {
"type": "boolean",
"description": "Whether the contract has been signed."
},
"requiresResigning": {
"type": "boolean",
"description": "Whether the contract needs to be re-signed (e.g., due to contract template updates)."
},
"solutionUrl": {
"type": "string",
"description": "URL where the creditor can sign or re-sign the contract.\nNull if the contract is signed and current.\nThe URL is context-aware: referral partner tokens get referral onboarding URLs,\nregular API keys get standard creditor app URLs.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Status of an individual contract (SDCA, PoA, or Pricing Appendix)."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.CreditorDivisionDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the division",
"format": "uuid"
},
"name": {
"type": "string",
"description": "Name of the division",
"nullable": true
}
},
"additionalProperties": false,
"description": "Creditor division information for external partner APIs.\nRepresents a specific division or department within a creditor organization."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.CreditorDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the creditor",
"format": "uuid"
},
"companyName": {
"type": "string",
"description": "Company name of the creditor",
"nullable": true
},
"companyRegistrationNumber": {
"type": "string",
"description": "Company registration number (CVR, VAT number, etc.)",
"nullable": true
},
"officeEmail": {
"type": "string",
"description": "Primary office email address",
"nullable": true
},
"officePhone": {
"type": "string",
"description": "Primary office phone number",
"nullable": true
},
"address": {
"type": "string",
"description": "Street address",
"nullable": true
},
"city": {
"type": "string",
"description": "City",
"nullable": true
},
"zipCode": {
"type": "string",
"description": "Postal/ZIP code",
"nullable": true
},
"state": {
"type": "string",
"description": "State or region (if applicable)",
"nullable": true
},
"country": {
"type": "string",
"description": "Country name",
"nullable": true
},
"division": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CreditorDivisionDto"
}
},
"additionalProperties": false,
"description": "Creditor (client) information for external partner APIs.\nRepresents the party that the debtor owes money to."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.DebtorDto": {
"required": [
"name",
"type"
],
"type": "object",
"properties": {
"type": {
"minLength": 1,
"type": "string",
"description": "Debtor type. Valid values: \"Company\" or \"Person\"",
"example": "Company"
},
"name": {
"minLength": 1,
"type": "string",
"description": "Debtor name (company name or person's full name)",
"example": "Pacific Trading LLC"
},
"contactPerson": {
"type": "string",
"description": "Contact person at the company (required for companies, not used for persons)",
"nullable": true,
"example": "John Smith"
},
"companyRegistrationNumber": {
"type": "string",
"description": "Company registration number (VAT number, CVR, org number, etc.)",
"nullable": true,
"example": "47-1234567"
},
"address": {
"type": "string",
"description": "Street address",
"nullable": true,
"example": "123 Market Street, Suite 400"
},
"zipCode": {
"type": "string",
"description": "Postal/ZIP code",
"nullable": true,
"example": "94105"
},
"city": {
"type": "string",
"description": "City name",
"nullable": true,
"example": "San Francisco"
},
"state": {
"type": "string",
"description": "State/region/province name",
"nullable": true,
"example": "California"
},
"stateAlpha2": {
"type": "string",
"description": "US state: two-letter code (e.g., \"CA\"), ISO 3166-2 format (e.g., \"US-CA\"), or full name (e.g., \"California\")",
"nullable": true,
"example": "CA"
},
"countryAlpha2": {
"type": "string",
"description": "Country code (ISO 3166-1 alpha-2 format)",
"nullable": true,
"example": "US"
},
"country": {
"type": "string",
"description": "Country name",
"nullable": true,
"example": "United States"
},
"email": {
"type": "string",
"description": "Email address for debtor contact",
"nullable": true,
"example": "accounts@pacifictrading.com"
},
"phone": {
"type": "string",
"description": "Phone number (include country code)",
"nullable": true,
"example": "+1 415 555 0123"
}
},
"additionalProperties": false,
"description": "V1 Debtor DTO for external partner APIs.\nThe debtor is the party that owes the debt."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.ExclusivePeriodDto": {
"type": "object",
"properties": {
"engagementStartDate": {
"type": "string",
"description": "Start date of the initial exclusivity engagement.",
"format": "date-time"
},
"currentEndDate": {
"type": "string",
"description": "Current end date of the exclusive period (after any extensions).",
"format": "date-time"
},
"daysRemaining": {
"type": "integer",
"description": "Days remaining until the period ends. Negative when the period has naturally expired.\nZero when the engagement was terminated early (partner change or withdrawal),\nregardless of the original end date.",
"format": "int32"
},
"status": {
"type": "string",
"description": "Current status of the exclusive period: Active, Expired, or Terminated.\nActive β partner has exclusive rights.\nExpired β period ended naturally (time elapsed or case resolved).\nTerminated β period was ended early (partner change, withdrawal, etc.).",
"nullable": true
},
"extensions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.ExclusivePeriodExtensionDto"
},
"description": "Each extension event that occurred within the current engagement, in chronological order.\nEmpty for cases that have never had an extension triggered.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Full exclusive collection period chain for a case.\nReturned by GET /cases/{id}/exclusive-period."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.ExclusivePeriodExtensionDto": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "What triggered this extension: PromiseToPay, PaymentAgreement, Payment, or Manual.",
"nullable": true
},
"eventDate": {
"type": "string",
"description": "When the extension period started (i.e. when the trigger event occurred).",
"format": "date-time"
},
"newEndDate": {
"type": "string",
"description": "The new period end date after this extension was applied.",
"format": "date-time"
}
},
"additionalProperties": false,
"description": "A single extension event in the exclusive period chain."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.FireWebhookResponse": {
"type": "object",
"properties": {
"eventType": {
"type": "string",
"description": "The event type that was fired (e.g. \"case.updated\").",
"nullable": true
},
"caseId": {
"type": "string",
"description": "The case ID the event was fired for.",
"format": "uuid"
},
"enqueuedCount": {
"type": "integer",
"description": "Number of webhook delivery jobs enqueued.\nZero means no active test subscriptions were found for this event type.",
"format": "int32"
}
},
"additionalProperties": false,
"description": "Result of the `POST /test/webhooks/fire` endpoint."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceAllocationOutstandingDto": {
"type": "object",
"properties": {
"principal": {
"type": "number",
"format": "double"
},
"interest": {
"type": "number",
"format": "double"
},
"reminderFees": {
"type": "number",
"format": "double"
},
"collectionFees": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false,
"description": "Additive external-API read model. Per-bucket outstanding on the debt ledger, produced by\nthe payment allocation engine (bucket total minus Ξ£ active stored allocations β never re-derived\nfrom a model). Mirrors the internal\n`Debitura.Domain.Model.Receiveables.InvoiceEconomics.EconomicalAllocationOutstanding` shape."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"dateCreated": {
"type": "string",
"format": "date-time"
},
"dateUpdated": {
"type": "string",
"format": "date-time",
"nullable": true
},
"reference": {
"type": "string",
"nullable": true
},
"creditorReference": {
"type": "string",
"nullable": true
},
"creditorComments": {
"type": "string",
"nullable": true
},
"claimDescription": {
"type": "string",
"nullable": true
},
"grossAmount": {
"type": "number",
"format": "double"
},
"remainder": {
"type": "number",
"format": "double"
},
"interestFees": {
"type": "number",
"format": "double"
},
"reminderFees": {
"type": "number",
"format": "double"
},
"collectionFees": {
"type": "number",
"format": "double"
},
"totalAddedFees": {
"type": "number",
"format": "double"
},
"currency": {
"type": "string",
"nullable": true
},
"isTestCase": {
"type": "boolean"
},
"lifecycle": {
"type": "string",
"nullable": true
},
"dueDate": {
"type": "string",
"format": "date-time"
},
"date": {
"type": "string",
"format": "date-time"
},
"dateFinished": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateCollectionStarted": {
"type": "string",
"format": "date-time",
"nullable": true
},
"closeCode": {
"type": "string",
"nullable": true
},
"currentEngagementPhase": {
"type": "string",
"description": "The current phase of the case's engagement: \"Pre-legal\", \"Legal\", or \"Enforcement\".\nA different axis from Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto.Lifecycle/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto.CloseCode β an Active case can be\nin any of the three phases.\n \nNull means \"no active engagement\" (e.g. lead / quoting / pre-contract-signing / unassigned, or\na data-consistency gap) β this is a distinct third state, NOT a synonym for Pre-legal. Most\ncases legitimately read Pre-legal; phase only leaves Pre-legal on legal/enforcement quote flows.\n \nNot guaranteed to be monotonic: an admin correction can move phase backwards (e.g. Legal back\nto Pre-legal).\n \nPersists after case closure β reflects the case's last-known engagement phase, not the current\nLifecycle. Note: this is a different field from a lead quote's own offered phase (the phase a\npartner's quote proposes to work the case at, if this case ever went through a quote flow) β\nthis field is the case-level phase of its actual engagement, not a quote's terms.",
"nullable": true
},
"claimType": {
"type": "string",
"description": "The type of claim for this case (e.g. \"Unpaid Invoice\", \"Loan Repayment\", \"Breach of Contract\").\nNull if not set.",
"nullable": true
},
"creditorDivisionId": {
"type": "string",
"format": "uuid",
"nullable": true
},
"debtor": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.DebtorDto"
},
"collectionPartner": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CollectionPartnerDto"
},
"creditor": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.CreditorDto"
},
"bankAccount": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.BankAccountDto"
},
"blendedAgeUpliftPoints": {
"type": "number",
"description": "MULTI-INVOICE AGE BUCKET PRICING\nCalculated blended age uplift percentage points (0-20) for multi-invoice cases.\nShows the additional fee percentage added due to invoice age.\nFormula: ((A12-A24)Γ10 + A24Γ20) / Total Principal\nNull for single-invoice cases (age uplift is calculated from due date instead).",
"format": "double",
"nullable": true
},
"preLegalSuccessFee": {
"type": "number",
"description": "PRE-LEGAL SUCCESS FEE\nThe total pre-legal success fee percentage for this case.\nIncludes base fee + age-based uplift (blended or single-invoice).\nNull if pricing has not been calculated yet or if case is not in pre-legal phase.\nExample: 20.5 represents 20.5% success fee.",
"format": "double",
"nullable": true
},
"solutionUrl": {
"type": "string",
"description": "When the case is created with allowPendingContracts=true and required contracts are unsigned,\nthis URL points to the signing page. Null when contracts are already signed or not applicable.",
"nullable": true,
"deprecated": true
},
"signingHandoff": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.SigningHandoffDto"
},
"exclusivePeriodEndDate": {
"type": "string",
"description": "The date the exclusive collection period ends (or ended).\nNull if no collection period has been created for this case (e.g. custom-terms cases).\nUse GET /cases/{id}/exclusive-period for the full chain including extensions.",
"format": "date-time",
"nullable": true
},
"disputeStatus": {
"type": "string",
"description": "Whether the claim is disputed by the debtor.\nReturns the description of Debitura.Domain.Model.Receiveables.Invoices.Enums.ClaimDisputeStatus:\n\"Yes, the claim is disputed\", \"No, the claim is not disputed\", or \"Don't Know\".\nNull when the dispute status has not been set on the case.",
"nullable": true
},
"validation": {
"$ref": "#/components/schemas/Debitura.Domain.Services.CaseValidation.CaseValidationLeanDto"
},
"assignedUser": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.AssignedUserDto"
},
"allocationOutstanding": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceAllocationOutstandingDto"
}
},
"additionalProperties": false,
"description": "V1 Invoice DTO for external partner APIs"
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceListDto": {
"required": [
"page"
],
"type": "object",
"properties": {
"page": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Base.PageData"
},
"cases": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.InvoiceDto"
},
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.JurisdictionDto": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Internal jurisdiction identifier.",
"format": "int32"
},
"name": {
"type": "string",
"description": "Display name of the jurisdiction (e.g., \"Denmark\", \"United States - California\").",
"nullable": true
},
"countryAlpha2": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code.",
"nullable": true
},
"stateAlpha2": {
"type": "string",
"description": "ISO 3166-2 state/region code (only for countries with state-level routing like the US).",
"nullable": true
}
},
"additionalProperties": false,
"description": "Geographic jurisdiction information for the case."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.PartnerAssignmentDto": {
"type": "object",
"properties": {
"collectionPartnerId": {
"type": "string",
"description": "Unique identifier for the collection partner.",
"format": "uuid"
},
"partnerName": {
"type": "string",
"description": "Display name of the collection partner company.",
"nullable": true
},
"partnerCountry": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code for the partner's primary country.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Information about the collection partner assigned to this case."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.PreviewCaseResponseApiViewModel": {
"type": "object",
"properties": {
"result": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.PreviewResultDto"
}
},
"additionalProperties": false,
"description": "Response from previewing a case, showing eligibility, partner assignment,\nrequired actions, and pricing estimates."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.PreviewResultDto": {
"type": "object",
"properties": {
"isEligible": {
"type": "boolean",
"description": "Whether the case is eligible for collection (i.e., a collection partner is available).\nIf false, check IneligibilityReason for details."
},
"ineligibilityReason": {
"type": "string",
"description": "Explanation of why the case is not eligible (only present when IsEligible = false).\nCommon reasons: \"We don't have an exclusive pre-legal partner in the provided jurisdiction.\"",
"nullable": true
},
"partnerAssignment": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.PartnerAssignmentDto"
},
"requiredActions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.RequiredActionDto"
},
"description": "List of actions required before the case can be submitted (e.g., sign contracts).\nEmpty if no actions are required.\nEach action includes a solution URL to complete the requirement.",
"nullable": true
},
"jurisdiction": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.JurisdictionDto"
},
"pricingPreview": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.PricingPreviewDto"
},
"requiresKycVerification": {
"type": "boolean",
"description": "Whether the resolved collection partner requires KYC verification before cases can be submitted.\nWhen true, the creditor must complete KYC verification before case creation will succeed."
},
"hasKycOnFile": {
"type": "boolean",
"description": "Whether the creditor already has KYC verification on file with Debitura.\nWhen RequiresKycVerification is true and HasKycOnFile is false, a MissingKycVerification\nrequired action will be present in the RequiredActions list."
},
"signingHandoff": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.SigningHandoffDto"
}
},
"additionalProperties": false,
"description": "Detailed preview result for a case submission."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.PricingPreviewDto": {
"type": "object",
"properties": {
"baseSuccessFeePercentage": {
"type": "number",
"description": "Base success fee percentage before age surcharges.\nThis is the standard rate for cases under 12 months overdue.",
"format": "double"
},
"ageSurchargePercentage": {
"type": "number",
"description": "Additional percentage points added for aged invoices.\nCalculated based on invoice age:\n- 12-24 months overdue: +8 percentage points\n- 24+ months overdue: +15 percentage points\n- Multi-invoice with mixed ages: blended rate (0-15 percentage points)",
"format": "double"
},
"totalSuccessFeePercentage": {
"type": "number",
"description": "Total success fee percentage (base + age surcharge).\nThis is the percentage of the recovered amount that will be charged as a success fee.",
"format": "double"
},
"currencyCode": {
"type": "string",
"description": "ISO 4217 currency code for the case.",
"nullable": true
},
"pricingSource": {
"type": "string",
"description": "Which pricing rule determined the fee.\nPossible values: \"Standard agreement\", \"Creditor custom pricing\",\n\"Managing partner custom pricing\", \"Jurisdiction custom pricing\",\n\"Partner custom pricing\", \"Accepted quote\".",
"nullable": true
},
"pricingSourceDescription": {
"type": "string",
"description": "Human-readable explanation of why this pricing was applied.\nExample: \"9.5% success fee β BD Legal custom collection rates (EU zone, $1,000β$7,999 tier)\"",
"nullable": true
}
},
"additionalProperties": false,
"description": "Estimated pricing for the case, including age-based surcharges."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.AdvanceTestCaseRequest": {
"required": [
"to"
],
"type": "object",
"properties": {
"to": {
"type": "string",
"description": "The target state to advance the case to.\nValid values: \"Active\", \"Closed:Paid\", \"Closed:NoPayment\"",
"nullable": true,
"example": "Active"
},
"amount": {
"type": "number",
"description": "Payment amount (required when To is \"Closed:Paid\").\nMust be a positive value in the case currency.",
"format": "double",
"nullable": true,
"example": 1500.00
}
},
"additionalProperties": false,
"description": "Request to advance a test case to a known lifecycle state."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.CreateCollectionCaseRequestApiViewModel": {
"required": [
"currencyCode"
],
"type": "object",
"properties": {
"currencyCode": {
"type": "string",
"nullable": true
},
"date": {
"type": "string",
"format": "date-time"
},
"dueDate": {
"type": "string",
"format": "date-time",
"nullable": true
},
"comments": {
"maxLength": 4000,
"type": "string",
"description": "Optional comments about the case, e.g. payment history or communication context.",
"nullable": true
},
"claimDescription": {
"maxLength": 4000,
"type": "string",
"description": "Client provided description of the claim",
"nullable": true
},
"creditorReference": {
"maxLength": 50,
"type": "string",
"nullable": true
},
"debtor": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.DebtorDto"
},
"creditorDivisionId": {
"type": "string",
"format": "uuid",
"nullable": true
},
"amountToRecover": {
"type": "number",
"description": "The TOTAL amount to recover for this case.\nThis represents the full principal amount across all invoices (if multiple invoices are bundled).\n \nFor multi-invoice cases with different ages, you can optionally provide age breakdown fields\n(AmountToRecoverOver12Months and AmountToRecoverOver24Months) to enable blended age-based pricing.\n \nIf age breakdown fields are omitted, age uplift will be calculated from the invoice due date (single-invoice pricing).",
"format": "double"
},
"amountToRecoverOver6Months": {
"type": "number",
"description": "OPTIONAL - MULTI-INVOICE AGE BUCKET PRICING (PRICING ZONE 180-DAY THRESHOLD)\n \nThe portion of AmountToRecover that is more than 6 months (180 days) overdue.\nThis includes amounts that are 12+ and 24+ months overdue.\n \nThis field is optional and can only be provided alongside AmountToRecoverOver12Months\nand AmountToRecoverOver24Months. It enables precise pricing tier selection based on\nthe 180-day threshold. When omitted, the system falls back to deriving the threshold\nfrom AmountToRecoverOver12Months.\n \nValidation rules:\n- Must be β€ AmountToRecover\n- Must be β₯ AmountToRecoverOver12Months",
"format": "double",
"nullable": true
},
"amountToRecoverOver12Months": {
"type": "number",
"description": "OPTIONAL - MULTI-INVOICE AGE BUCKET PRICING\n \nThe portion of AmountToRecover that is more than 12 months overdue.\nThis includes amounts that are 24+ months overdue.\n \nIf provided, AmountToRecoverOver24Months must also be provided.\nBoth fields must be provided together or both omitted.\n \nUsed to calculate blended age uplift for multi-invoice cases:\n- Amount under 12 months = AmountToRecover - AmountToRecoverOver12Months\n- Amount 12-24 months = AmountToRecoverOver12Months - AmountToRecoverOver24Months\n- Amount over 24 months = AmountToRecoverOver24Months\n \nBlended uplift formula: ((A12-A24)Γ10 + A24Γ20) / AmountToRecover\nwhere A12 = AmountToRecoverOver12Months, A24 = AmountToRecoverOver24Months\n \nValidation rules:\n- Must be β€ AmountToRecover\n- Must be β₯ AmountToRecoverOver24Months",
"format": "double",
"nullable": true
},
"amountToRecoverOver24Months": {
"type": "number",
"description": "OPTIONAL - MULTI-INVOICE AGE BUCKET PRICING\n \nThe portion of AmountToRecover that is more than 24 months overdue.\n \nIf provided, AmountToRecoverOver12Months must also be provided.\nBoth fields must be provided together or both omitted.\n \nUsed to calculate blended age uplift for multi-invoice cases.\nSee AmountToRecoverOver12Months for full details on the calculation.\n \nValidation rules:\n- Must be β€ AmountToRecoverOver12Months\n- Must be β€ AmountToRecover",
"format": "double",
"nullable": true
},
"skipDebituraVerification": {
"type": "boolean",
"description": "This skips the 'Pending verification' for Debitura and puts case straight to partner"
},
"skipCreationEmails": {
"type": "boolean",
"description": "Deprecated β this field is accepted for backwards compatibility but is ignored server-side.\nCreation emails are always suppressed; the hourly CasesStarted digest is the single\nnotification channel for all entry points.",
"deprecated": true
},
"allowPendingContracts": {
"type": "boolean",
"description": "When true, cases with unsigned contracts (SDCA/POA) are accepted in 'PendingContractSigning'\nstatus instead of being rejected with 422. The case transitions automatically once contracts are signed.\nDefault: false (unsigned contracts return 422)."
},
"isTest": {
"type": "boolean",
"description": "When true, creates a test case that IS persisted to the database but marked as test data.\nTest cases are excluded from production metrics and can be easily filtered or deleted.\nUse this for integration testing and development."
},
"tag": {
"maxLength": 100,
"type": "string",
"description": "Optional tag for scoped test data grouping (e.g. \"suite-run-{uuid}\").\nUse this to group test cases created by a single CI pipeline run so they can be\nbulk-deleted via DELETE /test/cases?tag={tag} without affecting parallel runs.\nOnly meaningful when IsTest is true. Max 100 characters.",
"nullable": true
},
"collectionPartnerId": {
"type": "string",
"description": "Optional: Specify a collection partner ID to handle this case.\nWhen provided, this partner will be used regardless of lead agent matching rules.\nThe partner must be active and have coverage for the debtor's jurisdiction.",
"format": "uuid",
"nullable": true
},
"assignedUserEmail": {
"maxLength": 320,
"type": "string",
"description": "Optional: Email address of the creditor team member to assign as the case owner.\nWhen provided, email notifications for this case will be sent only to this user\ninstead of all team members.\nMust correspond to an active member of your team.",
"format": "email",
"nullable": true,
"example": "john.doe@example.com"
},
"returnUrl": {
"maxLength": 2048,
"type": "string",
"description": "Optional: URL the creditor user should land on after completing any\npending signing chain (SDCA upgrade / PoA / JPA / KYC) on the\nDebitura Creditors app. Embedded, URL-encoded, into\n`BusinessErrorResponseApiDTO.SigningHandoff.CombinedSigningUrl`\n(on 422 with pending signings) and\n`InvoiceDto.SigningHandoff.CombinedSigningUrl` (on 200 when\n`AllowPendingContracts=true` with signings remaining).\n \nMust be an absolute http(s) URL. Values that fail validation\n(relative URLs, non-http schemes, header-injection characters) are\nsilently dropped β the combined URL is still emitted but without\nthe returnUrl query parameter, and the Creditors app falls back to\nits own safe in-app default landing.\n \nAdditive. Existing integrations\nthat omit this field see the same behaviour as before.",
"nullable": true
}
},
"additionalProperties": false,
"example": {
"currencyCode": "EUR",
"amountToRecover": 4000,
"date": "2026-02-22",
"dueDate": "2026-03-02",
"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": true,
"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"
}
}
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.FireWebhookRequest": {
"required": [
"caseId",
"event"
],
"type": "object",
"properties": {
"event": {
"type": "string",
"description": "The webhook event type to fire (e.g. \"case.updated\", \"payment.created\").\nMust be a valid event type for the calling API β refer to each API's documentation\nfor the supported list (Collection Partner and Customer API accept different sets).",
"nullable": true,
"example": "case.updated"
},
"caseId": {
"type": "string",
"description": "The ID of the test case to use as the event source.",
"format": "uuid",
"example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"subscriptionId": {
"type": "string",
"description": "Optional β the specific subscription ID to fire to.\nIf omitted, fires to all active test subscriptions for the calling API subscriber\nthat are registered for the given event type.",
"format": "uuid",
"nullable": true,
"example": "6b7a1f23-9c48-4e72-a901-1d2b3e4f5a6b"
}
},
"additionalProperties": false,
"description": "Request body for POST /test/webhooks/fire."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.PreviewCaseRequestApiViewModel": {
"required": [
"amountToRecover",
"currencyCode",
"debtor"
],
"type": "object",
"properties": {
"amountToRecover": {
"type": "number",
"description": "The TOTAL amount to recover for this case.\nThis represents the full principal amount across all invoices (if multiple invoices are bundled).\n \nFor multi-invoice cases with different ages, you can optionally provide age breakdown fields\n(AmountToRecoverOver12Months and AmountToRecoverOver24Months) to enable blended age-based pricing.\n \nIf age breakdown fields are omitted, the preview will show base pricing without age surcharge calculation.",
"format": "double"
},
"currencyCode": {
"maxLength": 3,
"minLength": 3,
"type": "string",
"description": "ISO 4217 currency code for the amount (e.g., \"DKK\", \"EUR\", \"USD\")"
},
"debtor": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.PreviewDebtorDto"
},
"amountToRecoverOver6Months": {
"type": "number",
"description": "OPTIONAL - MULTI-INVOICE AGE BUCKET PRICING (PRICING ZONE 180-DAY THRESHOLD)\n \nThe portion of AmountToRecover that is more than 6 months (180 days) overdue.\nThis includes amounts that are 12+ and 24+ months overdue.\n \nThis field is optional and can only be provided alongside AmountToRecoverOver12Months\nand AmountToRecoverOver24Months. It enables precise pricing tier selection based on\nthe 180-day threshold. When omitted, the system falls back to deriving the threshold\nfrom AmountToRecoverOver12Months.\n \nValidation rules:\n- Must be β€ AmountToRecover\n- Must be β₯ AmountToRecoverOver12Months",
"format": "double",
"nullable": true
},
"amountToRecoverOver12Months": {
"type": "number",
"description": "OPTIONAL - MULTI-INVOICE AGE BUCKET PRICING\n \nThe portion of AmountToRecover that is more than 12 months overdue.\nThis includes amounts that are 24+ months overdue.\n \nIf provided, AmountToRecoverOver24Months must also be provided.\nBoth fields must be provided together or both omitted.\n \nUsed to calculate blended age uplift for multi-invoice cases:\n- Amount under 12 months = AmountToRecover - AmountToRecoverOver12Months\n- Amount 12-24 months = AmountToRecoverOver12Months - AmountToRecoverOver24Months\n- Amount over 24 months = AmountToRecoverOver24Months\n \nBlended uplift formula: ((A12-A24)Γ10 + A24Γ20) / AmountToRecover\nwhere A12 = AmountToRecoverOver12Months, A24 = AmountToRecoverOver24Months\n \nValidation rules:\n- Must be β€ AmountToRecover\n- Must be β₯ AmountToRecoverOver24Months",
"format": "double",
"nullable": true
},
"amountToRecoverOver24Months": {
"type": "number",
"description": "OPTIONAL - MULTI-INVOICE AGE BUCKET PRICING\n \nThe portion of AmountToRecover that is more than 24 months overdue.\n \nIf provided, AmountToRecoverOver12Months must also be provided.\nBoth fields must be provided together or both omitted.\n \nUsed to calculate blended age uplift for multi-invoice cases.\nSee AmountToRecoverOver12Months for full details on the calculation.\n \nValidation rules:\n- Must be β€ AmountToRecoverOver12Months\n- Must be β€ AmountToRecover",
"format": "double",
"nullable": true
},
"dueDate": {
"type": "string",
"description": "Optional invoice due date. Mutually exclusive with age bucket fields.\nIf provided, Debitura computes the age surcharge internally β no need to calculate age buckets.\nCannot be a future date.",
"format": "date-time",
"nullable": true
},
"returnUrl": {
"maxLength": 2048,
"type": "string",
"description": "Optional: URL the creditor user should land on after completing any\npending signing chain (SDCA upgrade / PoA / JPA / KYC) on the\nDebitura Creditors app. Embedded, URL-encoded, into\n`PreviewCaseResponseApiViewModel.Result.SigningHandoff.CombinedSigningUrl`\n(when at least one signing-related required action is present) and into\n`BusinessErrorResponseApiDTO.SigningHandoff.CombinedSigningUrl` /\n`InvoiceDto.SigningHandoff.CombinedSigningUrl` on POST `/cases`.\n \nMust be an absolute http(s) URL. Values that fail validation\n(relative URLs, non-http schemes, header-injection characters) are\nsilently dropped β the combined URL is still emitted but without\nthe returnUrl query parameter, and the Creditors app falls back to\nits own safe in-app default landing.\n \nAdditive. Existing integrations\nthat omit this field see the same behaviour as before.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Request model for previewing case eligibility, partner assignment, and required actions\nbefore actually creating a collection case.\n \nThis endpoint allows you to check:\n- Whether a case would be eligible for collection (partner coverage available)\n- Which partner would be assigned\n- What documents need to be signed (SDCA, Power of Attorney)\n- Estimated pricing with age-based surcharges\n \nUse this to guide users through document signing before final case submission.",
"example": {
"amountToRecover": 50000,
"currencyCode": "USD",
"amountToRecoverOver12Months": 30000,
"amountToRecoverOver24Months": 15000,
"debtor": {
"type": "Company",
"countryAlpha2": "US",
"stateAlpha2": "CA"
}
}
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.Requests.PreviewDebtorDto": {
"required": [
"countryAlpha2",
"type"
],
"type": "object",
"properties": {
"type": {
"minLength": 1,
"type": "string",
"description": "Debtor type. Valid values: \"Company\" or \"Private\"\nThis affects partner selection as different partners may specialize in B2B vs B2C collection."
},
"countryAlpha2": {
"maxLength": 2,
"minLength": 2,
"type": "string",
"description": "Country code (ISO 3166-1 alpha-2 format, e.g., \"DK\", \"US\", \"PL\")\nUsed to determine jurisdiction and available collection partners."
},
"stateAlpha2": {
"maxLength": 2,
"minLength": 2,
"type": "string",
"description": "US state code (e.g., \"CA\", \"NY\")\nREQUIRED for United States cases only, as US partner coverage is state-specific.\nOptional for other countries.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Simplified debtor information for case preview.\nOnly includes the minimum fields required for partner routing and eligibility checking."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.RequiredActionDto": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The type of action required.\nCommon values: \"MissingDebtCollectionContract\", \"MissingPowerOfAttorney\"",
"nullable": true
},
"message": {
"type": "string",
"description": "Human-readable description of what is required.",
"nullable": true
},
"solutionUrl": {
"type": "string",
"description": "URL where the user can complete this specific action (e.g., contract signing page).\nThe URL is context-aware: referral partner tokens get referral onboarding URLs,\nregular API keys get standard creditor app URLs.\n \n\nPartners who want a single URL that walks the user through every pending\naction in one chain β instead of forwarding one URL per `RequiredActionDto` β\nshould use Debitura.Web.ExternalApi.Contracts.V1.Cases.PreviewResultDto.SigningHandoff's\n`CombinedSigningUrl`. The two are complementary: `SolutionUrl` is granular\nper-action; `CombinedSigningUrl` is the chain-walking alternative for\nsigning-related actions.",
"nullable": true
},
"isBlocking": {
"type": "boolean",
"description": "Whether this action must be completed before case submission.\nCurrently all returned actions are blocking (true)."
}
},
"additionalProperties": false,
"description": "An action required before the case can be submitted (e.g., signing a contract)."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.SigningHandoffDto": {
"type": "object",
"properties": {
"combinedSigningUrl": {
"type": "string",
"description": "Single signing entry URL that walks the creditor through every\npending step (SDCA upgrade β PoA β JPA β KYC) on the Creditors app\nand returns to the partner-supplied returnUrl when done.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Partner-facing handoff metadata for a creditor's pending signing chain.\nReturned on POST /cases responses (422 with pending-signing errors,\nor 200 with AllowPendingContracts=true when signings remain).\n \nDesigned as an envelope so future fields (expiration, suggested email\ncopy, etc.) can be added without polluting the parent DTO."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.TimelineActorDto": {
"required": [
"type"
],
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The type of actor. One of: \"System\", \"Creditor user\", \"Partner user\".",
"nullable": true
},
"name": {
"type": "string",
"description": "Display name of the actor, if available.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Represents the actor (person or system) that performed a timeline action."
},
"Debitura.Web.ExternalApi.Contracts.V1.Cases.TimelineItemDto": {
"required": [
"description",
"title",
"type"
],
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date-time"
},
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
},
"actor": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.TimelineActorDto"
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"dateCreated": {
"type": "string",
"format": "date-time"
},
"dateUpdated": {
"type": "string",
"format": "date-time",
"nullable": true
},
"role": {
"$ref": "#/components/schemas/Debitura.Domain.Model.CommunicationCenter.Chats.ChatRole"
},
"roleLabel": {
"type": "string",
"description": "Human-readable label for the role (e.g., \"Partner\", \"Creditor\", \"Managed by partner\").\nCompanion to Debitura.Web.ExternalApi.Contracts.V1.Chats.ChatDto.Role β always present when Role is set.",
"nullable": true
},
"message": {
"type": "string",
"nullable": true
},
"isSeen": {
"type": "boolean"
},
"user": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Users.UserRelationDto"
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Chats.SendChatRequest": {
"required": [
"message"
],
"type": "object",
"properties": {
"message": {
"maxLength": 10000,
"minLength": 0,
"type": "string",
"description": "The chat message content to send.",
"example": "Please provide the signed contract for this case."
},
"userId": {
"type": "string",
"description": "ID of the team member sending this message.\nMust be a valid user ID from GET /users belonging to your team.\nDeprecated: use UserEmail instead. At least one of UserId or UserEmail must be provided.",
"format": "uuid",
"nullable": true,
"example": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"deprecated": true
},
"userEmail": {
"type": "string",
"description": "Email address of the team member sending this message.\nMust correspond to an active member of your team (same account as the API key).\nPreferred over UserId. At least one of UserEmail or UserId must be provided.",
"format": "email",
"nullable": true,
"example": "john.doe@example.com"
}
},
"additionalProperties": false,
"description": "Request to send a chat message on a case."
},
"Debitura.Web.ExternalApi.Contracts.V1.Divisions.CreateDivisionRequestDto": {
"required": [
"city",
"companyName",
"countryCode"
],
"type": "object",
"properties": {
"companyName": {
"maxLength": 200,
"minLength": 0,
"type": "string"
},
"registrationNumber": {
"maxLength": 50,
"minLength": 0,
"type": "string",
"nullable": true
},
"address": {
"type": "string",
"nullable": true
},
"zipCode": {
"maxLength": 50,
"minLength": 0,
"type": "string",
"nullable": true
},
"state": {
"type": "string",
"nullable": true
},
"city": {
"minLength": 1,
"type": "string"
},
"countryCode": {
"maxLength": 2,
"minLength": 2,
"type": "string"
},
"officeEmail": {
"maxLength": 250,
"minLength": 0,
"type": "string",
"format": "email",
"nullable": true
},
"officePhone": {
"maxLength": 50,
"minLength": 0,
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionCountryDto": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string",
"nullable": true
},
"alpha2": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"companyName": {
"type": "string",
"nullable": true
},
"registrationNumber": {
"type": "string",
"nullable": true
},
"address": {
"type": "string",
"nullable": true
},
"zipCode": {
"type": "string",
"nullable": true
},
"state": {
"type": "string",
"nullable": true
},
"city": {
"type": "string",
"nullable": true
},
"country": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionCountryDto"
},
"officeEmail": {
"type": "string",
"nullable": true
},
"officePhone": {
"type": "string",
"nullable": true
},
"isArchived": {
"type": "boolean"
},
"createdUtc": {
"type": "string",
"format": "date-time"
},
"updatedUtc": {
"type": "string",
"format": "date-time",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionListDto": {
"required": [
"page"
],
"type": "object",
"properties": {
"page": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Base.PageData"
},
"divisions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Divisions.DivisionDto"
},
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Divisions.UpdateDivisionRequestDto": {
"required": [
"city",
"companyName",
"countryCode"
],
"type": "object",
"properties": {
"companyName": {
"maxLength": 200,
"minLength": 0,
"type": "string"
},
"registrationNumber": {
"maxLength": 50,
"minLength": 0,
"type": "string",
"nullable": true
},
"address": {
"type": "string",
"nullable": true
},
"zipCode": {
"maxLength": 50,
"minLength": 0,
"type": "string",
"nullable": true
},
"state": {
"type": "string",
"nullable": true
},
"city": {
"minLength": 1,
"type": "string"
},
"countryCode": {
"maxLength": 2,
"minLength": 2,
"type": "string"
},
"officeEmail": {
"maxLength": 250,
"minLength": 0,
"type": "string",
"format": "email",
"nullable": true
},
"officePhone": {
"maxLength": 50,
"minLength": 0,
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Short human-readable error label (legacy field β preserved for backward compatibility).",
"nullable": true
},
"message": {
"type": "string",
"description": "Human-readable error description (legacy field β preserved for backward compatibility).",
"nullable": true
},
"businessErrors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Cases.BusinessErrorApiDTO"
},
"description": "Canonical structured error array. Consumers should migrate to reading this field.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Generic structured error response for API endpoints.\n \nDual-write design: existing fields (Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto.Error / Debitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto.Message etc.)\nare preserved for backward compatibility alongside the canonical\nDebitura.Web.ExternalApi.Contracts.V1.Errors.ApiErrorResponseDto.BusinessErrors array, allowing consumers to migrate at their own pace."
},
"Debitura.Web.ExternalApi.Contracts.V1.Files.CaseFileDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"dateCreated": {
"type": "string",
"format": "date-time"
},
"dateUpdated": {
"type": "string",
"format": "date-time"
},
"caseId": {
"type": "string",
"format": "uuid"
},
"entityType": {
"type": "string",
"nullable": true
},
"entityId": {
"type": "string",
"format": "uuid"
},
"fileName": {
"type": "string",
"nullable": true
},
"url": {
"type": "string",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
},
"documentType": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadDetailDto": {
"required": [
"leadFlowStatus",
"quoteType",
"status"
],
"type": "object",
"properties": {
"quoteRequestId": {
"type": "string",
"format": "uuid"
},
"caseId": {
"type": "string",
"format": "uuid"
},
"status": {
"type": "string",
"nullable": true
},
"leadFlowStatus": {
"type": "string",
"nullable": true
},
"quoteType": {
"type": "string",
"nullable": true
},
"maxQuotes": {
"type": "integer",
"format": "int32"
},
"currentQuotesCount": {
"type": "integer",
"format": "int32"
},
"isMaxBidCountReached": {
"type": "boolean"
},
"outcome": {
"type": "string",
"nullable": true
},
"request": {
"type": "string",
"nullable": true
},
"existingFees": {
"type": "string",
"nullable": true
},
"dateCreated": {
"type": "string",
"format": "date-time"
},
"dateQualified": {
"type": "string",
"format": "date-time",
"nullable": true
},
"leadsDoneOffered": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateReminderSent": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateReminderTwoSent": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateOutcomeSelected": {
"type": "string",
"format": "date-time",
"nullable": true
}
},
"additionalProperties": false,
"description": "V1 Lead detail DTO for external customer APIs (detailed view)"
},
"Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadDto": {
"required": [
"leadFlowStatus",
"quoteType",
"status"
],
"type": "object",
"properties": {
"quoteRequestId": {
"type": "string",
"format": "uuid"
},
"caseId": {
"type": "string",
"format": "uuid"
},
"status": {
"type": "string",
"nullable": true
},
"leadFlowStatus": {
"type": "string",
"nullable": true
},
"quoteType": {
"type": "string",
"nullable": true
},
"maxQuotes": {
"type": "integer",
"format": "int32"
},
"currentQuotesCount": {
"type": "integer",
"format": "int32"
},
"outcome": {
"type": "string",
"nullable": true
},
"purpose": {
"type": "string",
"description": "Why this lead exists: PhaseChange (legal/enforcement escalation that advances the case\nphase) or AdditionalService (in-phase add-on). Null for legacy leads created before the field existed.",
"nullable": true
},
"dateCreated": {
"type": "string",
"format": "date-time"
},
"dateQualified": {
"type": "string",
"format": "date-time",
"nullable": true
},
"leadsDoneOffered": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateReminderSent": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateReminderTwoSent": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateOutcomeSelected": {
"type": "string",
"format": "date-time",
"nullable": true
}
},
"additionalProperties": false,
"description": "V1 Lead DTO for external customer APIs (summary view)"
},
"Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadListDto": {
"required": [
"quoteRequests"
],
"type": "object",
"properties": {
"quoteRequests": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadDto"
},
"nullable": true
}
},
"additionalProperties": false,
"description": "V1 Lead list response for external customer APIs"
},
"Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteDetailDto": {
"required": [
"agreementType",
"currency",
"partnerName",
"pricing",
"status"
],
"type": "object",
"properties": {
"quoteId": {
"type": "string",
"format": "uuid"
},
"quoteRequestId": {
"type": "string",
"format": "uuid"
},
"partnerId": {
"type": "string",
"format": "uuid"
},
"partnerName": {
"type": "string",
"nullable": true
},
"status": {
"type": "string",
"nullable": true
},
"agreementType": {
"type": "string",
"nullable": true
},
"pricing": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuotePricingDto"
},
"currency": {
"type": "string",
"nullable": true
},
"proposedSolution": {
"type": "string",
"nullable": true
},
"feeComments": {
"type": "string",
"nullable": true
},
"partnerWhyUsSection": {
"type": "string",
"nullable": true
},
"fullQuoteLink": {
"type": "string",
"nullable": true
},
"dateCreated": {
"type": "string",
"format": "date-time"
},
"dateUpdated": {
"type": "string",
"format": "date-time",
"nullable": true
}
},
"additionalProperties": false,
"description": "V1 Lead Quote detail DTO for external customer APIs (detailed view)"
},
"Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteDto": {
"required": [
"agreementType",
"currency",
"partnerName",
"status"
],
"type": "object",
"properties": {
"quoteId": {
"type": "string",
"format": "uuid"
},
"quoteRequestId": {
"type": "string",
"format": "uuid"
},
"partnerId": {
"type": "string",
"format": "uuid"
},
"partnerName": {
"type": "string",
"nullable": true
},
"status": {
"type": "string",
"nullable": true
},
"agreementType": {
"type": "string",
"nullable": true
},
"hourlyRate": {
"type": "number",
"format": "double",
"nullable": true
},
"hourlyEstimated": {
"type": "number",
"format": "double",
"nullable": true
},
"flatFeeEstimate": {
"type": "number",
"format": "double",
"nullable": true
},
"successFee": {
"type": "number",
"format": "double",
"nullable": true
},
"hybridEstimate": {
"type": "number",
"format": "double",
"nullable": true
},
"proposedSolution": {
"type": "string",
"nullable": true
},
"partnerWhyUsSection": {
"type": "string",
"nullable": true
},
"phase": {
"type": "string",
"description": "The case phase this quote offers to work in (Pre-legal / Legal / Enforcement). Null = unspecified.",
"nullable": true
},
"offerNature": {
"type": "string",
"description": "Whether declining stops the case (Recommendation / Required). v1: display only. Null = unspecified.",
"nullable": true
},
"currency": {
"type": "string",
"nullable": true
},
"dateCreated": {
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false,
"description": "V1 Lead Quote DTO for external customer APIs (summary view)"
},
"Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteListDto": {
"required": [
"quotes"
],
"type": "object",
"properties": {
"quotes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuoteDto"
},
"nullable": true
}
},
"additionalProperties": false,
"description": "V1 Lead Quote list response for external customer APIs"
},
"Debitura.Web.ExternalApi.Contracts.V1.Leads.LeadQuotePricingDto": {
"type": "object",
"properties": {
"hourlyRate": {
"type": "number",
"format": "double",
"nullable": true
},
"hourlyEstimated": {
"type": "number",
"format": "double",
"nullable": true
},
"flatFeeEstimate": {
"type": "number",
"format": "double",
"nullable": true
},
"successFeeFee": {
"type": "number",
"format": "double",
"nullable": true
},
"hybridEstimate": {
"type": "number",
"format": "double",
"nullable": true
},
"costProcessMisc": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false,
"description": "Nested pricing details for a lead quote"
},
"Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto": {
"required": [
"currency",
"invoice",
"method",
"recipient"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"dateCreated": {
"type": "string",
"format": "date-time"
},
"dateUpdated": {
"type": "string",
"format": "date-time",
"nullable": true
},
"date": {
"type": "string",
"format": "date-time"
},
"grossAmount": {
"type": "number",
"format": "double"
},
"recipient": {
"type": "string",
"nullable": true
},
"method": {
"type": "string",
"nullable": true
},
"currency": {
"type": "string",
"nullable": true
},
"invoice": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentRelatedInvoiceDto"
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentRelatedInvoiceDto": {
"required": [
"reference",
"status"
],
"type": "object",
"properties": {
"status": {
"type": "string",
"nullable": true
},
"reference": {
"type": "string",
"nullable": true
},
"invoiceId": {
"type": "string",
"format": "uuid"
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskActionDto": {
"type": "object",
"properties": {
"method": {
"type": "string",
"description": "HTTP method to use, e.g. `\"POST\"`.",
"nullable": true
},
"path": {
"type": "string",
"description": "Path template for the resolving call, e.g. `\"/cases/{caseId}/chats\"`.\nRelative to the API's base URL.",
"nullable": true
}
},
"additionalProperties": false,
"description": "A machine-readable hint pointing at the existing API call that resolves a task, e.g.\n`{ \"method\": \"POST\", \"path\": \"/cases/{caseId}/chats\" }` for a chat-driven task.\n \nPath uses the same `{param}` placeholder style as this API's own\ndocumented routes β substitute in the real IDs before calling."
},
"Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The task's unique ID.",
"format": "uuid"
},
"type": {
"type": "string",
"description": "Stable string code for the task type (e.g. `\"ReplyToChat\"`). This is the public,\nadditive-safe contract β it does NOT track the internal integer enum used in storage.",
"nullable": true
},
"typeLabel": {
"type": "string",
"description": "Human-readable label for Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto.Type (e.g. \"Reply to chat\").",
"nullable": true
},
"title": {
"type": "string",
"description": "Short task title, as shown in the Creditor app.",
"nullable": true
},
"description": {
"type": "string",
"description": "Optional longer description of what the task requires.",
"nullable": true
},
"status": {
"type": "string",
"description": "Either `\"Open\"` or `\"Solved\"`.",
"nullable": true
},
"caseId": {
"type": "string",
"description": "The case (collection case / invoice) this task belongs to, when applicable.\nNull for account-level tasks not tied to a single case (e.g. SignContract, AssignBankAccount).",
"format": "uuid",
"nullable": true
},
"caseReference": {
"type": "string",
"description": "Your reference for Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto.CaseId, if any.",
"nullable": true
},
"leadId": {
"type": "string",
"description": "The lead this task belongs to (e.g. SelectQuoteWinner), if applicable.",
"format": "uuid",
"nullable": true
},
"deadline": {
"type": "string",
"description": "When this task is due, if a deadline is set.",
"format": "date-time",
"nullable": true
},
"dateCreated": {
"type": "string",
"description": "When the task was created.",
"format": "date-time"
},
"dateSolved": {
"type": "string",
"description": "When the task was resolved, if it has been.",
"format": "date-time",
"nullable": true
},
"solutionUrl": {
"type": "string",
"description": "Absolute URL β identical to the one the Creditor app itself links to β where a human can\nresolve this task. Always present, regardless of whether Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto.Action is populated.",
"nullable": true
},
"action": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskActionDto"
}
},
"additionalProperties": false,
"description": "A creditor-facing action item (\"task\") β something the platform needs the client to do\nbefore a case can proceed (e.g. reply to a chat, sign a contract, assign a bank account).\n \nEvery task carries a Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto.SolutionUrl β an absolute link identical to the one used\ninside the Creditor app β so a human can resolve any task in one click, even task types that\nare not yet directly API-actionable. Tasks that ARE directly API-actionable additionally carry\na non-null Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto.Action pointing at the exact API call that resolves them."
},
"Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskListDto": {
"required": [
"page"
],
"type": "object",
"properties": {
"page": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Base.PageData"
},
"tasks": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Tasks.TaskDto"
},
"nullable": true
}
},
"additionalProperties": false,
"description": "Paged list of tasks, returned by `GET /tasks`."
},
"Debitura.Web.ExternalApi.Contracts.V1.Users.CollectionPartnerUserDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The user's unique ID. Use this as `assignedUserId` in POST /cases/{id}/start.",
"format": "uuid"
},
"name": {
"type": "string",
"description": "The user's full name.",
"nullable": true
},
"email": {
"type": "string",
"description": "The user's email address.",
"nullable": true
}
},
"additionalProperties": false,
"description": "A user belonging to the authenticated collection partner's team.\nUse the Debitura.Web.ExternalApi.Contracts.V1.Users.CollectionPartnerUserDto.Id as the `assignedUserId` when starting a case via POST /cases/{id}/start."
},
"Debitura.Web.ExternalApi.Contracts.V1.Users.UserListDto": {
"required": [
"page"
],
"type": "object",
"properties": {
"page": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Base.PageData"
},
"users": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Users.CollectionPartnerUserDto"
},
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalApi.Contracts.V1.Users.UserRelationDto": {
"required": [
"email"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"dateCreated": {
"type": "string",
"format": "date-time",
"nullable": true
},
"dateUpdated": {
"type": "string",
"format": "date-time",
"nullable": true
},
"firstName": {
"type": "string",
"nullable": true
},
"lastName": {
"type": "string",
"nullable": true
},
"email": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityRequestApiDTO": {
"required": [
"amount",
"countryAlpha2",
"currencyCode",
"debtorType"
],
"type": "object",
"properties": {
"countryAlpha2": {
"minLength": 1,
"type": "string",
"description": "Debtor country (2-letter ISO code, e.g., \"DK\", \"US\", \"DE\")"
},
"stateAlpha2": {
"type": "string",
"description": "US state code for US debtors (e.g., \"CA\", \"NY\"). Required if CountryAlpha2 = \"US\"",
"nullable": true
},
"debtorType": {
"minLength": 1,
"type": "string",
"description": "Debtor type: \"Company\" or \"Private\""
},
"amount": {
"maximum": 1.7976931348623157E+308,
"minimum": 0.01,
"type": "number",
"description": "Amount to recover in specified currency",
"format": "double"
},
"currencyCode": {
"minLength": 1,
"type": "string",
"description": "Currency code (e.g., \"USD\", \"EUR\", \"DKK\")"
}
},
"additionalProperties": false,
"description": "Request for checking case eligibility and getting partner/PoA status.",
"example": {
"countryAlpha2": "PL",
"debtorType": "Company",
"amount": 2500,
"currencyCode": "EUR"
}
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.CaseEligibilityResponseApiDTO": {
"type": "object",
"properties": {
"isEligible": {
"type": "boolean",
"description": "Whether a collection partner is available for this case"
},
"jurisdiction": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.JurisdictionInfoApiDTO"
},
"partner": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.PartnerInfoApiDTO"
},
"powerOfAttorneyStatus": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.PowerOfAttorneyStatusApiDTO"
},
"errorMessage": {
"type": "string",
"description": "Error message if IsEligible = false",
"nullable": true
}
},
"additionalProperties": false,
"description": "Response for case eligibility check - returns exact partner + PoA status."
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.CollectionContractStatusApiDTO": {
"type": "object",
"properties": {
"signed": {
"type": "boolean"
},
"requiresResigning": {
"type": "boolean"
},
"invalidationReason": {
"type": "string",
"nullable": true
},
"termsUrl": {
"type": "string",
"nullable": true
},
"solutionUrl": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.CoverageItemApiDTO": {
"type": "object",
"properties": {
"jurisdiction": {
"type": "string",
"nullable": true
},
"jurisdictionId": {
"type": "integer",
"format": "int32"
},
"country": {
"type": "string",
"nullable": true
},
"countryId": {
"type": "integer",
"format": "int32"
},
"countryAlpha2": {
"type": "string",
"nullable": true
},
"usStateAlpha2": {
"type": "string",
"nullable": true
},
"partners": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalCustomerAPI.Models.Coverages.PartnerCoverageApiDTO"
},
"description": "Collection partners available for this jurisdiction.\nMay be empty if no partners are assigned.\nMay contain multiple partners if different conditions apply (e.g., B2B vs B2C).",
"nullable": true
}
},
"additionalProperties": false,
"description": "Coverage information for a single jurisdiction.\nBREAKING CHANGE: Partners is now an array - may contain multiple partners with different conditions."
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.JurisdictionInfoApiDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string",
"nullable": true
},
"country": {
"type": "string",
"nullable": true
},
"countryAlpha2": {
"type": "string",
"nullable": true
},
"usStateAlpha2": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false,
"description": "Jurisdiction information"
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.PartnerCoverageApiDTO": {
"type": "object",
"properties": {
"partnerId": {
"type": "string",
"format": "uuid"
},
"partnerName": {
"type": "string",
"nullable": true
},
"conditions": {
"type": "string",
"description": "Human-readable description of when this partner applies.\nExamples: \"All cases\", \"B2B cases only\", \"B2C cases β₯ β¬1000\"",
"nullable": true
},
"signed": {
"type": "boolean",
"description": "Whether Power of Attorney has been signed for this partner"
},
"termsUrl": {
"type": "string",
"description": "URL to download signed PoA document (null if not signed)",
"nullable": true
},
"solutionUrl": {
"type": "string",
"description": "URL to sign or re-sign PoA (null if fully signed and valid)",
"nullable": true
},
"requiresResigning": {
"type": "boolean",
"description": "Whether PoA needs to be re-signed (new version available)"
},
"invalidationReason": {
"type": "string",
"description": "Why re-signing is required (if applicable)",
"nullable": true
}
},
"additionalProperties": false,
"description": "Partner coverage details including conditions and PoA status."
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.PartnerInfoApiDTO": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false,
"description": "Partner information"
},
"Debitura.Web.ExternalCustomerAPI.Models.Coverages.PowerOfAttorneyStatusApiDTO": {
"type": "object",
"properties": {
"signed": {
"type": "boolean",
"description": "Whether PoA has been signed for this partner"
},
"requiresResigning": {
"type": "boolean",
"description": "Whether PoA needs to be re-signed (new version available)"
},
"invalidationReason": {
"type": "string",
"description": "Why re-signing is required (if applicable)",
"nullable": true
},
"termsUrl": {
"type": "string",
"description": "URL to download signed PoA document (null if not signed)",
"nullable": true
},
"solutionUrl": {
"type": "string",
"description": "URL to sign or re-sign PoA (null if fully signed and valid)",
"nullable": true
}
},
"additionalProperties": false,
"description": "Power of Attorney status (shared DTO for check-eligibility and coverage endpoints)."
},
"Debitura.Web.ExternalCustomerAPI.Models.Me.CreditorMeApiDTO": {
"required": [
"companyName"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"companyName": {
"type": "string",
"nullable": true
},
"companyRegistrationNumber": {
"type": "string",
"nullable": true
},
"address": {
"type": "string",
"nullable": true
},
"zipCode": {
"type": "string",
"nullable": true
},
"city": {
"type": "string",
"nullable": true
},
"state": {
"type": "string",
"nullable": true
},
"country": {
"type": "string",
"nullable": true
},
"officeEmail": {
"type": "string",
"nullable": true
},
"officePhone": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalCustomerAPI.Models.Payments.Dtos.PaymentListApiDTO": {
"required": [
"page"
],
"type": "object",
"properties": {
"page": {
"$ref": "#/components/schemas/Debitura.Domain.Model.Base.PageData"
},
"payments": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Debitura.Web.ExternalApi.Contracts.V1.Payments.PaymentDto"
},
"nullable": true
}
},
"additionalProperties": false
},
"Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayEventResultDto": {
"type": "object",
"properties": {
"eventId": {
"type": "string",
"description": "The ID of the event that was replayed.",
"format": "uuid"
},
"subscriptionId": {
"type": "string",
"description": "The subscription the event was re-enqueued to.",
"format": "uuid"
},
"eventType": {
"type": "string",
"description": "The event type that was replayed.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Result of replaying a specific webhook event."
},
"Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.ReplayResultDto": {
"type": "object",
"properties": {
"eventsReplayed": {
"type": "integer",
"description": "Number of events that were re-enqueued for delivery.",
"format": "int32"
}
},
"additionalProperties": false,
"description": "Result of a webhook event replay operation."
},
"Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.TestResultDto": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Whether the test delivery was successful."
},
"httpStatusCode": {
"type": "integer",
"description": "HTTP status code returned by the webhook endpoint.",
"format": "int32",
"nullable": true
},
"durationMs": {
"type": "integer",
"description": "Duration of the HTTP request in milliseconds.",
"format": "int32",
"nullable": true
},
"errorMessage": {
"type": "string",
"description": "Error message if the delivery failed.",
"nullable": true
},
"errorCategory": {
"type": "string",
"description": "Category of the error (TimeoutError, NetworkError, SslError, HttpError, UnknownError).",
"nullable": true
},
"testPayload": {
"description": "The test event payload that was sent.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Result of a webhook test delivery."
},
"Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Dtos.WebhookEventDto": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for this event record.\nUse this ID to replay the event via `POST /webhooks/events/{id}/replay`.",
"format": "uuid"
},
"subscriptionId": {
"type": "string",
"description": "The webhook subscription this event was dispatched to.",
"format": "uuid"
},
"caseId": {
"type": "string",
"description": "The collection case this event relates to.",
"format": "uuid",
"nullable": true
},
"eventType": {
"type": "string",
"description": "The event type (e.g. \"case.created\", \"payment.created\").",
"nullable": true
},
"payload": {
"type": "string",
"description": "The full JSON payload that was (or will be) delivered.",
"nullable": true
},
"createdAt": {
"type": "string",
"description": "When this event was first recorded (UTC).",
"format": "date-time"
},
"deliveredAt": {
"type": "string",
"description": "When the event was successfully delivered (UTC).\nNull if delivery has not yet succeeded.",
"format": "date-time",
"nullable": true
},
"attemptCount": {
"type": "integer",
"description": "Number of delivery attempts made so far.",
"format": "int32"
},
"lastResponseCode": {
"type": "integer",
"description": "HTTP status code returned by the subscriber endpoint on the last attempt.",
"format": "int32",
"nullable": true
},
"lastError": {
"type": "string",
"description": "Error message from the last failed delivery attempt. Null on successful delivery.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Represents a recorded webhook delivery event."
},
"Debitura.Web.ExternalCustomerAPI.Models.Webhooks.Requests.ReplayRequestDto": {
"required": [
"sinceUtc"
],
"type": "object",
"properties": {
"sinceUtc": {
"type": "string",
"description": "Replay all case.created events since this timestamp (UTC).",
"format": "date-time"
}
},
"additionalProperties": false,
"description": "Request to replay events from a specific timestamp."
},
"Microsoft.AspNetCore.Mvc.ProblemDetails": {
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": { }
}
},
"securitySchemes": {
"ApiKey": {
"type": "apiKey",
"description": "This is for clients who manage their own account. They can get the API key in the platform and set it as the 'XApiKey' in the header.",
"name": "XApiKey",
"in": "header"
},
"Bearer": {
"type": "http",
"description": "This is for referral partners, who are sending in clients to the platform. They get the bearer token from the referral partner Api and can be inserted here.",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
"security": [
{
"ApiKey": [ ]
},
{
"Bearer": [ ]
}
],
"tags": [
{
"name": "Cases",
"description": "Cases"
},
{
"name": "Contracts",
"description": "Debt-collection contract status and signing URLs for your account."
},
{
"name": "Coverage",
"description": "Jurisdiction coverage β query which countries and debt types Debitura can collect in, and check case eligibility."
},
{
"name": "Divisions",
"description": "Divisions"
},
{
"name": "Me",
"description": "Authenticated account β verify your API key and retrieve the current creditor profile."
},
{
"name": "Payments",
"description": "Payments"
},
{
"name": "Tasks",
"description": "Tasks"
},
{
"name": "TestCases",
"description": "Test Cases"
},
{
"name": "TestWebhooks",
"description": "Test Webhooks"
},
{
"name": "Users",
"description": "Users"
},
{
"name": "WebhookEvents",
"description": "Webhook event log β list dispatched events for a case and replay individual deliveries."
},
{
"name": "Webhooks",
"description": "Manage webhook subscriptions and inspect the delivery event log. Create subscriptions to receive real-time notifications for case lifecycle events, payments, and chats. Use GET /webhooks/events to verify deliveries and POST /webhooks/events/{id}/replay to re-deliver a specific event."
},
{
"name": "Test Cases",
"description": "Drive test cases through lifecycle states without manual intervention. POST /test/cases/{id}/advance activates or closes a test case in a single call, triggering the real webhook pipeline so your handlers can be verified end-to-end. Hard-delete by ID or tag to keep CI environments clean between runs."
},
{
"name": "Test Webhooks",
"description": "Fire synthetic webhook events against test cases without driving the case to the state that would naturally produce them. POST /test/webhooks/fire emits any event type (case.created, case.updated, case.closed, payment.created, payment.deleted, chat.created) against a test case β useful for testing rare or hard-to-reach event handlers in isolation."
}
],
"externalDocs": {
"description": "Debitura developer documentation",
"url": "https://docs.debitura.com"
}
}