{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woolworths-group/main/json-schema/woolworths-group-merchant-api-application-queries-view-models-refund-details-by-refund-id-view-model-schema.json",
  "title": "Merchant.API.Application.Queries.ViewModels.RefundDetailsByRefundIdViewModel",
  "x-generated": "2026-10-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/woolworths-group-wpay-payto-merchant-openapi.yml#/components/schemas/Merchant.API.Application.Queries.ViewModels.RefundDetailsByRefundIdViewModel",
  "required": [
    "amount",
    "createdTimestamp",
    "merchantId",
    "paymentId",
    "status",
    "statusTimestamp"
  ],
  "type": "object",
  "properties": {
    "merchantId": {
      "minLength": 1,
      "type": "string",
      "description": "ID of the merchant."
    },
    "refundId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID of the refund which was initiated."
    },
    "paymentId": {
      "minLength": 1,
      "type": "string",
      "description": "ID of the original payment for which this refund was initiated."
    },
    "amount": {
      "maximum": 100000000,
      "minimum": 1,
      "type": "integer",
      "description": "Refund amount in cents.",
      "format": "int32"
    },
    "reference": {
      "maximum": 35,
      "minimum": 1,
      "type": [
        "string",
        "null"
      ],
      "description": "The refund reference that was provided to buyer.<br/>Note: this value is visible to buyers in their banking statements."
    },
    "description": {
      "maximum": 280,
      "minimum": 1,
      "type": [
        "string",
        "null"
      ],
      "description": "The additional free form refund description that was provided to the buyer.<br/>Note: this value is visible to buyers in their banking statements."
    },
    "merchantWebhooksUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Merchant's supplied URL that should receive webhooks for this refund."
    },
    "createdTimestamp": {
      "type": "string",
      "description": "Refund record creation date and time stamp. Value is in UTC",
      "format": "date-time"
    },
    "statusTimestamp": {
      "type": "string",
      "description": "Refund transaction status latest update date and time stamp. Value is in UTC",
      "format": "date-time"
    },
    "status": {
      "$ref": "#/$defs/Merchant.API.Application.Queries.ViewModels.Enums.MerchantStatus"
    },
    "rejectionReason": {
      "$ref": "#/$defs/Merchant.API.Application.Queries.ViewModels.RefundRejectionReasonViewModel"
    },
    "merchantDefinedData": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "An optional object for passing any additional key-value pairs that might be useful to the merchant."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Merchant.API.Application.Queries.ViewModels.Enums.MerchantStatus": {
      "title": "Status",
      "enum": [
        "Processing",
        "Completed",
        "Rejected"
      ],
      "type": "string",
      "description": "Latest payment status. <br/>Processing indicates the payment is still being processed by the NPP. <br/>Completed indicates the payment has been successfully settled and funds transfer is complete.<br/>Rejected indicates the payment has failed and funds transfer was not performed."
    },
    "Merchant.API.Application.Queries.ViewModels.RefundRejectionReasonViewModel": {
      "title": "object",
      "required": [
        "code",
        "detail",
        "title"
      ],
      "type": "object",
      "properties": {
        "code": {
          "minLength": 1,
          "type": "string",
          "description": "Refund rejection reason code. Note: this is an internal value and is not intended to be displayed to consumers."
        },
        "title": {
          "minLength": 1,
          "type": "string",
          "description": "Refund rejection reason title. Note: this value can be displayed to consumers."
        },
        "detail": {
          "minLength": 1,
          "type": "string",
          "description": "Refund rejection reason details. Note: this value may be displayed to consumers."
        }
      },
      "additionalProperties": false,
      "description": "Rejection reason details in case of refund failure."
    }
  }
}