{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/subotiz-com/json-schema/subotiz-com-query-refund-response-schema.json",
  "title": "QueryRefundResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/subotiz-com-refund-api-openapi.yml#/components/schemas/QueryRefundResponse",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "error code"
    },
    "message": {
      "type": "string",
      "description": "error message"
    },
    "data": {
      "$ref": "#/$defs/QueryRefundResponse_Data"
    }
  },
  "$defs": {
    "FailureReason": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "System returned transaction return code"
        },
        "message": {
          "type": "string",
          "description": "System returned transaction return description"
        }
      }
    },
    "QueryRefundResponse_Data": {
      "type": "object",
      "properties": {
        "refund_id": {
          "type": "string",
          "description": "Refund ID"
        },
        "trade_id": {
          "type": "string",
          "description": "Trade ID"
        },
        "currency": {
          "type": "string",
          "description": "Transaction currency corresponding to the amount, encoded according to ISO4217"
        },
        "callback_url": {
          "type": "string",
          "description": "Webhook notification callback URL"
        },
        "reason": {
          "type": "string",
          "description": "Refund reason"
        },
        "refund_amount": {
          "type": "string",
          "description": "Refund amount"
        },
        "refund_status": {
          "type": "string",
          "description": "Refund status\n- pending: Processing\n- failed: Refund failed\n- succeeded: Refund successful"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A set of key-value pairs that can be attached to an object, allowing you to store additional information in a structured format."
        },
        "failure_reason": {
          "allOf": [
            {
              "$ref": "#/$defs/FailureReason"
            }
          ],
          "description": "Refund failure reason"
        },
        "ref_arn": {
          "type": "string",
          "description": "Refund credential returned by the issuing bank"
        },
        "finished_at": {
          "type": "string",
          "description": "Refund completion time"
        },
        "item_refund_amount": {
          "type": "string",
          "description": "Item-side refund amount (numeric string)"
        },
        "tax_refund_amount": {
          "type": "string",
          "description": "Tax-side refund amount (numeric string); for non-taxable refunds use \"0\""
        }
      }
    }
  }
}