{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-bank-transfer-schema.json",
  "title": "BankTransfer",
  "description": "A payment received into a Virtual Account via bank transfer (NEFT/RTGS/IMPS/UPI). Created automatically when a payer sends funds to the virtual account. Prefix: bt_",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-virtual-accounts-api-openapi.yml#/components/schemas/BankTransfer",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Bank transfer ID. Prefix: bt_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "bank_transfer"
      ]
    },
    "payment_id": {
      "type": "string",
      "description": "Razorpay payment ID generated for this bank transfer (pay_*)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "NEFT",
        "RTGS",
        "IMPS",
        "UPI"
      ],
      "description": "Transfer mode used by the payer."
    },
    "amount": {
      "type": "integer",
      "description": "Amount received in paise."
    },
    "payer_bank_account": {
      "type": "object",
      "description": "Payer's bank account details.",
      "properties": {
        "id": {
          "type": "string"
        },
        "entity": {
          "type": "string",
          "enum": [
            "bank_account"
          ]
        },
        "ifsc": {
          "type": "string"
        },
        "bank_name": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Account holder name."
        },
        "notes": {
          "$ref": "#/$defs/Notes"
        },
        "account_number": {
          "type": "string"
        }
      }
    },
    "bank_reference": {
      "type": "string",
      "description": "UTR (Unique Transaction Reference) number from the bank."
    },
    "virtual_account_id": {
      "type": "string",
      "description": "Virtual account that received this transfer (va_*)."
    },
    "virtual_account": {
      "$ref": "#/$defs/VirtualAccount"
    }
  },
  "$defs": {
    "Notes": {
      "type": "object",
      "description": "Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.",
      "additionalProperties": {
        "type": "string"
      },
      "maxProperties": 15
    },
    "VirtualAccount": {
      "type": "object",
      "description": "A virtual bank account or VPA that accepts NEFT/RTGS/IMPS/UPI payments (Smart Collect). Each payment creates a BankTransfer entity. Auto-closes after 90 days of inactivity. Prefix: va_",
      "properties": {
        "id": {
          "type": "string",
          "description": "Virtual account ID. Prefix: va_"
        },
        "name": {
          "type": "string",
          "description": "Display name of the virtual account."
        },
        "entity": {
          "type": "string",
          "enum": [
            "virtual_account"
          ]
        },
        "description": {
          "type": "string",
          "description": "Purpose or description of the virtual account."
        },
        "amount_expected": {
          "type": "integer",
          "description": "Expected payment amount in paise. 0 means any amount is accepted."
        },
        "amount_paid": {
          "type": "integer",
          "description": "Total amount received so far in paise."
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "closed"
          ],
          "description": "active = accepting payments; closed = no longer accepting payments."
        },
        "receivers": {
          "type": "array",
          "description": "Payment receivers assigned to this virtual account. Can include bank_account (ba_*) and/or vpa (vpa_*) receivers.",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Receiver ID. Prefix: ba_ for bank account, vpa_ for VPA."
              },
              "entity": {
                "type": "string",
                "enum": [
                  "bank_account",
                  "vpa"
                ]
              },
              "ifsc": {
                "type": "string",
                "description": "IFSC code (bank accounts only)."
              },
              "bank_name": {
                "type": "string",
                "description": "Bank name (bank accounts only)."
              },
              "name": {
                "type": "string",
                "description": "Account holder name (bank accounts) or VPA address (VPAs)."
              },
              "notes": {
                "$ref": "#/$defs/Notes"
              },
              "account_number": {
                "type": "string",
                "description": "Virtual account number (bank accounts only)."
              },
              "username": {
                "type": "string",
                "description": "UPI username part of the VPA (VPAs only)."
              },
              "handle": {
                "type": "string",
                "description": "UPI handle (e.g., razorpay) (VPAs only)."
              },
              "flow": {
                "type": "string",
                "enum": [
                  "upi_qr"
                ],
                "description": "Flow type for VPA receivers."
              }
            }
          }
        },
        "close_by": {
          "type": "integer",
          "description": "Unix timestamp by which the account will auto-close. Maximum value: 2147483647."
        },
        "closed_at": {
          "type": "integer",
          "description": "Unix timestamp when the account was closed."
        },
        "customer_id": {
          "type": "string",
          "description": "Customer ID linked to this virtual account (cust_*)."
        },
        "notes": {
          "$ref": "#/$defs/Notes"
        },
        "created_at": {
          "type": "integer"
        }
      }
    }
  }
}