{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/orsunpay-com/json-schema/orsunpay-com-payment-response-dto-schema.json",
  "title": "PaymentResponseDto",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/orsunpay-com-openapi.json#/components/schemas/PaymentResponseDto",
  "properties": {
    "error": {
      "description": "Error message (if operation failed)",
      "type": "string"
    },
    "nextAction": {
      "description": "Validated app confirmation or voucher instructions for the payer",
      "type": "object"
    },
    "paymentPageUrl": {
      "description": "Sales only: the hosted payment page, when the buyer still has to pick a method or type payment details (no `paymentMethod`, or incomplete `paymentMethodInput`). Redirect the buyer there; `url` carries the same value. Valid until the sale expires (48 h by default); the token in it is the only key to the page, so treat the URL like a secret link.",
      "type": "string"
    },
    "pending": {
      "description": "Accepted payment awaiting confirmation. On PSP_OUTCOME_UNKNOWN poll the transaction; do not resubmit or create a new order.",
      "type": "boolean"
    },
    "status": {
      "description": "Operation status",
      "type": "boolean"
    },
    "transaction": {
      "allOf": [
        {
          "$ref": "#/$defs/TransactionDto"
        }
      ],
      "description": "Transaction details"
    },
    "url": {
      "description": "Redirect URL for payment completion (if required)",
      "type": "string"
    }
  },
  "required": [
    "status"
  ],
  "type": "object",
  "$defs": {
    "TransactionDto": {
      "properties": {
        "action": {
          "description": "Transaction action type",
          "enum": [
            "SALE",
            "PAYOUT",
            "AUTHORIZE",
            "REFUND",
            "CHARGEBACK"
          ],
          "type": "string"
        },
        "amount": {
          "description": "Transaction amount in `currency`. Decimal string in major units, padded to the currency exponent (\"10.00\" EUR, \"5000\" JPY). Parse with a decimal library, never with parseFloat.",
          "pattern": "^(0|[1-9]\\d{0,19})(\\.\\d{1,18})?$",
          "type": "string"
        },
        "createdAt": {
          "description": "Transaction creation timestamp",
          "format": "date-time",
          "type": "string"
        },
        "currency": {
          "description": "Transaction currency",
          "enum": [
            "AED",
            "AFN",
            "ALL",
            "AMD",
            "ANG",
            "AOA",
            "ARS",
            "AUD",
            "AWG",
            "AZN",
            "BAM",
            "BBD",
            "BDT",
            "BGN",
            "BHD",
            "BIF",
            "BMD",
            "BND",
            "BOB",
            "BRL",
            "BSD",
            "BTN",
            "BWP",
            "BYN",
            "BZD",
            "CAD",
            "CDF",
            "CHF",
            "CLF",
            "CLP",
            "CNY",
            "COP",
            "CRC",
            "CUC",
            "CUP",
            "CVE",
            "CZK",
            "DJF",
            "DKK",
            "DOP",
            "DZD",
            "EGP",
            "ERN",
            "ETB",
            "EUR",
            "FJD",
            "FKP",
            "GBP",
            "GEL",
            "GHS",
            "GIP",
            "GMD",
            "GNF",
            "GTQ",
            "GYD",
            "HKD",
            "HNL",
            "HRK",
            "HTG",
            "HUF",
            "IDR",
            "ILS",
            "INR",
            "IQD",
            "IRR",
            "ISK",
            "JMD",
            "JOD",
            "JPY",
            "KES",
            "KGS",
            "KHR",
            "KMF",
            "KPW",
            "KRW",
            "KWD",
            "KYD",
            "KZT",
            "LAK",
            "LBP",
            "LKR",
            "LRD",
            "LSL",
            "LYD",
            "MAD",
            "MDL",
            "MGA",
            "MKD",
            "MMK",
            "MNT",
            "MOP",
            "MRU",
            "MUR",
            "MVR",
            "MWK",
            "MXN",
            "MYR",
            "MZN",
            "NAD",
            "NGN",
            "NIO",
            "NOK",
            "NPR",
            "NZD",
            "OMR",
            "PAB",
            "PEN",
            "PGK",
            "PHP",
            "PKR",
            "PLN",
            "PYG",
            "QAR",
            "RON",
            "RSD",
            "RUB",
            "RWF",
            "SAR",
            "SBD",
            "SCR",
            "SDG",
            "SEK",
            "SGD",
            "SHP",
            "SLL",
            "SOS",
            "SRD",
            "SSP",
            "STN",
            "SVC",
            "SYP",
            "SZL",
            "THB",
            "TJS",
            "TMT",
            "TND",
            "TOP",
            "TRY",
            "TTD",
            "TWD",
            "TZS",
            "UAH",
            "UGX",
            "USD",
            "UYU",
            "UZS",
            "VES",
            "VND",
            "VUV",
            "WST",
            "XAF",
            "XAG",
            "XAU",
            "XCD",
            "XDR",
            "XOF",
            "XPF",
            "YER",
            "ZAR",
            "ZMW",
            "ZWL"
          ],
          "type": "string"
        },
        "currencyRate": {
          "anyOf": [
            {
              "description": "Effective DCC rate as a plain decimal string; null without DCC.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "errorCode": {
          "anyOf": [
            {
              "description": "Payment error/outcome reason. LIVEMODE_MISMATCH means the transaction was DECLINED before PSP dispatch; creation still returns HTTP 201 with status: true. PSP_OUTCOME_UNKNOWN means reconcile or poll; do not create another order. PSP_INPUT_INVALID identifies local legacy-submit serialization/codec failures; PSP_REQUEST_REJECTED identifies a definitive upstream rejection.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "feeAmount": {
          "anyOf": [
            {
              "description": "Configured fee: money in `processingCurrency` for FIXED fees, a percent (\"10\" = 10 %) for PERCENTAGE fees. Decimal string.",
              "pattern": "^(0|[1-9]\\d{0,19})(\\.\\d{1,18})?$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "id": {
          "description": "Transaction ID",
          "type": "string"
        },
        "livemode": {
          "description": "True for live payments; false for sandbox payments. Derived from the authenticated API key.",
          "type": "boolean"
        },
        "orderId": {
          "description": "Order ID from merchant system",
          "type": "string"
        },
        "processingAmount": {
          "anyOf": [
            {
              "description": "Amount in `processingCurrency`. Decimal string in major units, padded to the currency exponent (\"10.00\" EUR, \"5000\" JPY). Parse with a decimal library, never with parseFloat.",
              "pattern": "^(0|[1-9]\\d{0,19})(\\.\\d{1,18})?$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "processingAmountWithFee": {
          "anyOf": [
            {
              "description": "Processing amount including a TOP fee, in `processingCurrency`. Decimal string in major units, padded to the currency exponent (\"10.00\" EUR, \"5000\" JPY). Parse with a decimal library, never with parseFloat.",
              "pattern": "^(0|[1-9]\\d{0,19})(\\.\\d{1,18})?$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "processingCurrency": {
          "description": "Currency the PSP is charged in (differs from `currency` with DCC)",
          "enum": [
            "AED",
            "AFN",
            "ALL",
            "AMD",
            "ANG",
            "AOA",
            "ARS",
            "AUD",
            "AWG",
            "AZN",
            "BAM",
            "BBD",
            "BDT",
            "BGN",
            "BHD",
            "BIF",
            "BMD",
            "BND",
            "BOB",
            "BRL",
            "BSD",
            "BTN",
            "BWP",
            "BYN",
            "BZD",
            "CAD",
            "CDF",
            "CHF",
            "CLF",
            "CLP",
            "CNY",
            "COP",
            "CRC",
            "CUC",
            "CUP",
            "CVE",
            "CZK",
            "DJF",
            "DKK",
            "DOP",
            "DZD",
            "EGP",
            "ERN",
            "ETB",
            "EUR",
            "FJD",
            "FKP",
            "GBP",
            "GEL",
            "GHS",
            "GIP",
            "GMD",
            "GNF",
            "GTQ",
            "GYD",
            "HKD",
            "HNL",
            "HRK",
            "HTG",
            "HUF",
            "IDR",
            "ILS",
            "INR",
            "IQD",
            "IRR",
            "ISK",
            "JMD",
            "JOD",
            "JPY",
            "KES",
            "KGS",
            "KHR",
            "KMF",
            "KPW",
            "KRW",
            "KWD",
            "KYD",
            "KZT",
            "LAK",
            "LBP",
            "LKR",
            "LRD",
            "LSL",
            "LYD",
            "MAD",
            "MDL",
            "MGA",
            "MKD",
            "MMK",
            "MNT",
            "MOP",
            "MRU",
            "MUR",
            "MVR",
            "MWK",
            "MXN",
            "MYR",
            "MZN",
            "NAD",
            "NGN",
            "NIO",
            "NOK",
            "NPR",
            "NZD",
            "OMR",
            "PAB",
            "PEN",
            "PGK",
            "PHP",
            "PKR",
            "PLN",
            "PYG",
            "QAR",
            "RON",
            "RSD",
            "RUB",
            "RWF",
            "SAR",
            "SBD",
            "SCR",
            "SDG",
            "SEK",
            "SGD",
            "SHP",
            "SLL",
            "SOS",
            "SRD",
            "SSP",
            "STN",
            "SVC",
            "SYP",
            "SZL",
            "THB",
            "TJS",
            "TMT",
            "TND",
            "TOP",
            "TRY",
            "TTD",
            "TWD",
            "TZS",
            "UAH",
            "UGX",
            "USD",
            "UYU",
            "UZS",
            "VES",
            "VND",
            "VUV",
            "WST",
            "XAF",
            "XAG",
            "XAU",
            "XCD",
            "XDR",
            "XOF",
            "XPF",
            "YER",
            "ZAR",
            "ZMW",
            "ZWL"
          ],
          "type": "string"
        },
        "processingFeeAmount": {
          "anyOf": [
            {
              "description": "Fee charged, in `processingCurrency`. Decimal string in major units, padded to the currency exponent (\"10.00\" EUR, \"5000\" JPY). Parse with a decimal library, never with parseFloat.",
              "pattern": "^(0|[1-9]\\d{0,19})(\\.\\d{1,18})?$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "description": "Transaction status",
          "enum": [
            "CREATED",
            "WAIT_APPROVE",
            "PROCESSING",
            "CANCELED",
            "DECLINED",
            "SUCCESS",
            "EXPIRED"
          ],
          "type": "string"
        }
      },
      "required": [
        "livemode",
        "id",
        "orderId",
        "status",
        "action",
        "amount",
        "currency",
        "createdAt"
      ],
      "type": "object"
    }
  }
}