{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-refund-schema.json",
  "title": "Refund",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-refunds-api-openapi.yml#/components/schemas/Refund",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique refund identifier. Prefix: rfnd_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "refund"
      ]
    },
    "amount": {
      "type": "integer",
      "description": "Refund amount in paise."
    },
    "currency": {
      "type": "string"
    },
    "payment_id": {
      "type": "string",
      "description": "The original payment ID (pay_*)."
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "receipt": {
      "type": "string",
      "description": "Your internal reference identifier."
    },
    "acquirer_data": {
      "type": "object",
      "description": "Bank reference numbers for tracking: RRN (UPI/netbanking), ARN (cards), UTR (NEFT/RTGS).",
      "properties": {
        "arn": {
          "type": "string"
        },
        "rrn": {
          "type": "string"
        },
        "utr": {
          "type": "string"
        }
      }
    },
    "created_at": {
      "type": "integer"
    },
    "batch_id": {
      "type": "string",
      "description": "Set if refund was part of a batch upload."
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "processed",
        "failed"
      ],
      "description": "pending: being processed. processed: credited to customer. failed: refund failed."
    },
    "speed_requested": {
      "type": "string",
      "enum": [
        "normal",
        "optimum"
      ],
      "description": "normal: 5-7 business days. optimum: instant if available, falls back to normal."
    },
    "speed_processed": {
      "type": "string",
      "enum": [
        "instant",
        "normal"
      ],
      "description": "Actual processing mode used."
    }
  },
  "$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
    }
  }
}