{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-payout-schema.json",
  "title": "Payout",
  "description": "RazorpayX payout disbursement. Idempotency header X-Payout-Idempotency required since March 15, 2025.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-x-payouts-api-openapi.yml#/components/schemas/Payout",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Payout ID (pout_*)"
    },
    "entity": {
      "type": "string",
      "enum": [
        "payout"
      ]
    },
    "fund_account_id": {
      "type": "string"
    },
    "fund_account": {
      "$ref": "#/$defs/FundAccount"
    },
    "amount": {
      "type": "integer",
      "minimum": 100,
      "description": "Amount in paise (min 100)"
    },
    "currency": {
      "type": "string",
      "enum": [
        "INR"
      ]
    },
    "fees": {
      "type": "integer"
    },
    "tax": {
      "type": "integer"
    },
    "mode": {
      "type": "string",
      "enum": [
        "NEFT",
        "RTGS",
        "IMPS",
        "UPI",
        "card",
        "amazonpay"
      ],
      "description": "Transfer mode — case-sensitive. amazonpay limited to ₹10,000 per transaction; no custom narration allowed."
    },
    "utr": {
      "type": "string",
      "description": "Unique Transaction Reference from bank"
    },
    "reference_id": {
      "type": "string",
      "maxLength": 40
    },
    "debit_account_number": {
      "type": "string"
    },
    "narration": {
      "type": "string",
      "maxLength": 30
    },
    "purpose": {
      "type": "string",
      "enum": [
        "refund",
        "cashback",
        "payout",
        "salary",
        "utility bill",
        "vendor bill"
      ]
    },
    "fee_type": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "pending",
        "rejected",
        "processing",
        "processed",
        "cancelled",
        "reversed",
        "failed"
      ]
    },
    "status_details": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "batch_id": {
      "type": "string"
    },
    "notes": {
      "type": "object"
    },
    "created_at": {
      "type": "integer"
    },
    "queue_if_low_balance": {
      "type": "boolean",
      "description": "true: queue payout when account balance is insufficient. false (default): fail immediately."
    }
  },
  "$defs": {
    "FundAccount": {
      "type": "object",
      "description": "Payout destination linked to a Contact. Immutable after creation.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Fund account ID (fa_*)"
        },
        "entity": {
          "type": "string",
          "enum": [
            "fund_account"
          ]
        },
        "contact_id": {
          "type": "string"
        },
        "account_type": {
          "type": "string",
          "enum": [
            "bank_account",
            "vpa",
            "card",
            "wallet"
          ]
        },
        "active": {
          "type": "boolean"
        },
        "batch_id": {
          "type": "string"
        },
        "bank_account": {
          "type": "object",
          "properties": {
            "ifsc": {
              "type": "string"
            },
            "bank_name": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "account_number": {
              "type": "string"
            }
          }
        },
        "vpa": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string"
            },
            "handle": {
              "type": "string"
            },
            "address": {
              "type": "string"
            }
          }
        },
        "card": {
          "type": "object",
          "properties": {
            "last4": {
              "type": "string"
            },
            "network": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "issuer": {
              "type": "string"
            },
            "input_type": {
              "type": "string",
              "enum": [
                "razorpay_token",
                "service_provider_token",
                "raw"
              ]
            }
          }
        },
        "created_at": {
          "type": "integer"
        },
        "wallet": {
          "type": "object",
          "description": "Amazon Pay wallet details. Required when account_type=wallet.",
          "properties": {
            "provider": {
              "type": "string",
              "enum": [
                "amazonpay"
              ]
            },
            "phone": {
              "type": "string",
              "description": "10-digit phone with country code, e.g. +919876543210"
            },
            "email": {
              "type": "string",
              "format": "email"
            },
            "name": {
              "type": "string",
              "minLength": 4,
              "maxLength": 120,
              "description": "Wallet holder name. Case-sensitive. Supported: a-z, A-Z, 0-9, space, ', -, _, /, (, ), ."
            }
          }
        }
      }
    }
  }
}