System Design Atlas

Insurance claims with documents and payouts

04 / 10Worked example

Change commands and retries

How does the payout contract bind the decision, recipient and amount?

Scale alone does not ensure consistent retry behaviour. This proposed API binds the role, business object, change payload and expected state to each new intent. An idempotency key identifies the same intent after a response is lost.

Starting point Size metadata throughput and document volume separately.

Assumptions for the example case

Fictitious example design: a simple property claim under one policy; manual coverage decision based on a fixed document version; one full payout in EUR; reasoned rejection and a later reassessment as a separate process. Figures and quality targets are illustrative test assumptions. Automatic claim rejection by AI, fraud investigation, partial payments and comprehensive statutory deadline calculation are outside scope.

Retries and new intent

Idempotency key binds decision, recipient and amount

Payout CommandE-31 · D-3 · Recipient · 45,000
Command → SchlüsselspeicherFirst check
Key storeFingerprint + Z-31
Identical → Z-31Changed → conflictNew hash → new document version

An identical retry returns Z-31; a different recipient or 45,001 cents conflicts.

A payout is requested again after response loss. Persist the key and content with E-31 and Z-31. Changed recipient details require a new intent and validation.

Proposed domain API contracts

  1. POST/claims/{id}/document-versions

    Assign a verified document version.

    Input
    Policyholder or claims handler, S-31, expected version, verified file references with hashes, predecessor version and key.
    Result
    New immutable document version; still unchecked uploads keep the status open.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  2. POST/claims/{id}/decisions

    Approve the coverage decision.

    Input
    Claims handler, S-31, D-3, policy P-31, rationale, 45,000 cents, EUR, recipient and distinct approver identities as required by the amount.
    Result
    E-31 is bound to this exact version. A missing second approver at or above 50,000 cents, or an outdated version, causes a conflict.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  3. POST/claims/{id}/payouts

    Initiate payout for an approved decision.

    Input
    Authorised role, S-31, E-31, expected version and key. The server reads amount and recipient from E-31.
    Result
    202 with Z-31 and auszahlung_offen; the same decision entitlement creates no second command.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  4. POST/claims/{id}/withdraw-approval

    Withdraw the payout that has not yet begun.

    Input
    Claims handler, E-31, expected version, reason and key.
    Result
    Withdrawal is allowed only before Z-31 is persisted; otherwise return a conflict referencing the open payment.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  5. POST/payout-results

    Ingest external payout evidence.

    Input
    Authenticated payment service, result ID, Z-31, E-31, recipient, 45,000 cents, EUR and evidenced terminal status.
    Result
    Persist the inbox record before acknowledgement. Matching success sets ausgezahlt; definitive rejection sets zahlung_abgelehnt. Conflicting data remains under investigation.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  6. GET/claims/{id}

    Read claim and investigation status.

    Input
    Object-authorized identity to S-31.
    Result
    Document status, decision, payment order and next step according to role.
    Retry behaviour
    Repeating a read creates no business effect; the returned current state may change between requests.

Bind retries to the decision

Bind retries to the decision

Persist the key and content with E-31 and Z-31.

A payout will be requested again after loss of response.

Changed recipient details require a new intent and validation.

Alternative considered
Using only the claim ID as a key prevents legitimate later decisions.
Trade-off
Decision and payment identity remain separate.
Reassess
Partial payments require additional entitlements, each payable once.

Terms in this step

Bind retries to the decision
Changed recipient details require a new intent and validation.

Try it yourself

Change only the recipient when retrying Z-31. State the contract outcome and the route for a new intent.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
The same key with a changed recipient indication creates a conflict; Z-31 remains unchanged.
Second part of the solution
A new payout requires the decision approved for that payout and a new command. Knowing the claim ID alone is insufficient.

Apply to your project

Which corresponding assumption would you check first in your project when partial payments require separately identifiable entitlements?

Step 5 examines: Preserve document versions.