{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woolworths-group/main/json-schema/woolworths-group-cnp-transaction-detail-response-schema.json",
  "title": "CnpTransactionDetailResponse",
  "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/CnpTransactionDetailResponse",
  "required": [
    "authorization",
    "authorizedAmount",
    "browserViewLink",
    "capturedAmount",
    "captures",
    "cardMetaData",
    "createdAt",
    "currency",
    "permittedActionHints",
    "reconciliationId",
    "refundedAmount",
    "refunds",
    "schemeExtendedResponseData",
    "schemeTraceId",
    "transactionId",
    "updatedAt",
    "void",
    "voidedAmount"
  ],
  "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."
    },
    "authorization": {
      "$ref": "#/$defs/AuthorizationResponse"
    },
    "void": {
      "$ref": "#/$defs/VoidResponse"
    },
    "captures": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CaptureResponse"
      }
    },
    "refunds": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/RefundResponse"
      }
    },
    "schemeTraceId": {
      "type": [
        "string",
        "null"
      ]
    },
    "currency": {
      "$ref": "#/$defs/Currency"
    },
    "authorizedAmount": {
      "type": "integer",
      "format": "int32"
    },
    "orderId": {
      "type": [
        "string",
        "null"
      ]
    },
    "capturedAmount": {
      "type": "integer",
      "format": "int32"
    },
    "voidedAmount": {
      "type": "integer",
      "format": "int32"
    },
    "refundedAmount": {
      "type": "integer",
      "format": "int32"
    },
    "cardMetaData": {
      "$ref": "#/$defs/CardMetaData"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "schemeExtendedResponseData": {
      "$ref": "#/$defs/SchemeExtendedResponseData"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AuthorizationResponse": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Transaction identifier that was passed in the request path"
        },
        "schemeTraceId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Identifier generated by the scheme. E.g. Visa Transaction Identifier, or MasterCard Trace ID"
        },
        "createdAt": {
          "type": "string",
          "description": "Date and time when this transaction was created in our system",
          "format": "date-time"
        },
        "authResponseId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Authorization response id received from the issuer. Also known as an \"Auth No\""
        },
        "outcome": {
          "$ref": "#/$defs/TransactionOutcome"
        },
        "responseCode": {
          "type": "string",
          "description": "Response code for the authorization as per AS2805 specifications"
        },
        "responseDescription": {
          "type": "string",
          "description": "Response description for the authorization as per AS2805 specifications"
        },
        "cvvResponseCode": {
          "$ref": "#/$defs/CvvResponseCode"
        },
        "avsResponseCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Address verification service response code, available if a validation was done."
        },
        "merchantAdviceCode": {
          "$ref": "#/$defs/MerchantAdviceCode"
        },
        "currency": {
          "$ref": "#/$defs/Currency"
        },
        "amount": {
          "type": "integer",
          "description": "Amount of the transaction in cents as it was approved by the issuer",
          "format": "int32"
        },
        "paymentAccountReference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A non-financial reference value assigned to a unique PAN that links the payment account represented by that PAN to all of its related tokens"
        },
        "schemeExtendedResponseData": {
          "$ref": "#/$defs/SchemeExtendedResponseData"
        },
        "authorizationType": {
          "$ref": "#/$defs/MerchantAuthorizationType"
        }
      },
      "additionalProperties": false
    },
    "CaptureResponse": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the capture operation, as passed during the capture request."
        },
        "amount": {
          "type": "integer",
          "description": "Amount of the capture operation in cents as it was provided in the request.",
          "format": "int32"
        },
        "outcome": {
          "$ref": "#/$defs/TransactionOutcome"
        },
        "responseCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Null for capture operation."
        },
        "responseDescription": {
          "type": [
            "string",
            "null"
          ],
          "description": "Null for capture operation."
        },
        "createdAt": {
          "type": "string",
          "description": "Date and time when this capture was created in our system.",
          "format": "date-time"
        },
        "schemeExtendedResponseData": {
          "$ref": "#/$defs/SchemeExtendedResponseData"
        }
      },
      "additionalProperties": false
    },
    "CardMetaData": {
      "type": "object",
      "properties": {
        "bin": {
          "type": [
            "string",
            "null"
          ],
          "description": "The card BIN (Bank Identification Number)"
        },
        "suffix": {
          "type": [
            "string",
            "null"
          ],
          "description": "The last 4 digits of the card"
        },
        "scheme": {
          "$ref": "#/$defs/CardScheme"
        },
        "issuer": {
          "type": [
            "string",
            "null"
          ],
          "description": "The card issuer (bank or institution)"
        },
        "region": {
          "type": [
            "string",
            "null"
          ],
          "description": "The issuing region or country"
        },
        "type": {
          "$ref": "#/$defs/CardType"
        }
      },
      "additionalProperties": false
    },
    "CardScheme": {
      "enum": [
        "Unknown",
        "MasterCard",
        "Visa",
        "AmericanExpress",
        "QCard",
        "Jcb"
      ],
      "type": "string"
    },
    "CardType": {
      "enum": [
        "Card",
        "NetworkToken",
        "ApplePay",
        "GooglePay"
      ],
      "type": "string"
    },
    "Currency": {
      "enum": [
        "AUD",
        "NZD"
      ],
      "type": "string"
    },
    "CvvResponseCode": {
      "enum": [
        "Match",
        "NoMatch",
        "NotProvided",
        "Unavailable",
        "Unknown"
      ],
      "type": "string"
    },
    "MerchantAdviceCode": {
      "enum": [
        "NewAccountInformationAvailable",
        "CannotApproveAtThisTime",
        "DoNotTryAgain",
        "TokenNotSupportedOrTokenRequirementsAreNotMet",
        "StopRecurringPayment",
        "RetryAfter1Hour",
        "RetryAfter24Hours",
        "RetryAfter2Days",
        "RetryAfter4Days",
        "RetryAfter6Days",
        "RetryAfter8Days",
        "RetryAfter10Days",
        "ConsumerNonReloadablePrepaidCard",
        "ConsumerSingleUseVirtualCardNumber",
        "ConsumerMultiUseVirtualCardNumber"
      ],
      "type": "string"
    },
    "MerchantAuthorizationType": {
      "enum": [
        "Estimated",
        "Final"
      ],
      "type": "string"
    },
    "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"
    },
    "VoidResponse": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the void operation, as passed during the void request"
        },
        "amount": {
          "type": "integer",
          "description": "The amount voided by the void request",
          "format": "int32"
        },
        "outcome": {
          "$ref": "#/$defs/TransactionOutcome"
        },
        "responseCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Null for void operation"
        },
        "responseDescription": {
          "type": [
            "string",
            "null"
          ],
          "description": "Null for void operation"
        },
        "createdAt": {
          "type": "string",
          "description": "Date and time when this void was created in our system",
          "format": "date-time"
        },
        "schemeExtendedResponseData": {
          "$ref": "#/$defs/SchemeExtendedResponseData"
        }
      },
      "additionalProperties": false
    }
  }
}