{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-instant-settlement-schema.json",
  "title": "InstantSettlement",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-instant-settlements-api-openapi.yml#/components/schemas/InstantSettlement",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique instant settlement identifier. Prefix: setlod_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "settlement.ondemand"
      ]
    },
    "amount_requested": {
      "type": "integer",
      "description": "Settlement amount requested (paise)."
    },
    "amount_settled": {
      "type": "integer",
      "description": "Total amount transferred minus fees and tax (paise)."
    },
    "amount_pending": {
      "type": "integer",
      "description": "Portion of requested amount yet to be settled (paise)."
    },
    "amount_reversed": {
      "type": "integer",
      "description": "Amount returned to PG balance (paise)."
    },
    "fees": {
      "type": "integer",
      "description": "Combined fees and tax deducted (paise)."
    },
    "tax": {
      "type": "integer",
      "description": "Tax on fee component (paise)."
    },
    "currency": {
      "type": "string"
    },
    "settle_full_balance": {
      "type": "boolean",
      "description": "If true, settles maximum available balance."
    },
    "status": {
      "type": "string",
      "enum": [
        "created",
        "initiated",
        "partially_processed",
        "processed",
        "reversed"
      ]
    },
    "description": {
      "type": "string",
      "description": "Custom reference note. Max 30 alphanumeric characters."
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "created_at": {
      "type": "integer"
    },
    "ondemand_payouts": {
      "type": "object",
      "description": "Collection of individual payout records for this instant settlement.",
      "properties": {
        "entity": {
          "type": "string",
          "enum": [
            "collection"
          ]
        },
        "count": {
          "type": "integer"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InstantSettlementPayout"
          }
        }
      }
    }
  },
  "$defs": {
    "InstantSettlementPayout": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "entity": {
          "type": "string",
          "enum": [
            "settlement.ondemand_payout"
          ]
        },
        "initiated_at": {
          "type": "integer"
        },
        "processed_at": {
          "type": "integer"
        },
        "reversed_at": {
          "type": "integer"
        },
        "amount": {
          "type": "integer"
        },
        "amount_settled": {
          "type": "integer"
        },
        "fees": {
          "type": "integer"
        },
        "tax": {
          "type": "integer"
        },
        "utr": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "created",
            "initiated",
            "processed",
            "reversed"
          ]
        },
        "created_at": {
          "type": "integer"
        }
      }
    },
    "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
    }
  }
}