{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/toku/json-schema/toku-patch-beneficiary-account-data-payload-schema.json",
  "title": "PatchBeneficiaryAccountDataPayload",
  "description": "Input payload for PATCH account data. ``bank_code`` is ignored for Mexico, where it is derived from the CLABE.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/toku-beneficiary-accounts-api-openapi.yml#/components/schemas/PatchBeneficiaryAccountDataPayload",
  "properties": {
    "account_number": {
      "description": "Nuevo número de la cuenta bancaria.",
      "minLength": 1,
      "title": "Account Number",
      "type": "string"
    },
    "bank_code": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Nuevo código del banco. Solo se usa en los países donde el número de cuenta no lo lleva, y en esos es obligatorio: en México se ignora, porque se toma de los tres primeros dígitos de la CLABE.",
      "title": "Bank Code"
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/BeneficiaryAccountType"
        }
      ],
      "description": "Nuevo tipo de cuenta bancaria."
    }
  },
  "required": [
    "account_number",
    "type"
  ],
  "type": "object",
  "$defs": {
    "BeneficiaryAccountType": {
      "description": "Tipo de la cuenta de destino de un Beneficiary Account. Qué valores se aceptan depende del país de la cuenta: en Chile, `CHECKING_ACCOUNT` (cuenta corriente), `VISTA_ACCOUNT` (cuenta vista) y `SAVINGS_ACCOUNT` (cuenta de ahorro); en México, `BANK_ACCOUNT`, cuyo número de cuenta es una CLABE de 18 dígitos; `CIE_AGREEMENT`, un convenio CIE de BBVA de 7 dígitos; `INTERNATIONAL_ACCOUNT`, una cuenta internacional de 20 a 30 dígitos cuyo `bank_code` es el código ABA del banco, de 9 a 11 dígitos; `BBVA_ACCOUNT`, una cuenta BBVA de 10 u 11 dígitos; y `CASH_ACCOUNT` (cuenta de efectivo), que paga al beneficiario en efectivo y por eso no tiene cuenta bancaria de destino. `DEBIT_CARD` quedó como valor heredado y hoy se rechaza en los dos países.",
      "enum": [
        "BANK_ACCOUNT",
        "CASH_ACCOUNT",
        "DEBIT_CARD",
        "CIE_AGREEMENT",
        "INTERNATIONAL_ACCOUNT",
        "BBVA_ACCOUNT",
        "CHECKING_ACCOUNT",
        "VISTA_ACCOUNT",
        "SAVINGS_ACCOUNT"
      ],
      "title": "BeneficiaryAccountType",
      "type": "string"
    }
  }
}