{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-xtransaction-schema.json",
  "title": "XTransaction",
  "description": "RazorpayX transaction record — inflow (bank_transfer credit) or outflow (payout debit).",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-x-transactions-api-openapi.yml#/components/schemas/XTransaction",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Transaction ID (txn_*)"
    },
    "entity": {
      "type": "string",
      "enum": [
        "transaction"
      ]
    },
    "account_number": {
      "type": "string",
      "description": "RazorpayX account number"
    },
    "amount": {
      "type": "integer",
      "description": "Amount in paise (does not include fees/tax)"
    },
    "currency": {
      "type": "string",
      "enum": [
        "INR"
      ]
    },
    "credit": {
      "type": "integer",
      "description": "Amount credited in paise; 0 for debits"
    },
    "debit": {
      "type": "integer",
      "description": "Amount debited in paise; 0 for credits"
    },
    "balance": {
      "type": "integer",
      "description": "Remaining account balance in paise after this transaction"
    },
    "source": {
      "type": "object",
      "description": "Source entity — either a payout (debit) or bank_transfer (credit)",
      "properties": {
        "id": {
          "type": "string",
          "description": "pout_* for payouts, bt_* for bank transfers"
        },
        "entity": {
          "type": "string",
          "enum": [
            "payout",
            "bank_transfer"
          ]
        },
        "amount": {
          "type": "integer"
        },
        "fund_account_id": {
          "type": "string",
          "description": "Payout only"
        },
        "notes": {
          "type": "object",
          "description": "Payout only"
        },
        "fees": {
          "type": "integer",
          "description": "Payout only, populated at processing state"
        },
        "tax": {
          "type": "integer",
          "description": "Payout only, populated at processing state"
        },
        "status": {
          "type": "string",
          "description": "Payout only"
        },
        "utr": {
          "type": "string",
          "description": "Payout only"
        },
        "mode": {
          "type": "string",
          "description": "Payout only"
        },
        "fee_type": {
          "type": "string"
        },
        "payer_name": {
          "type": "string",
          "description": "bank_transfer only"
        },
        "payer_account": {
          "type": "string",
          "description": "bank_transfer only"
        },
        "payer_ifsc": {
          "type": "string",
          "description": "bank_transfer only"
        },
        "bank_reference": {
          "type": "string",
          "description": "bank_transfer only"
        },
        "created_at": {
          "type": "integer"
        }
      }
    },
    "created_at": {
      "type": "integer",
      "description": "Unix timestamp"
    }
  }
}