{
  "name": "amex_2way",
  "display_name": "AMEX vs Internal System",
  "description": "Replaces legacy type 'amex' (matchers/amex.py): 2-key match on amount + approval code — AMEX statements carry no card last4 usable against the internal export. Internal side filtered to AMEX payment mode.",
  "stages": [
    {
      "stage": "internal_vs_amex",
      "display_name": "Internal System vs AMEX Settlement",
      "side_a": {
        "source": "template:internal_billing_export",
        "filters": [{ "field": "payment_mode", "op": "in", "values": ["AMEX", "AMERICAN EXPRESS"] }]
      },
      "side_b": { "source": "template:amex_settlement" },
      "tiers": [
        {
          "name": "amount-approval",
          "keys": [
            ["amount", "amount"],
            ["approval_code", "approval_code"]
          ]
        }
      ],
      "output": {
        "matched_sheet": "AMEX-Matched",
        "unmatched_sheet": "AMEX-Unmatched",
        "unmatched_sheet_b": "AMEX-NoInternalRecord",
        "carry_fields": ["reference"]
      }
    }
  ],
  "report": {
    "location_summary": { "enabled": true, "group_by_field": "location" },
    "include_tier_breakdown": false
  }
}
