{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/storecove/json-schema/storecove-peppol-identifier-annuaire-update-schema.json",
  "title": "PeppolIdentifierAnnuaireUpdate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/storecove-peppolidentifiers-api-openapi.yml#/components/schemas/PeppolIdentifierAnnuaireUpdate",
  "properties": {
    "annuaire": {
      "allOf": [
        {
          "$ref": "#/$defs/DgfipAnnuaireUpdate"
        },
        {
          "title": "Annuaire (DGFiP)",
          "description": "DGFiP directory (annuaire) details for the French e-invoicing reform. Routing-code label and address, or the formal agreement on its own when formal_agreement_pending_since is set and no PDF is stored yet; to close a line, delete the PeppolIdentifier."
        }
      ]
    }
  },
  "required": [
    "annuaire"
  ],
  "$defs": {
    "DgfipAnnuaireAddress": {
      "properties": {
        "street1": {
          "type": "string",
          "title": "Street 1",
          "description": "The first address line.",
          "maxLength": 192
        },
        "street2": {
          "type": "string",
          "title": "Street 2",
          "description": "The second address line, if applicable.",
          "maxLength": 192
        },
        "zip": {
          "type": "string",
          "title": "Zip",
          "description": "The zipcode.",
          "maxLength": 32
        },
        "city": {
          "type": "string",
          "title": "City",
          "description": "The city.",
          "maxLength": 64
        },
        "country": {
          "type": "string",
          "title": "Country",
          "description": "ISO 3166-1 alpha-2 country code.",
          "minLength": 2,
          "maxLength": 2
        }
      }
    },
    "DgfipAnnuaireUpdate": {
      "properties": {
        "routing_code_label": {
          "type": "string",
          "title": "Routing Code Label",
          "description": "Human-readable label for the routing code (annuaire central libelleCodeRoutage). Mandatory when the identifier carries a routing code."
        },
        "address": {
          "$ref": "#/$defs/DgfipAnnuaireAddress"
        },
        "formal_agreement": {
          "allOf": [
            {
              "$ref": "#/$defs/FormalAgreement"
            },
            {
              "title": "Formal agreement",
              "description": "The formal agreement (accord formel) for a dgfip identifier whose formal_agreement_pending_since is set and that has no PDF yet. Send annuaire containing only this field, without routing_code_label or address. It is stored with its mandate number, and the annuaire line is not sent to the PPF again. Rejected with HTTP 422 when an agreement is already stored, or when formal_agreement_pending_since is absent. Without that marker this PATCH is rejected. POST accepts the PDF only when creating a new identifier."
            }
          ]
        }
      }
    },
    "FormalAgreement": {
      "properties": {
        "document": {
          "title": "Formal agreement",
          "description": "The Base64-encoded PDF of the formal agreement (accord formel). Optional until 2 November 2026, and mandatory from that date on when a production create registers an address in the annuaire central. Maximum size is 10 MB. It must be a readable PDF with at least one page: a file that is not a PDF, or that is password-protected, damaged, or empty, is rejected with HTTP 422. The contents are not inspected. A POST for an identifier that already exists returns already exists and leaves the stored file unchanged. An identifier whose formal_agreement_pending_since is set and that has no PDF yet adds the agreement with PATCH /legal_entities/{legal_entity_id}/peppol_identifiers/{superscheme}/{scheme}/{identifier}, sending annuaire containing only formal_agreement. Without that marker this PATCH is rejected. POST accepts the PDF only when creating a new identifier.",
          "type": "string"
        }
      },
      "required": [
        "document"
      ]
    }
  }
}