← All seeds & suites
disputedesk ADL 0.5.1 Payments & Chargebacks

Dispute Desk

Card-dispute management where AI assembles evidence and drafts the response, and analysts decide: nothing is filed without verified evidence and a reviewed draft, nothing after the network deadline, and every write-off is approved by a second lead.

Resources (7)
merchant, account, charge, dispute, evidence, draft, writeoff
Roles (4)
agent, analyst, lead, admin
Features (10)
suitepermissionsstate_machinevalidationrules_engineviewsscheduled_tasksauditindexeshistory_events

dispute-desk.infinity-sdg.com — card dispute and chargeback management for issuers, where AI assembles the evidence and drafts the response, and analysts make the calls.

account → charge → dispute (received, respond-by deadline)
  → triage: analyst sets the network reason code
  → evidence: cardholder statement, receipts, tracking, device data — verified by an analyst
  → AI drafts the chargeback narrative → analyst accepts, edits or rejects it
  → file chargeback (before the deadline)   ·   or deny, with the reason the cardholder is told
  → merchant accepts → won
    merchant represents → accept (lost) or pre-arbitration → won / lost
  → lost: rebill the cardholder, or write off — approved by a second lead
nightly: open disputes past their respond-by date expire, visibly

What it enforces

RuleWhy
No chargeback after the respond-by dateA late filing loses before it starts, so the system refuses it
Every chargeback rests on verified evidenceAnalysts sign off on what the AI gathered
No filing while an AI draft is unreviewed, and none without an accepted or edited draftThe AI writes; a person decides what goes to the network
Fraud chargebacks need the cardholder’s own statementThe core document for a fraud claim
Only lost disputes can be written off, and whoever requests a write-off can’t approve itFour-eyes control on absorbed losses
A dispute is written off only under an approved write-offEvery absorbed loss traces to an approval
Denials, lost outcomes and rejected write-offs all carry a written reasonCardholders and auditors can see why
Open disputes that miss their deadline expire nightlyA missed deadline shows up on a report, not in a write-off later

Every resource is audited. Disputes keep a readable history from intake to resolution. Only the last four digits of a card are stored.

Resources, views, roles

  • Resources: merchant, account, charge, dispute, evidence, draft (AI), writeoff
  • Views:
    • deadlineBoard, with a due-within-7-days flag
    • aiDraftsToReview
    • writeoffApprovals
  • Roles:
    • agent: intake, withdrawals
    • analyst: triage, evidence, reviewing AI drafts, filing, denials
    • lead: pre-arbitration, write-off approvals
    • admin

Demo data

The demo has 12 merchants, 14 cardholder accounts and 27 disputes, using real Visa reason codes: 10.4 fraud (card absent), 13.1 not received, 13.3 not as described, 12.6 duplicate, 13.2 cancelled recurring, 12.5 incorrect amount. Every state is covered:

  • 7 won, 2 of them at pre-arbitration
  • 6 lost and written off under a second lead’s approval
  • 2 lost and rebilled after a lead refused the write-off
  • 2 lost with write-offs awaiting approval
  • 2 denied, one because the merchant had already refunded
  • 2 filed and waiting on the merchant
  • 2 with AI drafts waiting for an analyst
  • 2 newly received
  • 1 withdrawn
  • 1 expired past its deadline

Of 26 AI drafts, analysts accepted 13, edited 6 and rejected 5. Two drafts are still waiting.

Every human decision in the seed is made by the demo user who would make it (analyst1, analyst2, lead1, lead2), with that user’s own roles. That needs Kalos seeder 1.2.0 or later (privileges: user).

All merchants and cardholders are invented. To regenerate the data, run python3 seeds/gen_seed.py.

Run it

scripts/kalos.sh validate    # static checks
scripts/kalos.sh start       # kalosd on :9217
scripts/kalos.sh verify      # live checks

By default, KALOS_REPO is ../kalos.

Sign in with admin / Admin123!. The other users are agent1, analyst1, analyst2, lead1 and lead2, all with password Demo123!.

Domain Resource Summary

ResourcePurpose & Lifecycle
merchantA merchant as it appears on card transactions.
accountA cardholder account. Only the last four digits of the card are kept.
chargeA posted card transaction (a charge on the account).
disputeA cardholder’s dispute of one charge, from intake to resolution. (States: received, investigating, chargeback_filed, representment, pre_arbitration, lost, won, denied, withdrawn, expired, rebilled, written_off)
evidenceOne piece of evidence for a dispute.
draftAn AI-drafted chargeback narrative. It is a draft until an analyst accepts, edits or rejects it. (States: draft, accepted, edited, rejected)
writeoffA request to absorb a lost dispute’s amount. Needs a second person’s approval. (States: requested, approved, rejected)
Inspect domain.yaml (375 lines)
# dispute-desk/backend/domain.yaml
#
# Dispute Desk — card dispute and chargeback management, issuer side.
#
#   account → charge → dispute (received, respond-by deadline)
#     → triage: analyst sets the network reason code → investigating
#     → evidence (cardholder statement, receipts, tracking, device data …)
#     → AI drafts the chargeback narrative; an analyst accepts, edits or rejects it
#     → file chargeback (before the deadline, with verified evidence and a reviewed draft)
#        or deny (with a reason the cardholder is told)
#     → merchant accepts (won) or represents → accept representment (lost) or
#       pre-arbitration → won / lost
#     → lost: rebill the cardholder, or write off with a second person's approval
#   Nightly: open disputes past their respond-by date expire — a missed deadline
#   is visible, never silently absorbed.
#
# An ISDG product for card issuers, fintechs and BaaS programs.
# query() filter keys are single lowercase words.

domain:
  name: disputedesk
  version: "1.0.0"
  description: >
    Card dispute and chargeback management: AI-assembled evidence and drafted
    responses, analyst decisions, network deadlines, and four-eyes write-offs.

  resources:

    merchant:
      description: "A merchant as it appears on card transactions."
      object:
        id:         { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        name:       { type: string, required: true, maxLength: 120 }
        descriptor: { type: string, required: true, maxLength: 40 }
        mcc:        { type: string, required: true, pattern: "^[0-9]{4}$" }
        riskTier:   { type: string, required: true, enum: [low, medium, high] }
      permissions:
        list:   [agent, analyst, lead, admin]
        get:    [agent, analyst, lead, admin]
        create: [analyst, admin]
        update: [analyst, admin]
        delete: [admin]
      features: { audit: true }

    account:
      description: "A cardholder account. Only the last four digits of the card are kept."
      object:
        id:         { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        holderName: { type: string, required: true, maxLength: 120 }
        cardLast4:  { type: string, required: true, pattern: "^[0-9]{4}$" }
        product:    { type: string, required: true, enum: [debit, credit, business_debit, business_credit] }
        openedOn:   { type: date, required: true }
        email:      { type: email, required: true }
      permissions:
        list:   [agent, analyst, lead, admin]
        get:    [agent, analyst, lead, admin]
        create: [agent, admin]
        update: [agent, admin]
        delete: [admin]
      features: { audit: true }

    charge:
      description: "A posted card transaction (a charge on the account)."
      object:
        id:       { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        account:
          type: reference
          references: "adl.disputedesk.disputedesk.account"
          required: true
        merchant:
          type: reference
          references: "adl.disputedesk.disputedesk.merchant"
          required: true
        amount:   { type: money, required: true, min: 0 }
        postedOn: { type: date, required: true }
        channel:  { type: string, required: true, enum: [card_present, ecommerce, recurring, wallet] }
      permissions:
        list:   [agent, analyst, lead, admin]
        get:    [agent, analyst, lead, admin]
        create: [admin]
        update: [admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [account] }

    dispute:
      description: "A cardholder's dispute of one charge, from intake to resolution."
      object:
        id:           { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        number:       { type: string, required: true, unique: true, maxLength: 20 }
        charge:
          type: reference
          references: "adl.disputedesk.disputedesk.charge"
          required: true
        category:     { type: string, required: true, enum: [fraud, not_received, not_as_described, duplicate, canceled_recurring, incorrect_amount] }
        reasonCode:   { type: string, maxLength: 8 }
        amount:       { type: money, required: true, min: 0 }
        filedOn:      { type: date, required: true }
        respondBy:    { type: date, required: true }
        analyst:      { type: string, maxLength: 100 }
        chargebackAt: { type: datetime }
        denialReason: { type: text }
        outcomeNote:  { type: text }
        resolvedAt:   { type: datetime }
        status:       { type: string, required: true, default: received }
      validation:
        deadlineAfterFiling:
          rule: "respondBy > filedOn"
          message: "The respond-by date must be after the filing date."
      stateMachine:
        field: status
        initial: received
        states:
          received:
            transitions:
              triage:   { to: investigating, guards: [analyst, lead, admin], requiredFields: [reasonCode, analyst] }
              withdraw: { to: withdrawn, guards: [agent, analyst, admin] }
              expire:   { to: expired, guards: [admin] }
          investigating:
            transitions:
              fileChargeback: { to: chargeback_filed, guards: [analyst, lead, admin], sets: { chargebackAt: now() } }
              deny:           { to: denied, guards: [analyst, lead, admin], requiredFields: [denialReason], sets: { resolvedAt: now() } }
              withdraw:       { to: withdrawn, guards: [agent, analyst, admin] }
              expire:         { to: expired, guards: [admin] }
          chargeback_filed:
            transitions:
              merchantAccepts: { to: won, guards: [analyst, lead, admin], sets: { resolvedAt: now() } }
              represented:     { to: representment, guards: [analyst, lead, admin] }
          representment:
            transitions:
              acceptRepresentment: { to: lost, guards: [analyst, lead, admin], requiredFields: [outcomeNote], sets: { resolvedAt: now() } }
              preArbitration:      { to: pre_arbitration, guards: [lead, admin] }
          pre_arbitration:
            transitions:
              winArbitration:  { to: won, guards: [lead, admin], requiredFields: [outcomeNote], sets: { resolvedAt: now() } }
              loseArbitration: { to: lost, guards: [lead, admin], requiredFields: [outcomeNote], sets: { resolvedAt: now() } }
          lost:
            transitions:
              rebill:   { to: rebilled, guards: [analyst, lead, admin] }
              writeOff: { to: written_off, guards: [lead, admin] }
          won: {}
          denied: {}
          withdrawn: {}
          expired: {}
          rebilled: {}
          written_off: {}
      permissions:
        list:   [agent, analyst, lead, admin]
        get:    [agent, analyst, lead, admin]
        create: [agent, admin]
        update: [agent, analyst, lead, admin]
        delete: [admin]
      features: { audit: true }
      history:
        events:
          triaged:     { trigger: transition, transition: triage, capture: [reasonCode], label: "Triaged as {reasonCode}", severity: info }
          filed:       { trigger: transition, transition: fileChargeback, severity: info }
          denied:      { trigger: transition, transition: deny, capture: [denialReason], label: "Denied: {denialReason}", severity: warning }
          won:         { trigger: transition, transition: merchantAccepts, label: "Merchant accepted the chargeback", severity: success }
          lost:        { trigger: transition, transition: acceptRepresentment, capture: [outcomeNote], label: "Representment accepted: {outcomeNote}", severity: warning }
          writtenOff:  { trigger: transition, transition: writeOff, severity: error }
          expired:     { trigger: transition, transition: expire, label: "Respond-by date passed", severity: error }
      indexes:
        - { fields: [status, respondBy] }
        - { fields: [charge] }

    evidence:
      description: "One piece of evidence for a dispute."
      object:
        id:       { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        dispute:
          type: reference
          references: "adl.disputedesk.disputedesk.dispute"
          required: true
        kind:     { type: string, required: true, enum: [cardholder_statement, receipt, tracking, communication, device_data, merchant_response, refund_record] }
        origin:   { type: string, required: true, enum: [ai, analyst, cardholder, merchant] }
        summary:  { type: text, required: true }
        verified: { type: boolean, required: true, default: false }
        verifiedBy: { type: string, maxLength: 100 }
      validation:
        verificationIsSigned:
          rule: "verified == false || verifiedBy != null"
          message: "Record who verified the evidence."
      permissions:
        list:   [agent, analyst, lead, admin]
        get:    [agent, analyst, lead, admin]
        create: [agent, analyst, admin]
        update: [analyst, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [dispute] }

    draft:
      description: "An AI-drafted chargeback narrative. It is a draft until an analyst accepts, edits or rejects it."
      object:
        id:         { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        dispute:
          type: reference
          references: "adl.disputedesk.disputedesk.dispute"
          required: true
        model:      { type: string, required: true, maxLength: 60 }
        narrative:  { type: text, required: true }
        confidence: { type: percentage, required: true }
        reviewNote: { type: text }
        reviewedBy: { type: string, maxLength: 100 }
        status:     { type: string, required: true, default: draft }
      stateMachine:
        field: status
        initial: draft
        states:
          draft:
            transitions:
              accept: { to: accepted, guards: [analyst, lead], sets: { reviewedBy: $user.id } }
              edit:   { to: edited, guards: [analyst, lead], requiredFields: [reviewNote], sets: { reviewedBy: $user.id } }
              reject: { to: rejected, guards: [analyst, lead], requiredFields: [reviewNote], sets: { reviewedBy: $user.id } }
          accepted: {}
          edited: {}
          rejected: {}
      permissions:
        list:   [analyst, lead, admin]
        get:    [analyst, lead, admin]
        create: [analyst, admin]
        update: [analyst, lead, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [dispute] }

    writeoff:
      description: "A request to absorb a lost dispute's amount. Needs a second person's approval."
      object:
        id:          { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        dispute:
          type: reference
          references: "adl.disputedesk.disputedesk.dispute"
          required: true
        amount:      { type: money, required: true, min: 0 }
        reason:      { type: text, required: true }
        requestedBy: { type: string, required: true, maxLength: 100 }
        approver:    { type: string, maxLength: 100 }
        decisionNote: { type: text }
        status:      { type: string, required: true, default: requested }
      stateMachine:
        field: status
        initial: requested
        states:
          requested:
            transitions:
              approve: { to: approved, guards: [lead, admin], requiredFields: [approver] }
              reject:  { to: rejected, guards: [lead, admin], requiredFields: [approver, decisionNote] }
          approved: {}
          rejected: {}
      permissions:
        list:   [analyst, lead, admin]
        get:    [analyst, lead, admin]
        create: [analyst, lead, admin]
        update: [lead, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [dispute] }

  rules:

    noFilingAfterTheDeadline:
      description: "A chargeback filed after the respond-by date is lost before it starts."
      trigger: { resource: dispute, events: [transition], transition: fileChargeback }
      condition: "$record.respondBy < today()"
      action: reject
      severity: error
      message: "The respond-by date has passed."

    fileWithVerifiedEvidence:
      description: "Every chargeback rests on at least one piece of verified evidence."
      trigger: { resource: dispute, events: [transition], transition: fileChargeback }
      condition: "len(query('evidence', { dispute: $record.id, verified: true })) == 0"
      action: reject
      severity: error
      message: "Verify at least one piece of evidence before filing."

    fileOnlyAReviewedDraft:
      description: "The AI drafts; an analyst decides. No filing while a draft is unreviewed, and none without an accepted or edited draft."
      trigger: { resource: dispute, events: [transition], transition: fileChargeback }
      condition: "len(query('draft', { dispute: $record.id, status: 'draft' })) > 0
                  || (len(query('draft', { dispute: $record.id, status: 'accepted' })) == 0
                      && len(query('draft', { dispute: $record.id, status: 'edited' })) == 0)"
      action: reject
      severity: error
      message: "Review the AI draft (accept or edit it) before filing."

    fraudNeedsCardholderStatement:
      description: "A fraud chargeback needs the cardholder's own statement on file."
      trigger: { resource: dispute, events: [transition], transition: fileChargeback }
      condition: "$record.category == 'fraud'
                  && len(query('evidence', { dispute: $record.id, kind: 'cardholder_statement' })) == 0"
      action: reject
      severity: error
      message: "Fraud disputes need the cardholder's statement."

    writeOffOnlyLostDisputes:
      description: "Only a lost dispute can be written off."
      trigger: { resource: writeoff, events: [create] }
      condition: "some(query('dispute', { id: $record.dispute }), d => d.status != 'lost')"
      action: reject
      severity: error
      message: "This dispute was not lost."

    fourEyesOnWriteOffs:
      description: "Whoever requested a write-off can't approve it."
      trigger: { resource: writeoff, events: [transition], transition: approve }
      condition: "$record.approver == $record.requestedBy"
      action: reject
      severity: error
      message: "A different lead must approve this write-off."

    writeOffNeedsApproval:
      description: "A dispute is written off only under an approved write-off."
      trigger: { resource: dispute, events: [transition], transition: writeOff }
      condition: "len(query('writeoff', { dispute: $record.id, status: 'approved' })) == 0"
      action: reject
      severity: error
      message: "An approved write-off is required."

  schedules:

    expireMissedDeadlines:
      description: "Open disputes past their respond-by date expire every night, so a missed deadline is visible."
      recurrence: daily at 02:00
      source:
        resource: dispute
        filter: "(status == 'received' || status == 'investigating') && respondBy < today()"
      action: transition
      transition: expire

  views:

    deadlineBoard:
      description: "Open disputes by respond-by date."
      source: dispute
      filter: "status == 'received' || status == 'investigating' || status == 'chargeback_filed' || status == 'representment' || status == 'pre_arbitration'"
      permissions: [agent, analyst, lead, admin]
      columns:
        - { field: number,     label: "Dispute" }
        - { field: category,   label: "Category" }
        - { field: amount,     label: "Amount" }
        - { field: respondBy,  label: "Respond by" }
        - { field: status,     label: "State" }
        - name: dueSoon
          label: "Due within 7 days"
          computed: "respondBy < dateAdd(today(), 7, 'day')"
      defaultLimit: 500

    aiDraftsToReview:
      description: "AI-drafted chargeback narratives waiting for an analyst."
      source: draft
      filter: "status == 'draft'"
      permissions: [analyst, lead, admin]
      columns:
        - { field: model,      label: "Model" }
        - { field: confidence, label: "Confidence" }
        - { field: narrative,  label: "Narrative" }
      defaultLimit: 200

    writeoffApprovals:
      description: "Write-offs waiting for a second person."
      source: writeoff
      filter: "status == 'requested'"
      permissions: [lead, admin]
      columns:
        - { field: amount,      label: "Amount" }
        - { field: requestedBy, label: "Requested by" }
        - { field: reason,      label: "Reason" }
      defaultLimit: 200

Download seed bundle