{
  "mode": "illustrative_walkthrough",
  "creates_records": false,
  "real_payments": false,
  "workspace": "/workspace.html",
  "api_manifest": "/index.json",
  "steps": [
    {
      "id": "terms",
      "label": "Agree the terms",
      "actor": "Merchant + buyer",
      "title": "The promise comes before the payment.",
      "description": "An agent wants one result from a fictional data service, Atlas API, for 100 DEMO. It reads and accepts the merchant’s refund terms before paying.",
      "purpose": "The buyer can inspect what is covered, who decides and where a refund could come from. The merchant commits in advance to a bounded refund path.",
      "integration": "The merchant application creates the purchase; the buyer or agent accepts its exact terms.",
      "payment": "Not paid",
      "claim": "Not filed",
      "reserve": 40,
      "approved": 0,
      "paid": 0,
      "outstanding": 0,
      "detail": "API result failure · refund up to 100 DEMO · 7-day claim window · named test reviewer · agreed beneficiary: demo-buyer.",
      "action": "create",
      "input": {
        "amount": 100,
        "order_id": "atlas-example",
        "beneficiary": "demo-buyer"
      },
      "followup": "The buyer then sends action “accept” with the returned purchase_id."
    },
    {
      "id": "payment",
      "label": "Pay normally",
      "actor": "Buyer + payment integration",
      "title": "The payment settles. The terms stay attached.",
      "description": "The buyer pays 100 DEMO to the merchant. The payment integration links that settlement to the exact accepted purchase.",
      "purpose": "A later refund will be a separate payment. The original transfer stays final throughout this story.",
      "integration": "An integrated payment observer would report settlement. In your workspace, you explicitly record a synthetic test payment.",
      "payment": "100 DEMO · final",
      "claim": "Not filed",
      "reserve": 40,
      "approved": 0,
      "paid": 0,
      "outstanding": 0,
      "detail": "Original payment: buyer → merchant. The 40 DEMO reserve is a separate, enrolled source for potential refunds.",
      "action": "settle",
      "input": {
        "purchase_id": "<purchase_id>",
        "settlement_ref": "synthetic:<purchase_id>",
        "amount": 100,
        "asset": "DEMO",
        "network": "simulation-only",
        "destination": "<workspace_id>"
      }
    },
    {
      "id": "claim",
      "label": "Report the failure",
      "actor": "Buyer or agent",
      "title": "The result fails. The buyer files a claim.",
      "description": "Atlas API returns an error instead of the agreed result. The agent submits a claim for 100 DEMO with a fictional failure report.",
      "purpose": "A claim records what happened and what is requested. It does not, by itself, approve a refund.",
      "integration": "The buyer application or agent submits the purchase reference, reason, requested amount and evidence.",
      "payment": "100 DEMO · final",
      "claim": "Awaiting review",
      "reserve": 40,
      "approved": 0,
      "paid": 0,
      "outstanding": 0,
      "detail": "The accepted policy names the reviewer. Evidence in your saved workspace is private and excluded from record exports.",
      "action": "claim",
      "input": {
        "purchase_id": "<purchase_id>",
        "requested": 100,
        "reason": "api_result_failure",
        "evidence": "Fictional example: the API returned an error instead of the result."
      }
    },
    {
      "id": "decision",
      "label": "Approve the refund",
      "actor": "Agreed reviewer → Cleard",
      "title": "100 approved. 40 paid. 60 still owed.",
      "description": "The named reviewer approves the claim. Cleard checks the decision against the purchase and records a separate 40 DEMO refund from the available reserve.",
      "purpose": "The merchant is not asked to approve again. The prior terms authorize the path. Available funds still limit the amount that can be paid.",
      "integration": "The reviewer issues one bounded decision. The execution service checks the purchase, beneficiary, amount, authority and prior payouts.",
      "payment": "100 DEMO · final",
      "claim": "100 DEMO approved",
      "reserve": 0,
      "approved": 100,
      "paid": 40,
      "outstanding": 60,
      "detail": "Separate refund: enrolled reserve → demo-buyer. The remaining 60 is a merchant obligation, with no funded guarantee.",
      "action": "decide",
      "input": {
        "purchase_id": "<purchase_id>",
        "approved": 100,
        "beneficiary": "demo-buyer",
        "reason": "Fictional example: service failure confirmed."
      }
    },
    {
      "id": "recovery",
      "label": "Collect the remainder",
      "actor": "Enrolled source → Cleard",
      "title": "New eligible funds. The same decision.",
      "description": "Later, 60 DEMO is added to the enrolled reserve. Cleard records a second refund for exactly the amount still owed, using the existing approval.",
      "purpose": "The ledger now shows 100 approved, 100 paid and nothing owed. The buyer did not need a second claim, and the original payment was never reversed.",
      "integration": "A supported collection source would make new funds available. The sandbox models this with a fictional reserve top-up and request-driven processing.",
      "payment": "100 DEMO · final",
      "claim": "Approved · fully paid",
      "reserve": 0,
      "approved": 100,
      "paid": 100,
      "outstanding": 0,
      "detail": "Two separate refund receipts: 40 + 60 DEMO. Recovery is conditional on funds entering the enrolled source, not access to arbitrary merchant wallets.",
      "action": "topup",
      "input": {
        "amount": 60
      }
    }
  ]
}
