{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/darwin-so/json-schema/darwin-so-get-payment-options-response-schema.json",
  "title": "GetPaymentOptionsResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/darwin-so-openapi.json#/components/schemas/GetPaymentOptionsResponse",
  "type": "object",
  "properties": {
    "paymentRequestId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
    },
    "targetAgent": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
    },
    "requestRevision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "requestDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "amountMinor": {
      "type": "string",
      "pattern": "^[1-9][0-9]{0,17}$"
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "payeeId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
    },
    "payeeName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "actionId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
    },
    "eligibleMethods": {
      "maxItems": 8,
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "hosted_checkout"
              },
              "method": {
                "type": "string",
                "const": "hosted_checkout"
              }
            },
            "required": [
              "kind",
              "method"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "saved_method"
              },
              "method": {
                "type": "string",
                "enum": [
                  "card",
                  "bank",
                  "mpp",
                  "x402",
                  "ucp",
                  "acp"
                ]
              }
            },
            "required": [
              "kind",
              "method"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "darwin_wallet"
              },
              "method": {
                "type": "string",
                "const": "darwin_wallet"
              }
            },
            "required": [
              "kind",
              "method"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "savedMethods": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "paymentMethodId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "method": {
            "type": "string",
            "enum": [
              "card",
              "bank",
              "mpp",
              "x402",
              "ucp",
              "acp"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
          }
        },
        "required": [
          "paymentMethodId",
          "label",
          "method",
          "expiresAt"
        ],
        "additionalProperties": false
      }
    },
    "unavailableMethods": {
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "card",
              "bank",
              "hosted_checkout",
              "darwin_wallet",
              "mpp",
              "x402",
              "ucp",
              "acp"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "provider_unavailable",
              "saved_method_unavailable"
            ]
          }
        },
        "required": [
          "method",
          "reason"
        ],
        "additionalProperties": false
      }
    },
    "unavailableReason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "request_expired",
            "payment_settled",
            "payment_failed",
            "payment_voided",
            "payment_refunded",
            "payment_in_progress",
            "request_not_payable",
            "unsupported_rail",
            "provider_unavailable",
            "saved_method_unavailable"
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "paymentRequestId",
    "targetAgent",
    "requestRevision",
    "requestDigest",
    "expiresAt",
    "amountMinor",
    "currency",
    "payeeId",
    "payeeName",
    "actionId",
    "eligibleMethods",
    "savedMethods",
    "unavailableMethods",
    "unavailableReason"
  ],
  "additionalProperties": false
}