{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/storecove/json-schema/storecove-discoverable-participant-schema.json",
  "title": "Discoverable Participant",
  "description": "A participant to be discovered.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/storecove-discovery-api-openapi.yml#/components/schemas/DiscoverableParticipant",
  "type": "object",
  "properties": {
    "documentTypes": {
      "title": "DocumentTypes",
      "description": "An array of document types to discover. The default is '[\"invoice\", \"creditnote\"]'. This is ignored when only checking existence.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "invoice",
          "creditnote",
          "invoice_response",
          "order",
          "ordering",
          "order_response"
        ]
      }
    },
    "network": {
      "title": "Network",
      "description": "The network to check. Currently only 'peppol' is supported.",
      "type": "string",
      "minLength": 3,
      "default": "peppol"
    },
    "flags": {
      "allOf": [
        {
          "$ref": "#/$defs/DiscoveryFlag"
        },
        {
          "title": "Flags",
          "description": "The flags for the check."
        }
      ]
    },
    "metaScheme": {
      "title": "Meta Scheme",
      "description": "The meta scheme of the identifier. For Peppol this is always 'iso6523-actorid-upis'.",
      "type": "string",
      "minLength": 3,
      "default": "iso6523-actorid-upis"
    },
    "scheme": {
      "title": "Scheme",
      "description": "The scheme of the identifier. See <<_receiver_identifiers_list>> for a list.",
      "type": "string",
      "minLength": 3
    },
    "identifier": {
      "title": "Identifier",
      "description": "The actual identifier.",
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "scheme",
    "identifier"
  ],
  "$defs": {
    "DiscoveryFlag": {
      "title": "DiscoveryFlag",
      "description": "A flag to filter for documents",
      "type": "object",
      "properties": {
        "supportsSelfBilling": {
          "title": "Supports Self Billing",
          "description": "Whether or not to filter for documents that support self billing.",
          "type": "string",
          "enum": [
            "allowed",
            "required",
            "not_allowed"
          ],
          "default": "not_allowed"
        }
      }
    }
  }
}