{
  "$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-payment-details-by-payment-id-view-model-schema.json",
  "title": "Merchant.API.Application.Queries.ViewModels.PaymentDetailsByPaymentIdViewModel",
  "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.PaymentDetailsByPaymentIdViewModel",
  "required": [
    "amount",
    "createdTimestamp",
    "instrumentId",
    "merchantId",
    "paymentId",
    "status",
    "statusTimestamp"
  ],
  "type": "object",
  "properties": {
    "merchantId": {
      "minLength": 1,
      "type": "string",
      "description": "ID of the merchant."
    },
    "paymentId": {
      "maxLength": 36,
      "minLength": 36,
      "type": "string",
      "description": "ID of the payment which was initiated"
    },
    "createdTimestamp": {
      "type": "string",
      "description": "Payment record creation date and time stamp. Value is in UTC",
      "format": "date-time"
    },
    "statusTimestamp": {
      "type": "string",
      "description": "Latest payment status update date and time stamp. Value is in UTC",
      "format": "date-time"
    },
    "status": {
      "$ref": "#/$defs/Merchant.API.Application.Queries.ViewModels.Enums.MerchantStatus"
    },
    "amount": {
      "maximum": 1000000000,
      "minimum": 1,
      "type": "integer",
      "description": "Initiated payment amount in cents",
      "format": "int32"
    },
    "instrumentId": {
      "maxLength": 36,
      "minLength": 36,
      "type": "string",
      "description": "ID of the PayTo instrument under which this payment was initiated."
    },
    "reference": {
      "maximum": 35,
      "minimum": 1,
      "type": [
        "string",
        "null"
      ],
      "description": "The order or purchase or reference number that was provided to consumer during checkout.<br/>Note: this value is visible to consumers in their banking statements."
    },
    "description": {
      "maximum": 280,
      "minimum": 1,
      "type": [
        "string",
        "null"
      ],
      "description": "Additional free form payment description that was included for the consumer in the payment.<br/>Note: this value is visible to consumers in their banking statements."
    },
    "creditorReference": {
      "maximum": 35,
      "minimum": 1,
      "type": [
        "string",
        "null"
      ],
      "description": "A backoffice only reference that was used to aid in creditor's reconciliation activities.<br/>Note: this value is only visible in creditor's corporate banking statement."
    },
    "merchantWebhooksUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Merchant's supplied URL that should receive webhooks for this payment."
    },
    "rejectionReason": {
      "$ref": "#/$defs/Merchant.API.Application.Queries.ViewModels.PaymentRejectionReasonViewModel"
    },
    "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.PaymentRejectionReasonViewModel": {
      "title": "object",
      "required": [
        "code",
        "detail",
        "title"
      ],
      "type": "object",
      "properties": {
        "code": {
          "minLength": 1,
          "type": "string",
          "description": "Payment rejection reason code. Note: this is an internal value and is not intended to be displayed to consumers."
        },
        "title": {
          "minLength": 1,
          "type": "string",
          "description": "Payment rejection reason title. Note: this value can be displayed to consumers."
        },
        "detail": {
          "minLength": 1,
          "type": "string",
          "description": "Payment rejection reason details. Note: this value may be displayed to consumers."
        }
      },
      "additionalProperties": false,
      "description": "Rejection reason details in case of payment failure."
    }
  }
}