{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/methodfi/main/json-schema/methodfi-payment-response-schema.json",
  "title": "PaymentResponse",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/methodfi-payments-api-openapi.yml#/components/schemas/PaymentResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessEnvelope"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/$defs/Payment"
        }
      }
    }
  ],
  "$defs": {
    "Account": {
      "type": "object",
      "description": "An Account represents a financial account (ACH, liability, clearing, or debit card) associated with an Entity. The `type` field indicates which nested details object (`ach`, `liability`, `clearing`, or `debit_card`) is populated. `type` is null for accounts that are disabled before a type was determined.\n",
      "required": [
        "id",
        "holder_id",
        "type",
        "status",
        "consent_status",
        "products",
        "restricted_products",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the account.",
          "pattern": "^acc_\\w+$"
        },
        "holder_id": {
          "type": "string",
          "description": "The entity ID that owns this account.",
          "pattern": "^ent_\\w+$"
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "description": "The type of account. Null for accounts that are disabled before a type was determined.",
          "enum": [
            "ach",
            "liability",
            "clearing",
            "debit_card",
            null
          ]
        },
        "status": {
          "type": "string",
          "description": "Current status of the account.",
          "enum": [
            "active",
            "disabled",
            "processing",
            "pending_exchange",
            "closed"
          ]
        },
        "consent_status": {
          "type": "string",
          "description": "Current consent status for data access on this account.",
          "enum": [
            "pending",
            "withdrawn",
            "approved"
          ]
        },
        "ach": {
          "$ref": "#/$defs/AccountACH"
        },
        "liability": {
          "$ref": "#/$defs/AccountLiability"
        },
        "clearing": {
          "$ref": "#/$defs/AccountClearing"
        },
        "debit_card": {
          "$ref": "#/$defs/AccountDebitCard"
        },
        "error": {
          "$ref": "#/$defs/AccountResourceError"
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "products": {
          "type": "array",
          "description": "Products currently active for this account.",
          "items": {
            "type": "string"
          }
        },
        "restricted_products": {
          "type": "array",
          "description": "Products restricted from this account.",
          "items": {
            "type": "string"
          }
        },
        "subscriptions": {
          "type": "array",
          "description": "Subscriptions currently active for this account. Only present for liability accounts.",
          "items": {
            "type": "string"
          }
        },
        "available_subscriptions": {
          "type": "array",
          "description": "Subscriptions available to be enrolled for this account. Only present for liability accounts.",
          "items": {
            "type": "string"
          }
        },
        "restricted_subscriptions": {
          "type": "array",
          "description": "Subscriptions restricted from this account. Only present for liability accounts.",
          "items": {
            "type": "string"
          }
        },
        "latest_verification_session": {
          "title": "AccountExpandableLatestVerificationSession",
          "description": "The latest verification session ID. This field is expandable. When expanded, returns the full AccountVerificationSession object.\n",
          "oneOf": [
            {
              "type": "string",
              "pattern": "^avf_\\w+$"
            },
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/AccountVerificationSession"
            }
          ]
        },
        "balance": {
          "$ref": "#/$defs/AccountExpandableBalance"
        },
        "payoff": {
          "$ref": "#/$defs/AccountExpandablePayoff"
        },
        "payment_instrument": {
          "$ref": "#/$defs/AccountExpandablePaymentInstrument"
        },
        "card_brand": {
          "$ref": "#/$defs/AccountExpandableCardBrand"
        },
        "update": {
          "$ref": "#/$defs/AccountExpandableUpdate"
        },
        "attribute": {
          "$ref": "#/$defs/AccountExpandableAttribute"
        },
        "sensitive": {
          "$ref": "#/$defs/AccountExpandableSensitive"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the account was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the account was last updated."
        }
      }
    },
    "AccountACH": {
      "type": [
        "object",
        "null"
      ],
      "description": "ACH account details. Present when `type` is `ach`.",
      "properties": {
        "routing": {
          "type": "string",
          "description": "The ACH routing number."
        },
        "number": {
          "type": "string",
          "description": "The ACH account number."
        },
        "type": {
          "type": "string",
          "description": "The type of ACH account.",
          "enum": [
            "checking",
            "savings"
          ]
        }
      }
    },
    "AccountAttribute": {
      "type": "object",
      "description": "An attribute record for an account containing financial data attributes.",
      "required": [
        "id",
        "account_id",
        "status",
        "attributes",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the account attribute.",
          "pattern": "^acc_attr_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this attribute belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "status": {
          "type": "string",
          "description": "Current status of the attribute request.",
          "enum": [
            "completed",
            "pending",
            "failed"
          ]
        },
        "attributes": {
          "type": "object",
          "description": "Financial data attributes for the account.",
          "additionalProperties": true
        },
        "error": {
          "$ref": "#/$defs/ResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the attribute was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the attribute was last updated."
        }
      }
    },
    "AccountBalance": {
      "type": "object",
      "description": "A balance record for an account.",
      "required": [
        "id",
        "account_id",
        "status",
        "amount",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the balance.",
          "pattern": "^bal_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this balance belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "status": {
          "type": "string",
          "description": "Current status of the balance request.",
          "enum": [
            "completed",
            "pending",
            "failed"
          ]
        },
        "amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "The balance amount in cents."
        },
        "error": {
          "$ref": "#/$defs/BalanceResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the balance was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the balance was last updated."
        }
      }
    },
    "AccountCardBrand": {
      "type": "object",
      "description": "Card brand information for an account.",
      "required": [
        "id",
        "account_id",
        "status",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the card brand.",
          "pattern": "^cbrd_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this card brand belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "brands": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array of card brand entries for this account.",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier for the brand entry."
              },
              "card_product_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Associated card product ID."
              },
              "description": {
                "type": "string",
                "description": "Description of the brand."
              },
              "name": {
                "type": "string",
                "description": "Name of the brand."
              },
              "issuer": {
                "type": "string",
                "description": "The card issuer."
              },
              "network": {
                "type": "string",
                "description": "The card network."
              },
              "network_tier": {
                "type": "string",
                "description": "The tier of the card network."
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The brand type."
              },
              "url": {
                "type": "string",
                "description": "URL for the brand image."
              }
            }
          }
        },
        "source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Source of the card brand data.",
          "enum": [
            "network",
            "method",
            null
          ]
        },
        "shared": {
          "type": "boolean",
          "description": "Whether this card brand record is shared."
        },
        "network": {
          "type": [
            "string",
            "null"
          ],
          "description": "The card network. Deprecated in favor of brands[].network.",
          "enum": [
            "visa",
            "mastercard",
            "amex",
            "discover",
            null
          ]
        },
        "issuer": {
          "type": [
            "string",
            "null"
          ],
          "description": "The card issuer. Deprecated in favor of brands[].issuer."
        },
        "last4": {
          "type": [
            "string",
            "null"
          ],
          "description": "Last 4 digits of the card number. Deprecated in favor of brands[]."
        },
        "status": {
          "type": "string",
          "description": "Current status of the card brand request.",
          "enum": [
            "completed",
            "pending",
            "failed"
          ]
        },
        "error": {
          "$ref": "#/$defs/ResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the card brand was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the card brand was last updated."
        }
      }
    },
    "AccountClearing": {
      "type": [
        "object",
        "null"
      ],
      "description": "Clearing account details. Present when `type` is `clearing`.",
      "properties": {
        "type": {
          "type": "string",
          "description": "The type of clearing account.",
          "enum": [
            "single_use",
            "multi_use"
          ]
        },
        "routing": {
          "type": "string",
          "description": "The clearing routing number."
        },
        "number": {
          "type": "string",
          "description": "The clearing account number."
        }
      }
    },
    "AccountDebitCard": {
      "type": [
        "object",
        "null"
      ],
      "description": "Debit card account details. Present when `type` is `debit_card`.",
      "properties": {
        "network": {
          "type": "string",
          "description": "The card network."
        },
        "mask": {
          "type": "string",
          "description": "Last 4 digits of the card number."
        },
        "issuer": {
          "type": "string",
          "description": "The card issuer."
        }
      }
    },
    "AccountExpandableAttribute": {
      "title": "AccountExpandableAttribute",
      "description": "The latest attribute ID. This field is expandable. When expanded, returns the full AccountAttribute object.\n",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^acc_attr_\\w+$"
        },
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/AccountAttribute"
        }
      ]
    },
    "AccountExpandableBalance": {
      "title": "AccountExpandableBalance",
      "description": "The latest balance ID. This field is expandable. When expanded, returns the full AccountBalance object.\n",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^bal_\\w+$"
        },
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/AccountBalance"
        }
      ]
    },
    "AccountExpandableCardBrand": {
      "title": "AccountExpandableCardBrand",
      "description": "The latest card brand ID. This field is expandable. When expanded, returns the full AccountCardBrand object.\n",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^cbrd_\\w+$"
        },
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/AccountCardBrand"
        }
      ]
    },
    "AccountExpandablePaymentInstrument": {
      "title": "AccountExpandablePaymentInstrument",
      "description": "The latest payment instrument ID. This field is expandable. When expanded, returns the full AccountPaymentInstrument object.\n",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^pmt_inst_\\w+$"
        },
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/AccountPaymentInstrument"
        }
      ]
    },
    "AccountExpandablePayoff": {
      "title": "AccountExpandablePayoff",
      "description": "The latest payoff ID. This field is expandable. When expanded, returns the full AccountPayoff object.\n",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^pyf_\\w+$"
        },
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/AccountPayoff"
        }
      ]
    },
    "AccountExpandableSensitive": {
      "title": "AccountExpandableSensitive",
      "description": "The latest sensitive ID. This field is expandable. When expanded, returns the full AccountSensitive object.\n",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^astv_\\w+$"
        },
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/AccountSensitive"
        }
      ]
    },
    "AccountExpandableUpdate": {
      "title": "AccountExpandableUpdate",
      "description": "The latest update ID. This field is expandable. When expanded, returns the full AccountUpdate object.\n",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^upd_\\w+$"
        },
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/AccountUpdate"
        }
      ]
    },
    "AccountLiability": {
      "type": [
        "object",
        "null"
      ],
      "description": "Liability account details. Present when `type` is `liability`.",
      "required": [
        "mch_id",
        "mask",
        "ownership",
        "fingerprint",
        "type",
        "sub_type",
        "name"
      ],
      "properties": {
        "mch_id": {
          "title": "AccountLiabilityExpandableMerchant",
          "description": "The merchant ID associated with this liability.",
          "oneOf": [
            {
              "type": "string",
              "pattern": "^mch_\\w+$"
            },
            {
              "$ref": "#/$defs/Merchant"
            }
          ]
        },
        "mask": {
          "type": [
            "string",
            "null"
          ],
          "description": "Last 4 digits of the account number."
        },
        "ownership": {
          "type": [
            "string",
            "null"
          ],
          "description": "Ownership type of the account.",
          "enum": [
            "primary",
            "authorized",
            "joint",
            "unknown",
            null
          ]
        },
        "fingerprint": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique fingerprint for de-duplication."
        },
        "type": {
          "type": "string",
          "description": "The type of liability.",
          "enum": [
            "credit_card",
            "auto_loan",
            "mortgage",
            "personal_loan",
            "student_loan",
            "student_loans",
            "collection",
            "credit_builder",
            "insurance",
            "loan",
            "medical",
            "utility",
            "bnpl",
            "fintech"
          ]
        },
        "sub_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "More specific classification of the liability type."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display name of the liability account."
        }
      }
    },
    "AccountPaymentInstrument": {
      "type": "object",
      "description": "A payment instrument for an account.",
      "required": [
        "id",
        "account_id",
        "status",
        "type",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the payment instrument.",
          "pattern": "^pmt_inst_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this payment instrument belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "status": {
          "type": "string",
          "description": "Current status of the payment instrument.",
          "enum": [
            "pending",
            "in_progress",
            "completed"
          ]
        },
        "type": {
          "type": "string",
          "description": "The type of payment instrument.",
          "enum": [
            "card",
            "network_token",
            "inbound_achwire_payment"
          ]
        },
        "chargeable": {
          "type": "boolean",
          "description": "Whether this payment instrument is currently chargeable."
        },
        "card": {
          "type": [
            "object",
            "null"
          ],
          "description": "Card details. Present when type is card.",
          "properties": {
            "number": {
              "type": "string",
              "description": "The card number."
            },
            "exp_month": {
              "type": "string",
              "description": "Card expiration month."
            },
            "exp_year": {
              "type": "string",
              "description": "Card expiration year."
            },
            "billing_zip_code": {
              "type": "string",
              "description": "Billing zip code."
            }
          }
        },
        "network_token": {
          "type": [
            "object",
            "null"
          ],
          "description": "Network token details. Present when type is network_token.",
          "properties": {
            "token": {
              "type": "string",
              "description": "The network token value."
            }
          }
        },
        "inbound_achwire_payment": {
          "type": [
            "object",
            "null"
          ],
          "description": "ACH/wire payment details. Present when type is inbound_achwire_payment.",
          "properties": {
            "account_number": {
              "type": "string",
              "description": "The account number."
            },
            "routing_number": {
              "type": "string",
              "description": "The routing number."
            }
          }
        },
        "error": {
          "$ref": "#/$defs/ResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the payment instrument was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the payment instrument was last updated."
        }
      }
    },
    "AccountPayoff": {
      "type": "object",
      "description": "A payoff record for an account.",
      "required": [
        "id",
        "account_id",
        "status",
        "amount",
        "term",
        "per_diem_amount",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the payoff.",
          "pattern": "^pyf_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this payoff belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "status": {
          "type": "string",
          "description": "Current status of the payoff request.",
          "enum": [
            "completed",
            "pending",
            "failed"
          ]
        },
        "amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "The payoff amount in cents."
        },
        "term": {
          "type": [
            "number",
            "null"
          ],
          "description": "Number of days the payoff amount is valid."
        },
        "per_diem_amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "Per diem interest amount in cents."
        },
        "error": {
          "$ref": "#/$defs/PayoffResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the payoff was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the payoff was last updated."
        }
      }
    },
    "AccountResourceError": {
      "type": [
        "object",
        "null"
      ],
      "description": "Error details when an account is disabled.",
      "required": [
        "type",
        "code",
        "sub_type",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The category of account error.",
          "enum": [
            "ACCOUNT_DISABLED"
          ]
        },
        "code": {
          "type": "integer",
          "description": "Numeric error code (11XXX range).",
          "enum": [
            11001,
            11002,
            11003,
            11004,
            11005,
            11006
          ]
        },
        "sub_type": {
          "type": "string",
          "description": "Specific account error classification.",
          "enum": [
            "ACCOUNT_INVALID_DETAILS",
            "ACCOUNT_UNAUTHORIZED_PAYMENT",
            "ACCOUNT_CLOSED",
            "ACCOUNT_CONSENT_WITHDRAWN",
            "ACCOUNT_DISABLED_INVALID_STATE",
            "ACCOUNT_DISABLED_HOLDER_ENTITY_DISABLED"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        }
      }
    },
    "AccountSensitive": {
      "type": "object",
      "description": "Sensitive data for an account.",
      "required": [
        "id",
        "account_id",
        "status",
        "type",
        "fields",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the sensitive record.",
          "pattern": "^astv_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this sensitive data belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "status": {
          "type": "string",
          "description": "Current status of the sensitive data request.",
          "enum": [
            "completed",
            "pending",
            "failed"
          ]
        },
        "type": {
          "type": "string",
          "description": "The type of sensitive data."
        },
        "fields": {
          "type": "array",
          "description": "List of sensitive data fields retrieved.",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of the field."
              },
              "value": {
                "type": "string",
                "description": "Value of the field."
              }
            }
          }
        },
        "error": {
          "$ref": "#/$defs/AccountSensitiveResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the sensitive record was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the sensitive record was last updated."
        }
      }
    },
    "AccountSensitiveResourceError": {
      "type": [
        "object",
        "null"
      ],
      "description": "Error details when retrieving account sensitive data fails.",
      "required": [
        "type",
        "code",
        "sub_type",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The category of sensitive data error.",
          "enum": [
            "ACCOUNT_SENSITIVE_FAILED"
          ]
        },
        "code": {
          "type": "integer",
          "description": "Numeric error code (17XXX range).",
          "enum": [
            17001
          ]
        },
        "sub_type": {
          "type": "string",
          "description": "Specific sensitive data error classification.",
          "enum": [
            "ACCOUNT_SENSITIVE_FAILED_VERIFICATION_REQUIRED"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        }
      }
    },
    "AccountUpdate": {
      "type": "object",
      "description": "An update record for an account.",
      "required": [
        "id",
        "account_id",
        "status",
        "type",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the update.",
          "pattern": "^upd_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this update belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "status": {
          "type": "string",
          "description": "Current status of the update.",
          "enum": [
            "completed",
            "pending",
            "failed"
          ]
        },
        "type": {
          "type": "string",
          "description": "The liability type of the account being updated.",
          "enum": [
            "credit_card",
            "auto_loan",
            "mortgage",
            "personal_loan",
            "student_loan",
            "student_loans",
            "bnpl",
            "fintech"
          ]
        },
        "source": {
          "type": "string",
          "description": "The data source used for this update.",
          "enum": [
            "direct",
            "snapshot"
          ]
        },
        "data_as_of": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The timestamp of the data used to complete this update."
        },
        "credit_card": {
          "type": [
            "object",
            "null"
          ],
          "description": "Credit card update data. Present when `type` is `credit_card`.",
          "properties": {
            "sub_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "last_payment_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Last payment amount in cents."
            },
            "last_payment_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_due_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_minimum_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Minimum payment due in cents."
            },
            "interest_rate_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "interest_rate_percentage_max": {
              "type": [
                "number",
                "null"
              ]
            },
            "interest_rate_percentage_min": {
              "type": [
                "number",
                "null"
              ]
            },
            "available_credit": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Available credit in cents."
            },
            "credit_limit": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Credit limit in cents."
            },
            "usage_pattern": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "auto_loan": {
          "type": [
            "object",
            "null"
          ],
          "description": "Auto loan update data. Present when `type` is `auto_loan`.",
          "properties": {
            "sub_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "last_payment_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Last payment amount in cents."
            },
            "last_payment_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_due_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_minimum_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Minimum payment due in cents."
            },
            "interest_rate_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "expected_payoff_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "original_loan_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Original loan amount in cents."
            },
            "term_length": {
              "type": [
                "integer",
                "null"
              ]
            },
            "interest_rate_percentage": {
              "type": [
                "number",
                "null"
              ]
            },
            "interest_rate_source": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "mortgage": {
          "type": [
            "object",
            "null"
          ],
          "description": "Mortgage update data. Present when `type` is `mortgage`.",
          "properties": {
            "sub_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "last_payment_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Last payment amount in cents."
            },
            "last_payment_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_due_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_minimum_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Minimum payment due in cents."
            },
            "interest_rate_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "expected_payoff_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "original_loan_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Original loan amount in cents."
            },
            "term_length": {
              "type": [
                "integer",
                "null"
              ]
            },
            "interest_rate_percentage": {
              "type": [
                "number",
                "null"
              ]
            },
            "interest_rate_source": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "personal_loan": {
          "type": [
            "object",
            "null"
          ],
          "description": "Personal loan update data. Present when `type` is `personal_loan`.",
          "properties": {
            "sub_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "last_payment_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Last payment amount in cents."
            },
            "last_payment_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_due_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_minimum_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Minimum payment due in cents."
            },
            "interest_rate_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "available_credit": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Available credit in cents."
            },
            "original_loan_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Original loan amount in cents."
            },
            "term_length": {
              "type": [
                "integer",
                "null"
              ]
            },
            "interest_rate_percentage": {
              "type": [
                "number",
                "null"
              ]
            },
            "interest_rate_source": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "student_loan": {
          "type": [
            "object",
            "null"
          ],
          "description": "Student loan update data. Present when `type` is `student_loan`.",
          "properties": {
            "sub_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "last_payment_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Last payment amount in cents."
            },
            "last_payment_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_due_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_minimum_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Minimum payment due in cents."
            },
            "interest_rate_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "expected_payoff_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "original_loan_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Original loan amount in cents."
            },
            "term_length": {
              "type": [
                "integer",
                "null"
              ]
            },
            "interest_rate_percentage": {
              "type": [
                "number",
                "null"
              ]
            },
            "interest_rate_source": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "student_loans": {
          "type": [
            "object",
            "null"
          ],
          "description": "Student loans aggregate update data. Present when `type` is `student_loans`.",
          "properties": {
            "sub_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "last_payment_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Last payment amount in cents."
            },
            "last_payment_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_due_date": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "next_payment_minimum_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Minimum payment due in cents."
            },
            "interest_rate_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "disbursements": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "object"
              }
            },
            "original_loan_amount": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Original loan amount in cents."
            },
            "interest_rate_percentage": {
              "type": [
                "number",
                "null"
              ]
            },
            "interest_rate_source": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "bnpl": {
          "type": [
            "object",
            "null"
          ],
          "description": "Buy now pay later update data. Present when `type` is `bnpl`.",
          "properties": {
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        },
        "fintech": {
          "type": [
            "object",
            "null"
          ],
          "description": "Fintech account update data. Present when `type` is `fintech`.",
          "properties": {
            "balance": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Current balance in cents."
            },
            "opened_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "closed_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        },
        "error": {
          "$ref": "#/$defs/UpdateResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the update was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the update was last updated."
        }
      }
    },
    "AccountVerificationSession": {
      "type": "object",
      "description": "A verification session for an account.",
      "required": [
        "id",
        "account_id",
        "status",
        "type",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the verification session.",
          "pattern": "^avf_\\w+$"
        },
        "account_id": {
          "type": "string",
          "description": "The account this verification session belongs to.",
          "pattern": "^acc_\\w+$"
        },
        "status": {
          "type": "string",
          "description": "Current status of the verification session.",
          "enum": [
            "pending",
            "in_progress",
            "verified",
            "failed"
          ]
        },
        "type": {
          "type": "string",
          "description": "The type of verification.",
          "enum": [
            "micro_deposits",
            "mx",
            "plaid",
            "teller",
            "auto_verify",
            "trusted_provisioner",
            "pre_auth",
            "standard",
            "issuer",
            "instant",
            "network",
            "three_ds"
          ]
        },
        "micro_deposits": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type micro_deposits.",
          "properties": {
            "amounts": {
              "type": "array",
              "description": "The latest amounts that this verification session was updated with.",
              "items": {
                "type": "integer"
              }
            }
          }
        },
        "plaid": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type plaid.",
          "properties": {
            "balances": {
              "type": "object",
              "description": "The raw balance data received from Plaid."
            },
            "transactions": {
              "type": "array",
              "description": "The raw transaction data received from Plaid.",
              "items": {
                "type": "object"
              }
            }
          }
        },
        "mx": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type mx.",
          "properties": {
            "account": {
              "type": "object",
              "description": "The raw account data received from MX."
            },
            "transactions": {
              "type": "array",
              "description": "The raw transaction data received from MX.",
              "items": {
                "type": "object"
              }
            }
          }
        },
        "teller": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type teller.",
          "properties": {
            "balances": {
              "type": "object",
              "description": "The raw balance data received from Teller."
            },
            "transactions": {
              "type": "array",
              "description": "The raw transaction data received from Teller.",
              "items": {
                "type": "object"
              }
            }
          }
        },
        "auto_verify": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type auto_verify."
        },
        "trusted_provisioner": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type trusted_provisioner."
        },
        "standard": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type standard.",
          "properties": {
            "number": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card number. Null if the number still needs to be provided."
            }
          }
        },
        "pre_auth": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type pre_auth.",
          "properties": {
            "number": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card number. Null if the number still needs to be provided."
            },
            "exp_month": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card expiration month. Null if it still needs to be provided."
            },
            "exp_year": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card expiration year. Null if it still needs to be provided."
            },
            "exp_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The card expiration verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            },
            "cvv": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card CVV. Null if it still needs to be provided."
            },
            "cvv_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The card CVV verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            },
            "billing_zip_code": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked billing zip code."
            },
            "billing_zip_code_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The billing zip code verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            },
            "pre_auth_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The pre-auth verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            }
          }
        },
        "network": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type network.",
          "properties": {
            "number": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card number. Null if the number still needs to be provided."
            },
            "exp_month": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card expiration month. Null if it still needs to be provided."
            },
            "exp_year": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card expiration year. Null if it still needs to be provided."
            },
            "exp_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The card expiration verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            },
            "cvv": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card CVV. Null if it still needs to be provided."
            },
            "cvv_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The card CVV verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            },
            "billing_zip_code": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked billing zip code."
            },
            "billing_zip_code_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The billing zip code verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            },
            "network_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The network verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            }
          }
        },
        "instant": {
          "type": [
            "object",
            "null"
          ],
          "description": "Populated when the verification session is of type instant.",
          "properties": {
            "number": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card number. Null if the number still needs to be provided."
            },
            "exp_month": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card expiration month. Null if it still needs to be provided."
            },
            "exp_year": {
              "type": [
                "string",
                "null"
              ],
              "description": "The masked card expiration year. Null if it still needs to be provided."
            },
            "exp_check": {
              "type": [
                "string",
                "null"
              ],
              "description": "The card expiration verification check result.",
              "enum": [
                "pass",
                "fail",
                "unavailable"
              ]
            }
          }
        },
        "error": {
          "$ref": "#/$defs/AccountVerificationSessionResourceError"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the verification session was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the verification session was last updated."
        }
      }
    },
    "AccountVerificationSessionResourceError": {
      "type": [
        "object",
        "null"
      ],
      "description": "Error details when an account verification session fails.",
      "required": [
        "type",
        "code",
        "sub_type",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The category of verification session error.",
          "enum": [
            "ACCOUNT_VERIFICATION_SESSION_FAILED"
          ]
        },
        "code": {
          "type": "integer",
          "description": "Numeric error code (16XXX range).",
          "enum": [
            16001,
            16002,
            16003,
            16004
          ]
        },
        "sub_type": {
          "type": "string",
          "description": "Specific verification session error classification.",
          "enum": [
            "VERIFICATION_TYPE_NOT_SUPPORTED",
            "INVALID_DETAILS",
            "VERIFICATION_SESSION_ATTEMPT_LIMIT_REACHED",
            "MICRO_DEPOSITS_FAILED"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        }
      }
    },
    "BalanceResourceError": {
      "type": [
        "object",
        "null"
      ],
      "description": "Error details when a balance sync fails.",
      "required": [
        "type",
        "code",
        "sub_type",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The category of balance error.",
          "enum": [
            "BALANCE_FAILED"
          ]
        },
        "code": {
          "type": "integer",
          "description": "Numeric error code (20XXX range).",
          "enum": [
            20001
          ]
        },
        "sub_type": {
          "type": "string",
          "description": "Specific balance error classification.",
          "enum": [
            "BALANCE_TEMPORARILY_UNAVAILABLE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        }
      }
    },
    "Merchant": {
      "type": "object",
      "required": [
        "id",
        "parent_name",
        "name",
        "logo",
        "type",
        "provider_ids",
        "is_temp",
        "account_number_formats"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the merchant."
        },
        "parent_name": {
          "type": "string",
          "description": "Name of the parent merchant group."
        },
        "name": {
          "type": "string",
          "description": "Display name of the merchant."
        },
        "logo": {
          "type": "string",
          "description": "URL of the merchant logo."
        },
        "type": {
          "$ref": "#/$defs/MerchantType",
          "description": "Type of accounts supported by this merchant."
        },
        "provider_ids": {
          "$ref": "#/$defs/MerchantProviderIds"
        },
        "is_temp": {
          "type": "boolean",
          "description": "Whether this is a temporary merchant entry."
        },
        "account_number_formats": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Accepted account number formats."
        }
      }
    },
    "MerchantProviderIds": {
      "type": "object",
      "properties": {
        "plaid": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mx": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "finicity": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dpp": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rpps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "MerchantType": {
      "type": "string",
      "enum": [
        "auto_loan",
        "bank",
        "bnpl",
        "business_loan",
        "city",
        "collection",
        "county",
        "credit_builder",
        "credit_card",
        "electric_utility",
        "fintech",
        "home_equity_loan",
        "home_loan",
        "insurance",
        "internet_utility",
        "loan",
        "medical",
        "mortgage",
        "personal_loan",
        "student_loan",
        "student_loans",
        "subscription",
        "telephone_utility",
        "television_utility",
        "unknown",
        "utility",
        "waste_utility",
        "water_utility"
      ]
    },
    "Metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Arbitrary key-value metadata attached to the resource."
    },
    "Payment": {
      "type": "object",
      "description": "A Payment represents a transfer of funds between two accounts.",
      "required": [
        "id",
        "source",
        "destination",
        "amount",
        "status",
        "type",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the payment.",
          "pattern": "^pmt_\\w+$"
        },
        "reversal_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Identifier of the associated reversal, if any.",
          "pattern": "^rvs_\\w+$"
        },
        "reversal_account": {
          "type": [
            "string",
            "null"
          ],
          "description": "Account ID used for the reversal leg of the payment.",
          "pattern": "^acc_\\w+$"
        },
        "payment_instrument": {
          "type": [
            "string",
            "null"
          ],
          "description": "Identifier of the payment instrument used to create this payment, if any.",
          "pattern": "^pmt_inst_\\w+$"
        },
        "source_trace_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Trace identifier for the source side of the payment."
        },
        "destination_trace_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Trace identifier for the destination side of the payment."
        },
        "source": {
          "title": "PaymentExpandableSource",
          "description": "The source account ID. This field is expandable. When expanded, returns the full Account object.\n",
          "anyOf": [
            {
              "type": "string",
              "pattern": "^acc_\\w+$"
            },
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Account"
            }
          ]
        },
        "destination": {
          "title": "PaymentExpandableDestination",
          "description": "The destination account ID. This field is expandable. When expanded, returns the full Account object.\n",
          "anyOf": [
            {
              "type": "string",
              "pattern": "^acc_\\w+$"
            },
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Account"
            }
          ]
        },
        "amount": {
          "type": "integer",
          "description": "Payment amount in cents.",
          "minimum": 0
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Human-readable description for the payment."
        },
        "status": {
          "type": "string",
          "description": "Current status of the payment.",
          "enum": [
            "pending",
            "processing",
            "sent",
            "posted",
            "settled",
            "failed",
            "reversed",
            "canceled",
            "cashed"
          ]
        },
        "fund_status": {
          "type": [
            "string",
            "null"
          ],
          "description": "The current status of the payment funds.",
          "enum": [
            "transmitting",
            "transmitted",
            "requested",
            "clearing",
            "pending",
            "hold",
            "sent",
            "posted",
            "cashed",
            "unknown",
            "pending_consolidation",
            "pending_clearing",
            "failed",
            null
          ]
        },
        "estimated_completion_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Estimated date when the payment will be completed (YYYY-MM-DD)."
        },
        "source_settlement_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "The expected or actual settlement date for the source side of the payment."
        },
        "destination_settlement_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "The expected or actual settlement date for the destination side of the payment."
        },
        "source_status": {
          "type": [
            "string",
            "null"
          ],
          "description": "The status of the source side of the payment."
        },
        "destination_status": {
          "type": [
            "string",
            "null"
          ],
          "description": "The status of the destination side of the payment."
        },
        "destination_payment_method": {
          "type": [
            "string",
            "null"
          ],
          "description": "The payment method used for the destination."
        },
        "fee": {
          "type": [
            "object",
            "null"
          ],
          "description": "Fee associated with the payment.",
          "required": [
            "type",
            "amount"
          ],
          "properties": {
            "type": {
              "type": "string",
              "description": "The fee type.",
              "enum": [
                "total"
              ]
            },
            "amount": {
              "type": "integer",
              "description": "Fee amount in cents.",
              "minimum": 0
            }
          }
        },
        "type": {
          "type": "string",
          "description": "The type of payment.",
          "enum": [
            "standard",
            "clearing"
          ]
        },
        "error": {
          "$ref": "#/$defs/PaymentResourceError"
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the payment was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the payment was last updated."
        }
      }
    },
    "PaymentResourceError": {
      "type": [
        "object",
        "null"
      ],
      "description": "Error details when a payment fails or is canceled.",
      "required": [
        "type",
        "code",
        "sub_type",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The category of payment error.",
          "enum": [
            "PAYMENT_FAILED",
            "PAYMENT_CANCELED"
          ]
        },
        "code": {
          "type": "integer",
          "description": "Numeric error code (10XXX range).",
          "enum": [
            10001,
            10002,
            10003,
            10004,
            10005,
            10006,
            10007,
            10008,
            10009,
            10010
          ]
        },
        "sub_type": {
          "type": "string",
          "description": "Specific payment error classification.",
          "enum": [
            "PAYMENT_INSUFFICIENT_FUNDS",
            "PAYMENT_UNAUTHORIZED",
            "PAYMENT_INVALID_ACCOUNT",
            "PAYMENT_UNAUTHORIZED_SOURCE",
            "PAYMENT_UNAUTHORIZED_DESTINATION",
            "PAYMENT_INVALID_SOURCE_ACCOUNT",
            "PAYMENT_INVALID_DESTINATION_ACCOUNT",
            "PAYMENT_REJECTED_BY_DESTINATION_INSTITUTION",
            "PAYMENT_REJECTED_INVALID_AMOUNT"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        }
      }
    },
    "PayoffResourceError": {
      "type": [
        "object",
        "null"
      ],
      "description": "Error details when a payoff sync fails.",
      "required": [
        "type",
        "code",
        "sub_type",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The category of payoff error.",
          "enum": [
            "PAYOFF_FAILED"
          ]
        },
        "code": {
          "type": "integer",
          "description": "Numeric error code (18XXX range).",
          "enum": [
            18001
          ]
        },
        "sub_type": {
          "type": "string",
          "description": "Specific payoff error classification.",
          "enum": [
            "PAYOFF_TEMPORARILY_UNAVAILABLE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        }
      }
    },
    "ResourceError": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "type",
        "code",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "code": {
          "type": "integer"
        },
        "sub_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        }
      }
    },
    "SuccessEnvelope": {
      "type": "object",
      "description": "Standard envelope for successful responses that return a single payload.",
      "required": [
        "success",
        "data",
        "message"
      ],
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Always `true` for successful responses."
        },
        "data": {
          "description": "Operation-specific response payload."
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "UpdateResourceError": {
      "type": [
        "object",
        "null"
      ],
      "description": "Error details when an account update fails.",
      "required": [
        "type",
        "code",
        "sub_type",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The category of update error.",
          "enum": [
            "UPDATE_FAILED"
          ]
        },
        "code": {
          "type": "integer",
          "description": "Numeric error code (21XXX range).",
          "enum": [
            21001
          ]
        },
        "sub_type": {
          "type": "string",
          "description": "Specific update error classification.",
          "enum": [
            "UPDATE_TEMPORARILY_UNAVAILABLE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        }
      }
    }
  }
}