Overview
AUTO-TOW-047, Prioritize Invoice Review, ranks towing invoices for review, correction, or approval by invoice amount, billing discrepancy severity, payer priority, invoice age, documentation gaps, and collection risk.
- Decision ID
AUTO-TOW-047- Decision Name
- Prioritize Invoice Review
- Industry Profile
auto-towing-prioritize-invoice-review-auto-tow-047version1.0.0- Default Profile
balanced- Default Scenario
standard- Catalog
DKR-AUTO-RUNTIME-001, active DKS runtime catalog
Understanding This Decision
Prioritize Invoice Review helps a towing operation decide which invoices should be reviewed first when billing teams need to resolve discrepancies, approve clean invoices, or intervene before collection risk grows.
Business question
Which invoice review should be recommended for the selected Auto Towing billing context?
Expected outcome
A recommended invoice review or ranked set of invoice reviews with the criteria that most influenced the result.
Typical users
Billing managers, collections teams, towing dispatch administrators, insurer-account coordinators, and integrators building billing review workflows.
Decision boundary
Use this decision to rank supplied invoice review candidates. It does not replace contractual, insurance, tax, or legal billing review.
Architecture
- Request a token from the Identity service.
- Use the returned
jwtTokenas the bearer token. - Load the catalog and decision detail from DKS.
- Build a Prepared Decision Input using canonical criterion IDs.
- Execute the decision through DDE.
- Use
X-Request-IdandX-Correlation-Idfor tracing across DDE and DKS.
Authentication
Request a secure session token from Identity. The current token response field is jwtToken.
POST https://identity.vinquery.com/connect/token
Content-Type: application/json
{
"clientId": "{clientId}",
"clientSecret": "{clientSecret}",
"audience": "vinquery:api:decisioq"
}
Catalog Discovery
Use DKS to discover the catalog and then load complete metadata for AUTO-TOW-047.
GET https://dks.vinquery.com/decisioncatalog
Authorization: Bearer {jwtToken}
GET https://dks.vinquery.com/decisioncatalog/decisions/AUTO-TOW-047
Authorization: Bearer {jwtToken}
Criteria
Criterion IDs are intentionally stable machine identifiers. Display labels are for users; request values should be keyed by canonical criterionId.
| Criterion ID | Name | Direction | Weight | Validation |
|---|---|---|---|---|
invoice_amount | Invoice Amount | maximize | 20 | non_negative_currency |
billing_discrepancy_score | Billing Discrepancy Score | maximize | 25 | score_0_to_100 |
payer_priority_score | Payer Priority Score | maximize | 15 | score_0_to_100 |
aging_days | Aging Days | minimize | 15 | non_negative_integer |
documentation_gap_score | Documentation Gap Score | minimize | 15 | score_0_to_100 |
collection_risk_score | Collection Risk Score | minimize | 10 | score_0_to_100 |
Constraint Processing
This decision includes a catalog-defined hard constraint. DKS returns the constraint with the decision detail, and DDE evaluates it before criteria-based ranking.
| Verified Catalog Constraint | Status | Effect |
|---|---|---|
AUTO-TOW-047-AGING-DAYS-MAX-3 | Hard, enabled, mandatory | Requires aging_days <= 3 before a candidate can participate in routine ranking. |
{
"constraintSummary": {
"definedConstraintCount": 1,
"activeConstraintCount": 1,
"eligibleOptionCount": 2,
"excludedOptionCount": 1,
"eligibleOptions": [
"option-1",
"option-2"
],
"excludedOptions": [
{
"optionId": "option-3",
"reasons": [
"Aging days exceeds the standard review window of 3 days."
]
}
]
}
}
const constraints = decisionDetail.constraints || [];
if (constraints.length > 0) {
// DDE applies catalog constraints before ranking.
// Excluded candidates appear in response.constraintSummary.excludedOptions.
}
const summary = response.constraintSummary;
const excluded = response.decisionResult?.excludedOptions || [];
Excluded candidates do not participate in ranking because hard constraints are evaluated before scoring. For AUTO-TOW-047, option-3 is excluded from the showcase sample because its invoice age is outside the standard review window.
Industry Profile
The active industry profile uses $.towRequests as the options path, $.optionId as the option ID, and $.name as the option display name.
| Business Data Path | Criterion ID |
|---|---|
option.financial.invoiceAmount | invoice_amount |
option.assessment.billingDiscrepancyScore | billing_discrepancy_score |
option.assessment.payerPriorityScore | payer_priority_score |
option.billing.and.collections.agingDays | aging_days |
option.assessment.documentationGapScore | documentation_gap_score |
option.risk.collectionRiskScore | collection_risk_score |
{
"towRequests": [
{
"optionId": "option-1",
"name": "High-Value Insurance Invoice",
"financial": {
"invoiceAmount": 125
},
"assessment": {
"billingDiscrepancyScore": 88,
"payerPriorityScore": 88,
"documentationGapScore": 88
},
"billing": {
"and": {
"collections": {
"agingDays": 1
}
}
},
"risk": {
"collectionRiskScore": 88
}
}
]
}
{
"optionId": "option-1",
"name": "High-Value Insurance Invoice",
"values": {
"invoice_amount": 125,
"billing_discrepancy_score": 88,
"payer_priority_score": 88,
"aging_days": 1,
"documentation_gap_score": 88,
"collection_risk_score": 88
}
}
Profiles and Scenarios
A profile changes criterion weights. A scenario describes the operating context for the execution. The active DKS catalog exposes these choices with the decision detail response.
| Profile ID | Name | Purpose |
|---|---|---|
balanced | Balanced | Preserves the default DKS criterion weights. |
customer_focused | Customer Focused | Places stronger emphasis on customer priority, satisfaction, communication urgency, and service experience. |
cost_control | Cost Control | Places stronger emphasis on fees, collection risk, waiver exposure, and financial discipline. |
compliance_focused | Compliance Focused | Places stronger emphasis on policy, documentation, authorization, insurance, and auditability. |
| Scenario ID | Name | Use When |
|---|---|---|
standard | Standard Operating Scenario | Normal towing customer and billing operating context. |
urgent_customer | Urgent Customer Scenario | Customer urgency, stranded motorists, or service recovery require stronger emphasis. |
cost_control | Cost Control Scenario | Fee recovery, margin protection, or collection risk must be controlled. |
compliance_review | Compliance Review Scenario | Authorization, policy, documentation, or insurance rules require stronger control. |
Prepared Input
For Prepared Decision Input, send decisionId, selected profile/scenario IDs, and option values keyed by canonical criterion ID. The showcase request includes two eligible invoice reviews and one excluded invoice so constraint handling is visible.
{
"decisionId": "AUTO-TOW-047",
"mappingProfileId": "auto-towing-prioritize-invoice-review-auto-tow-047",
"mappingProfileVersion": "1.0.0",
"profileId": "balanced",
"scenarioId": "standard",
"algorithm": "TOPSIS",
"weightStrategy": "Manual",
"runSensitivity": false,
"requestContext": {
"correlationId": "auto-tow-047-demo-001"
},
"options": [
{
"optionId": "option-1",
"name": "High-Value Insurance Invoice",
"values": {
"invoice_amount": 125,
"billing_discrepancy_score": 88,
"payer_priority_score": 88,
"aging_days": 1,
"documentation_gap_score": 88,
"collection_risk_score": 88
}
},
{
"optionId": "option-2",
"name": "Disputed Commercial Invoice",
"values": {
"invoice_amount": 250,
"billing_discrepancy_score": 81,
"payer_priority_score": 81,
"aging_days": 2,
"documentation_gap_score": 81,
"collection_risk_score": 81
}
},
{
"optionId": "option-3",
"name": "Aged Storage Invoice",
"values": {
"invoice_amount": 500,
"billing_discrepancy_score": 74,
"payer_priority_score": 74,
"aging_days": 4,
"documentation_gap_score": 74,
"collection_risk_score": 74
}
}
]
}
Execute
curl -X POST "https://dde.vinquery.com/api/v1/decide" \
-H "Authorization: Bearer ${DECISIOQ_TOKEN}" \
-H "Content-Type: application/json" \
-H "X-Correlation-Id: auto-tow-047-demo-001" \
--data @auto-tow-047-execute.json
DDE retrieves authoritative criteria, constraints, and validation metadata from DKS, executes the deterministic ranking, and returns the decision result plus execution metadata.
Interpret the Result
The successful response is centered on decisionResult. The winner and ranking are deterministic outputs; optional explanation fields add context but do not change the ranking.
{
"success": true,
"decisionType": "AUTO-TOW-047",
"decisionResult": {
"winner": "option-1",
"ranking": [
{
"optionId": "option-1",
"name": "High-Value Insurance Invoice",
"score": 0.91
},
{
"optionId": "option-2",
"name": "Disputed Commercial Invoice",
"score": 0.84
}
],
"excludedOptions": [
{
"optionId": "option-3",
"reasons": [
"Aging days exceeds the standard review window of 3 days."
]
}
]
},
"constraintSummary": {
"definedConstraintCount": 1,
"activeConstraintCount": 1,
"eligibleOptionCount": 2,
"excludedOptionCount": 1
},
"requestContext": {
"correlationId": "auto-tow-047-demo-001"
}
}
decisionResult.winner.Sensitivity Analysis
Set runSensitivity to true on catalog execution when the client wants recommendation-stability information in the same response. The sensitivity engine perturbs criterion weights by controlled factors and reports whether the winner remains stable.
{
"sensitivityResult": {
"stableWinner": true,
"winner": "option-1",
"mostSensitiveCriterion": "invoice_amount",
"confidence": 95,
"criterionImpacts": {
"invoice_amount": 0.1842
},
"winnerChangeCounts": {
"invoice_amount": 0
}
}
}
Use sensitivity output to decide whether a recommendation is robust enough for automation or should be reviewed by a person.
Explanation of Decision Result
Every successful response can include deterministic explanation text under decisionResult.explanation and explanation. If the optional AI layer is enabled, the response may also include an ai block with structured business-language explanation fields.
{
"ai": {
"enabled": true,
"generated": true,
"schemaValidated": true,
"explanation": {
"summary": "The selected invoice review provided the strongest billing review priority.",
"whyRecommended": "It combined invoice value, billing discrepancy severity, payer priority, and acceptable invoice age.",
"keyDrivers": [],
"tradeoffs": [],
"competitors": [],
"sensitivitySummary": "Sensitivity analysis was not included in this response.",
"scenarioSummary": "The standard scenario was selected.",
"risks": [],
"nextSteps": [],
"assumptions": []
}
}
}
Tracing and Logs
Use request identifiers to connect client, catalog, and execution activity during support or integration testing.
X-Request-Id- Optional client-supplied request ID. If omitted, the server generates one.
X-Correlation-Id- Optional client correlation value propagated from DDE to DKS.
requestContext.correlationId- Optional payload value echoed in the response and used for tracing.
executionTrace- Advanced execution metadata including selected profile, selected scenario, effective weights, and applied constraints.
Code Examples
These examples demonstrate the current DecisioQ flow:
- Request
jwtTokenfromhttps://identity.vinquery.com/connect/token. - Load
AUTO-TOW-047metadata fromhttps://dks.vinquery.com/decisioncatalog/decisions/AUTO-TOW-047. - Execute a Prepared Decision Input at
https://dde.vinquery.com/api/v1/decide.
Set these environment variables before running any companion example:
DECISIOQ_CLIENT_ID
DECISIOQ_CLIENT_SECRET
DECISIOQ_AUDIENCE=vinquery:api:decisioq
Optional:
DECISIOQ_IDENTITY_URL=https://identity.vinquery.com/connect/token
DECISIOQ_DKS_URL=https://dks.vinquery.com
DECISIOQ_DDE_URL=https://dde.vinquery.com
Download the source files directly:
Troubleshooting
| Symptom | Likely Cause | What to Check |
|---|---|---|
| 401 Unauthorized | Missing, expired, or invalid bearer token. | Request a fresh jwtToken from Identity and send it as Authorization: Bearer .... |
| Decision not found | The decision ID is not in the active catalog. | Load /decisioncatalog/decisions/AUTO-TOW-047 and confirm the ID is published. |
| Validation failed | A required criterion value is missing or outside its rule. | Use canonical criterion IDs and keep score values in the expected range. |
| Candidate excluded | The candidate violates a hard catalog constraint. | Review constraintSummary.excludedOptions; for AUTO-TOW-047, aging days must be no greater than 3. |
| HTML error response | An upstream hosted service failed before returning JSON. | Check service health and server logs for Identity, DKS, or DDE. |
Production Checklist
Security
Keep API Consumer credentials and jwtTokens on the server side. Use HTTPS, short-lived bearer tokens, and an API Consumer linked to a DecisioQ account for usage accounting.
Catalog
Load decision metadata from DKS and cache cautiously. Refresh when catalog versions change.
Request Quality
Use canonical criterion IDs, validate value ranges, and send at least two candidate options.
Operations
Send correlation IDs, record request IDs, and monitor non-JSON upstream failures.
Explanation
Display explanation text as supporting context only. Never let AI text override deterministic results.
User Experience
Show business labels to users and keep raw execution trace collapsed for advanced diagnostics.
