{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/citi/main/json-schema/citi-update-mandate-details-schema.json",
  "title": "UpdateMandateDetails",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citi-mandates-api-openapi.yml#/components/schemas/UpdateMandateDetails",
  "type": "object",
  "required": [
    "status_request",
    "request_reason",
    "mandate_status_update"
  ],
  "properties": {
    "status_request": {
      "$ref": "#/$defs/StatusRequest"
    },
    "request_reason": {
      "$ref": "#/$defs/RequestReason"
    },
    "mandate_status_update": {
      "$ref": "#/$defs/MandateStatusUpdate"
    }
  },
  "$defs": {
    "MandateStatusUpdate": {
      "title": "MandateStatusUpdate",
      "type": "object",
      "required": [
        "country"
      ],
      "properties": {
        "country": {
          "title": "country",
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "description": "Specify the country code where the mandate request has been originated.<br>Australia = AU<br>Hongkong = HK<br>Argentina = AR<br>SEPA = UK"
        }
      }
    },
    "RequestReason": {
      "title": "RequestReason",
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "title": "code",
          "type": "string",
          "enum": [
            "MD16",
            "MD17",
            "MD18",
            "MD19",
            "MD20",
            "MD21",
            "MD22",
            "MS02",
            "MS03",
            "NARR",
            "CTAM",
            "CTCA",
            "CTEX",
            "MCFC",
            "MCOC",
            "MSUC"
          ],
          "description": "Specification of request reason <br>MD16-Requested By Customer <br> MD17-Requested By Initiating Party <br>MD18-Requested By Initiating Party And Customer <br> MD19-Mandate Cancelled Due To Early Settlement <br>MD20-Mandate Expired <br> MD21-Mandate Cancelled Due To Fraud <br> MD22-Mandate Initiation Cancelled <br> MS02-Not Specified Reason Customer <br> MS03-Not Specified Reason Agent Generated <br> CTAM-Mandate suspended due to amendment of the contract <br> CTCA-Mandate suspended due to cancellation of the contract, requested by the debtor <br> CTEX-Mandate suspended due to the contract that expired <br> MCFC-Mandate suspended as final collection took place <br> MCOC-Mandate suspended as the once off collection took place <br> MSUC-Mandate suspended after 7 consecutive unsuccessful collections <br> NARR- Reason is provided as narrative information"
        },
        "additional_information": {
          "title": "additional_information",
          "type": "string",
          "minLength": 1,
          "maxLength": 105,
          "description": "If code is NARR, this parameter is mandatory"
        }
      }
    },
    "StatusRequest": {
      "title": "StatusRequest",
      "type": "object",
      "required": [
        "change"
      ],
      "properties": {
        "change": {
          "title": "change",
          "type": "string",
          "enum": [
            "CANC",
            "SUSP",
            "RELS"
          ],
          "description": "Specify the status request type <br> - CANC = Cancelled (Cancel a mandate) <br> - SUSP = Suspended (Suspend an active mandate) <br> - RELS = Release (Release a suspended mandate)"
        }
      }
    }
  }
}