{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woolworths-group/main/json-schema/woolworths-group-cnp-refunds-response-schema.json",
  "title": "CnpRefundsResponse",
  "x-generated": "2026-10-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/woolworths-group-wpay-cards-connect-openapi.yml#/components/schemas/CnpRefundsResponse",
  "required": [
    "browserViewLink",
    "permittedActionHints",
    "reconciliationId",
    "refunds",
    "transactionId"
  ],
  "type": "object",
  "properties": {
    "transactionId": {
      "type": "string",
      "description": "The unique identifier of the transaction passed during the authorization request"
    },
    "reconciliationId": {
      "type": "string",
      "description": "Reconciliation id passed during the authorization request"
    },
    "permittedActionHints": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PermittedTransactionOperationHint"
      },
      "description": "Provides hints of permitted actions based on the state of the transaction"
    },
    "browserViewLink": {
      "type": [
        "string",
        "null"
      ],
      "description": "A direct link for viewing the transaction in the Cards Connect Portal for end-users."
    },
    "refunds": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/RefundResponse"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "PermittedTransactionOperationHint": {
      "enum": [
        "Capture",
        "Void",
        "Refund"
      ],
      "type": "string",
      "description": "Hints for transaction operation permitted for the given transaction state "
    },
    "RefundResponse": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the refund operation, as passed during the refund request."
        },
        "amount": {
          "type": "integer",
          "description": "Amount of the refund operation in cents as it was provided in the request.",
          "format": "int32"
        },
        "outcome": {
          "$ref": "#/$defs/TransactionOutcome"
        },
        "responseCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Response code for the refund as per AS2805 specifications."
        },
        "responseDescription": {
          "type": [
            "string",
            "null"
          ],
          "description": "Response description for the refund as per AS2805 specifications."
        },
        "createdAt": {
          "type": "string",
          "description": "Date and time when this refund was created in our system.",
          "format": "date-time"
        },
        "schemeExtendedResponseData": {
          "$ref": "#/$defs/SchemeExtendedResponseData"
        }
      },
      "additionalProperties": false
    },
    "SchemeExtendedResponseData": {
      "type": "object",
      "properties": {
        "mastercardTransactionLinkId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Mastercard Transaction Link Identifier (TLID) used by Mastercard to link different events in the lifecycle of a transaction."
        }
      },
      "additionalProperties": false
    },
    "TransactionOutcome": {
      "enum": [
        "Accepted",
        "InProgress",
        "InProgressDelayed",
        "Succeeded",
        "Declined",
        "BusyFailing",
        "BusyFailingDelayed",
        "Failed",
        "Ruined"
      ],
      "type": "string"
    }
  }
}