{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/pagopa/main/json-schema/pagopa-payment-options-response-schema.json",
  "title": "PaymentOptionsResponse",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pagopa-payment-options-organizations-openapi.yml#/components/schemas/PaymentOptionsResponse",
  "type": "object",
  "properties": {
    "organizationFiscalCode": {
      "type": "string"
    },
    "companyName": {
      "type": "string"
    },
    "officeName": {
      "type": "string"
    },
    "standin": {
      "type": "boolean"
    },
    "paymentOptions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PaymentOption"
      }
    }
  },
  "$defs": {
    "EnumInstallment": {
      "enum": [
        "POI_UNPAID",
        "POI_PAID",
        "POI_EXPIRED_NOT_PAYABLE",
        "POI_EXPIRED_UNPAID",
        "POI_INVALID"
      ],
      "type": "string"
    },
    "EnumPo": {
      "enum": [
        "PO_UNPAID",
        "PO_PAID",
        "PO_PARTIALLY_PAID",
        "PO_EXPIRED_NOT_PAYABLE",
        "PO_EXPIRED_UNPAID",
        "PO_INVALID"
      ],
      "type": "string"
    },
    "Installment": {
      "type": "object",
      "properties": {
        "nav": {
          "type": "string"
        },
        "iuv": {
          "type": "string"
        },
        "amount": {
          "format": "int64",
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "dueDate": {
          "type": "string",
          "format": "date-time"
        },
        "validFrom": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "$ref": "#/$defs/EnumInstallment"
        },
        "statusReason": {
          "type": "string"
        }
      }
    },
    "PaymentOption": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "numberOfInstallments": {
          "format": "int32",
          "type": "integer"
        },
        "dueDate": {
          "type": "string",
          "format": "date-time"
        },
        "validFrom": {
          "type": "string",
          "format": "date-time"
        },
        "amount": {
          "format": "int64",
          "type": "integer"
        },
        "status": {
          "$ref": "#/$defs/EnumPo"
        },
        "statusReason": {
          "type": "string"
        },
        "allCCP": {
          "type": "boolean"
        },
        "installments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Installment"
          }
        }
      }
    }
  }
}