{
  "$id": "https://schema.nfh.global/PaymentAction/v2.0",
  "x-iri": "https://schema.nfh.global/PaymentAction/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Schema definition for PaymentAction in the Beckn Protocol v2.0.1",
  "title": "PaymentAction",
  "type": "object",
  "properties": {
    "amount": {
      "description": "Amount associated with this payment action",
      "type": "object",
      "properties": {
        "currency": {
          "type": "string",
          "x-jsonld": {
            "@id": "schema:priceCurrency"
          }
        },
        "value": {
          "type": "number",
          "x-jsonld": {
            "@id": "schema:price"
          }
        }
      }
    },
    "paymentStatus": {
      "description": "Payment lifecycle status (Pending | Authorized | Captured | Failed | Refunded | PartialRefund …)",
      "type": "string",
      "enum": [
        "INITIATED",
        "PENDING",
        "AUTHORIZED",
        "CAPTURED",
        "COMPLETED",
        "FAILED",
        "CANCELLED",
        "REFUNDED",
        "PARTIALLY_REFUNDED",
        "CHARGEBACK",
        "DISPUTED",
        "EXPIRED",
        "REVERSED",
        "VOIDED",
        "SETTLED",
        "ON_HOLD",
        "ADJUSTED"
      ],
      "x-jsonld": {
        "@id": "beckn:paymentStatus"
      }
    },
    "paymentMethod": {
      "type": "object",
      "method": {
        "type": "string"
      }
    },
    "paymentUrl": {
      "description": "URL for payment processing/redirection",
      "type": "string",
      "x-jsonld": {
        "@id": "schema:url"
      },
      "format": "uri",
      "example": "https://payments.example.com/pay?transactionId=123&amount=100"
    },
    "state": {
      "$ref": "https://schema.nfh.global/State/v2.0/schema.json"
    },
    "txnRef": {
      "description": "PSP/gateway/bank transaction reference",
      "type": "string",
      "x-jsonld": {
        "@id": "schema:transactionNumber"
      }
    },
    "checkoutAt": {
      "$ref": "https://schema.nfh.global/CheckoutTerminal/v2.0/schema.json"
    },
    "paidAt": {
      "description": "The time at which the payment was made",
      "type": "string",
      "format": "date-time"
    },
    "paymentActionAttributes": {
      "description": "Extensible set of attributes containing payment actions specific to each ecosystem.",
      "$ref": "https://schema.nfh.global/Attributes/v2.0/schema.json"
    }
  },
  "required": [
    "paymentStatus"
  ],
  "additionalProperties": false,
  "x-tags": [
    "common"
  ]
}
