{
  "openapi": "3.1.0",
  "info": {
    "title": "ACube Gov AE API Platform",
    "description": "Official API documentation for the ACube Gov AE API",
    "version": "1.0.0",
    "x-logo": {
      "url": "https://assets.acubeapi.com/logo_rect_white.png"
    }
  },
  "servers": [
    {
      "url": "https://ae-sandbox.api.acubeapi.com",
      "description": "Sandbox"
    },
    {
      "url": "https://ae.api.acubeapi.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/allowed-capabilities": {
      "get": {
        "operationId": "api_allowed-capabilities_get_collection",
        "tags": [
          "Allowed Capability"
        ],
        "responses": {
          "200": {
            "description": "List of allowed capabilities successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Allowed.Capability.CapabilityResource"
                  }
                }
              },
              "application/ld+json": {
                "schema": {
                  "type": "object",
                  "description": "Allowed.Capability.CapabilityResource.jsonld collection.",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/HydraCollectionBaseSchema"
                    },
                    {
                      "type": "object",
                      "required": [
                        "member"
                      ],
                      "properties": {
                        "member": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Allowed.Capability.CapabilityResource.jsonld"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "summary": "Get allowed capabilities list",
        "description": "Returns the complete list of all PEPPOL capabilities supported and allowed by the platform.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The collection page number",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "itemsPerPage",
            "in": "query",
            "description": "The number of items per page",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 0,
              "maximum": 100
            },
            "style": "form",
            "explode": true
          }
        ]
      }
    },
    "/legal-entities/{legalEntityId}/enabled-capabilities": {
      "get": {
        "operationId": "api_legal-entities_legalEntityIdenabled-capabilities_get_collection",
        "tags": [
          "Enabled Capability"
        ],
        "responses": {
          "200": {
            "description": "List of enabled capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Enabled.Capability-capability.read"
                  }
                }
              },
              "application/ld+json": {
                "schema": {
                  "type": "object",
                  "description": "Enabled.Capability.jsonld-capability.read collection.",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/HydraCollectionBaseSchema"
                    },
                    {
                      "type": "object",
                      "required": [
                        "member"
                      ],
                      "properties": {
                        "member": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Enabled.Capability.jsonld-capability.read"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Legal entity not found in the local registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              }
            }
          }
        },
        "summary": "Get enabled capabilities for a legal entity",
        "description": "Returns the list of PEPPOL-enabled capabilities for the specified legal entity.",
        "parameters": [
          {
            "name": "legalEntityId",
            "in": "path",
            "description": "The unique UUID v4 identifier of the legal entity",
            "required": true,
            "deprecated": false,
            "schema": {
              "type": "string"
            },
            "style": "simple",
            "explode": false
          },
          {
            "name": "page",
            "in": "query",
            "description": "The collection page number",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "itemsPerPage",
            "in": "query",
            "description": "The number of items per page",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 0,
              "maximum": 100
            },
            "style": "form",
            "explode": true
          }
        ]
      },
      "put": {
        "operationId": "api_legal-entities_legalEntityIdenabled-capabilities_put",
        "tags": [
          "Enabled Capability"
        ],
        "responses": {
          "200": {
            "description": "Capabilities updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enabled.Capability-capability.read"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Enabled.Capability.jsonld-capability.read"
                }
              }
            },
            "links": {}
          },
          "400": {
            "description": "Invalid capabilities schema or keys provided",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "links": {}
          }
        },
        "summary": "Updates the receiving capabilities for a legal entity",
        "description": "Updates and synchronizes PEPPOL capabilities for the legal entity.",
        "parameters": [
          {
            "name": "legalEntityId",
            "in": "path",
            "description": "The unique UUID v4 identifier of the legal entity",
            "required": true,
            "deprecated": false,
            "schema": {
              "type": "string"
            },
            "style": "simple",
            "explode": false
          }
        ],
        "requestBody": {
          "description": "The updated Enabled Capability resource",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Enabled.Capability-capability.write"
              }
            },
            "application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/Enabled.Capability-capability.write"
              }
            }
          },
          "required": true
        }
      }
    },
    "/legal-entities/{legalEntityId}/sync": {
      "post": {
        "operationId": "api_legal-entities_legalEntityIdsync_post",
        "tags": [
          "Enabled Capability"
        ],
        "responses": {
          "204": {
            "description": "Synchronization triggered successfully",
            "links": {}
          }
        },
        "summary": "Triggers a manual synchronization with Peppol",
        "description": "Reads the current capabilities of the Legal Entity and pushes them directly to the Peppol SMP network.",
        "parameters": [
          {
            "name": "legalEntityId",
            "in": "path",
            "description": "The unique UUID v4 identifier of the legal entity",
            "required": true,
            "deprecated": false,
            "schema": {
              "type": "string"
            },
            "style": "simple",
            "explode": false
          }
        ]
      }
    },
    "/invoices": {
      "get": {
        "operationId": "api_invoices_get_collection",
        "tags": [
          "Invoice"
        ],
        "responses": {
          "200": {
            "description": "Invoice collection",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invoice-invoice.read"
                  }
                }
              },
              "application/ld+json": {
                "schema": {
                  "type": "object",
                  "description": "Invoice.jsonld-invoice.read collection.",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/HydraCollectionBaseSchema"
                    },
                    {
                      "type": "object",
                      "required": [
                        "member"
                      ],
                      "properties": {
                        "member": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Invoice.jsonld-invoice.read"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieves the collection of Invoice resources.",
        "description": "Retrieves the collection of Invoice resources.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The collection page number",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "itemsPerPage",
            "in": "query",
            "description": "The number of items per page",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 0,
              "maximum": 100
            },
            "style": "form",
            "explode": true
          }
        ]
      }
    },
    "/legal-entities": {
      "get": {
        "operationId": "api_legal-entities_get_collection",
        "tags": [
          "Legal Entity"
        ],
        "responses": {
          "200": {
            "description": "List of enabled capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Legal.Entity-legal_entity.read"
                  }
                }
              },
              "application/ld+json": {
                "schema": {
                  "type": "object",
                  "description": "Legal.Entity.jsonld-legal_entity.read collection.",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/HydraCollectionBaseSchema"
                    },
                    {
                      "type": "object",
                      "required": [
                        "member"
                      ],
                      "properties": {
                        "member": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Legal.Entity.jsonld-legal_entity.read"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "summary": "Get legal entities list",
        "description": "Returns the list of legal entities by owner.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "The collection page number",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "itemsPerPage",
            "in": "query",
            "description": "The number of items per page",
            "required": false,
            "deprecated": false,
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 0,
              "maximum": 100
            },
            "style": "form",
            "explode": true
          }
        ]
      },
      "post": {
        "operationId": "api_legal-entities_post",
        "tags": [
          "Legal Entity"
        ],
        "responses": {
          "201": {
            "description": "Legal entity created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Legal.Entity-legal_entity.read"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Legal.Entity.jsonld-legal_entity.read"
                }
              }
            },
            "links": {}
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "links": {}
          },
          "422": {
            "description": "Payload input doesn't respect the contract",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              }
            },
            "links": {}
          },
          "409": {
            "description": "Legal entity already exists in the system",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              }
            }
          },
          "503": {
            "description": "External service unavailable (Peppol, TA)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              }
            }
          }
        },
        "summary": "Create a legal entity",
        "description": "Creates a new legal entity for owner",
        "parameters": [],
        "requestBody": {
          "description": "The new Legal Entity resource",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Legal.Entity-legal_entity.create"
              }
            },
            "application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/Legal.Entity-legal_entity.create"
              }
            }
          },
          "required": true
        }
      }
    },
    "/legal-entities/{legalEntityId}": {
      "get": {
        "operationId": "api_legal-entities_legalEntityId_get",
        "tags": [
          "Legal Entity"
        ],
        "responses": {
          "200": {
            "description": "Legal entity details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Legal.Entity-legal_entity.read"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Legal.Entity.jsonld-legal_entity.read"
                }
              }
            }
          },
          "404": {
            "description": "Legal entity not found in the local registry",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "links": {}
          }
        },
        "summary": "Get legal entity by its identifier",
        "description": "Returns the legal entity details.",
        "parameters": [
          {
            "name": "legalEntityId",
            "in": "path",
            "description": "The unique UUID v4 identifier of the legal entity",
            "required": true,
            "deprecated": false,
            "schema": {
              "type": "string"
            },
            "style": "simple",
            "explode": false
          }
        ]
      },
      "put": {
        "operationId": "api_legal-entities_legalEntityId_put",
        "tags": [
          "Legal Entity"
        ],
        "responses": {
          "200": {
            "description": "Legal entity details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Legal.Entity-legal_entity.read"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Legal.Entity.jsonld-legal_entity.read"
                }
              }
            },
            "links": {}
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "links": {}
          },
          "422": {
            "description": "Payload input doesn't respect the contract",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              }
            },
            "links": {}
          },
          "404": {
            "description": "Legal entity not found in the local registry",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "links": {}
          }
        },
        "summary": "Update legal entity by its identifier",
        "description": "Updates the legal entity info.",
        "parameters": [
          {
            "name": "legalEntityId",
            "in": "path",
            "description": "The unique UUID v4 identifier of the legal entity",
            "required": true,
            "deprecated": false,
            "schema": {
              "type": "string"
            },
            "style": "simple",
            "explode": false
          }
        ],
        "requestBody": {
          "description": "The updated Legal Entity resource",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Legal.Entity-legal_entity.update"
              }
            },
            "application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/Legal.Entity-legal_entity.update"
              }
            }
          },
          "required": true
        }
      },
      "delete": {
        "operationId": "api_legal-entities_legalEntityId_delete",
        "tags": [
          "Legal Entity"
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "503": {
            "description": "Peppol service unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              },
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation.jsonld"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolation"
                }
              }
            }
          }
        },
        "summary": "Delete legal entity by its identifier.",
        "description": "Removes the legal entity from the system.",
        "parameters": [
          {
            "name": "legalEntityId",
            "in": "path",
            "description": "The unique UUID v4 identifier of the legal entity",
            "required": true,
            "deprecated": false,
            "schema": {
              "type": "string"
            },
            "style": "simple",
            "explode": false
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AddressResource-legal_entity.create": {
        "type": "object",
        "required": [
          "address_line_1",
          "city"
        ],
        "properties": {
          "address_line_1": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "The primary address details, including street name, building number, or villa number."
          },
          "city": {
            "maxLength": 100,
            "type": [
              "string",
              "null"
            ],
            "description": "The city or locality name within the specified emirate."
          },
          "emirate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The official UAE emirate name (e.g., Abu Dhabi, Dubai, Sharjah, Ajman, Umm Al Quwain, Ras Al Khaimah, Fujairah)."
          },
          "address_line_2": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "Additional address details, such as apartment, suite, unit, or floor number (optional)."
          }
        }
      },
      "AddressResource-legal_entity.read": {
        "type": "object",
        "required": [
          "address_line_1",
          "city"
        ],
        "properties": {
          "address_line_1": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "The primary address details, including street name, building number, or villa number."
          },
          "city": {
            "maxLength": 100,
            "type": [
              "string",
              "null"
            ],
            "description": "The city or locality name within the specified emirate."
          },
          "emirate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The official UAE emirate name (e.g., Abu Dhabi, Dubai, Sharjah, Ajman, Umm Al Quwain, Ras Al Khaimah, Fujairah)."
          },
          "address_line_2": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "Additional address details, such as apartment, suite, unit, or floor number (optional)."
          }
        }
      },
      "AddressResource-legal_entity.update": {
        "type": "object",
        "required": [
          "address_line_1",
          "city"
        ],
        "properties": {
          "address_line_1": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "The primary address details, including street name, building number, or villa number."
          },
          "city": {
            "maxLength": 100,
            "type": [
              "string",
              "null"
            ],
            "description": "The city or locality name within the specified emirate."
          },
          "emirate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The official UAE emirate name (e.g., Abu Dhabi, Dubai, Sharjah, Ajman, Umm Al Quwain, Ras Al Khaimah, Fujairah)."
          },
          "address_line_2": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "Additional address details, such as apartment, suite, unit, or floor number (optional)."
          }
        }
      },
      "AddressResource.jsonld-legal_entity.read": {
        "type": "object",
        "required": [
          "address_line_1",
          "city"
        ],
        "properties": {
          "address_line_1": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "The primary address details, including street name, building number, or villa number."
          },
          "city": {
            "maxLength": 100,
            "type": [
              "string",
              "null"
            ],
            "description": "The city or locality name within the specified emirate."
          },
          "emirate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The official UAE emirate name (e.g., Abu Dhabi, Dubai, Sharjah, Ajman, Umm Al Quwain, Ras Al Khaimah, Fujairah)."
          },
          "address_line_2": {
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ],
            "description": "Additional address details, such as apartment, suite, unit, or floor number (optional)."
          }
        }
      },
      "Allowed.Capability.CapabilityResource": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The unique capability identifier following the 'domain.service' format (e.g., billing.invoice)."
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The business domain of the capability (e.g., billing)."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The type of electronic document or service (e.g., invoice, credit_note)."
          },
          "doc_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Document Object Identifier (Customization ID) scheme."
          },
          "doc_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol document type specification."
          },
          "process_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Process Identifier (Profile ID) scheme."
          },
          "process_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol business process profile."
          }
        }
      },
      "Allowed.Capability.CapabilityResource.jsonld": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HydraItemBaseSchema"
          },
          {
            "type": "object",
            "properties": {
              "key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "domain": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "doc_scheme": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "doc_value": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "process_scheme": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "process_value": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        ]
      },
      "CapabilityResource-capability.read": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The unique capability identifier following the 'domain.service' format (e.g., billing.invoice)."
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The business domain of the capability (e.g., billing)."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The type of electronic document or service (e.g., invoice, credit_note)."
          },
          "doc_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Document Object Identifier (Customization ID) scheme."
          },
          "doc_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol document type specification."
          },
          "process_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Process Identifier (Profile ID) scheme."
          },
          "process_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol business process profile."
          }
        }
      },
      "CapabilityResource-legal_entity.read": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The unique capability identifier following the 'domain.service' format (e.g., billing.invoice)."
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The business domain of the capability (e.g., billing)."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The type of electronic document or service (e.g., invoice, credit_note)."
          },
          "doc_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Document Object Identifier (Customization ID) scheme."
          },
          "doc_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol document type specification."
          },
          "process_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Process Identifier (Profile ID) scheme."
          },
          "process_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol business process profile."
          }
        }
      },
      "CapabilityResource.jsonld-capability.read": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The unique capability identifier following the 'domain.service' format (e.g., billing.invoice)."
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The business domain of the capability (e.g., billing)."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The type of electronic document or service (e.g., invoice, credit_note)."
          },
          "doc_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Document Object Identifier (Customization ID) scheme."
          },
          "doc_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol document type specification."
          },
          "process_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Process Identifier (Profile ID) scheme."
          },
          "process_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol business process profile."
          }
        }
      },
      "CapabilityResource.jsonld-legal_entity.read": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The unique capability identifier following the 'domain.service' format (e.g., billing.invoice)."
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The business domain of the capability (e.g., billing)."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The type of electronic document or service (e.g., invoice, credit_note)."
          },
          "doc_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Document Object Identifier (Customization ID) scheme."
          },
          "doc_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol document type specification."
          },
          "process_scheme": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Peppol Process Identifier (Profile ID) scheme."
          },
          "process_value": {
            "type": [
              "string",
              "null"
            ],
            "description": "The identifier value of the specific Peppol business process profile."
          }
        }
      },
      "ConstraintViolation": {
        "type": "object",
        "description": "Unprocessable entity",
        "properties": {
          "status": {
            "default": 422,
            "type": "integer"
          },
          "violations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "propertyPath": {
                  "type": "string",
                  "description": "The property path of the violation"
                },
                "message": {
                  "type": "string",
                  "description": "The message associated with the violation"
                },
                "code": {
                  "type": "string",
                  "description": "The code of the violation"
                },
                "hint": {
                  "type": "string",
                  "description": "An extra hint to understand the violation"
                },
                "payload": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "The serialized payload of the violation"
                }
              },
              "required": [
                "propertyPath",
                "message"
              ]
            }
          },
          "detail": {
            "readOnly": true,
            "type": "string"
          },
          "type": {
            "readOnly": true,
            "type": "string",
            "description": "The type of electronic document or service (e.g., invoice, credit_note)."
          },
          "title": {
            "readOnly": true,
            "type": [
              "string",
              "null"
            ]
          },
          "instance": {
            "readOnly": true,
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ConstraintViolation.jsonld": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HydraItemBaseSchema"
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "default": 422,
                "type": "integer"
              },
              "violations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "propertyPath": {
                      "type": "string",
                      "description": "The property path of the violation"
                    },
                    "message": {
                      "type": "string",
                      "description": "The message associated with the violation"
                    },
                    "code": {
                      "type": "string",
                      "description": "The code of the violation"
                    },
                    "hint": {
                      "type": "string",
                      "description": "An extra hint to understand the violation"
                    },
                    "payload": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The serialized payload of the violation"
                    }
                  },
                  "required": [
                    "propertyPath",
                    "message"
                  ]
                }
              },
              "detail": {
                "readOnly": true,
                "type": "string"
              },
              "description": {
                "readOnly": true,
                "type": "string"
              },
              "type": {
                "readOnly": true,
                "type": "string"
              },
              "title": {
                "readOnly": true,
                "type": [
                  "string",
                  "null"
                ]
              },
              "instance": {
                "readOnly": true,
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        ],
        "description": "Unprocessable entity"
      },
      "ContactResource-legal_entity.create": {
        "type": "object",
        "required": [
          "email",
          "phone_number"
        ],
        "properties": {
          "email": {
            "format": "email",
            "externalDocs": {
              "url": "https://schema.org/email"
            },
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Email Address"
          },
          "phone_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Mobile Number"
          }
        }
      },
      "ContactResource-legal_entity.read": {
        "type": "object",
        "required": [
          "email",
          "phone_number"
        ],
        "properties": {
          "email": {
            "format": "email",
            "externalDocs": {
              "url": "https://schema.org/email"
            },
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Email Address"
          },
          "phone_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Mobile Number"
          }
        }
      },
      "ContactResource-legal_entity.update": {
        "type": "object",
        "required": [
          "email",
          "phone_number"
        ],
        "properties": {
          "email": {
            "format": "email",
            "externalDocs": {
              "url": "https://schema.org/email"
            },
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Email Address"
          },
          "phone_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Mobile Number"
          }
        }
      },
      "ContactResource.jsonld-legal_entity.read": {
        "type": "object",
        "required": [
          "email",
          "phone_number"
        ],
        "properties": {
          "email": {
            "format": "email",
            "externalDocs": {
              "url": "https://schema.org/email"
            },
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Email Address"
          },
          "phone_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The registered EmaraTax Mobile Number"
          }
        }
      },
      "Enabled.Capability-capability.read": {
        "type": "object",
        "required": [
          "is_enabled"
        ],
        "properties": {
          "is_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether the receiving capabilities are active for this legal entity."
          },
          "enabled_capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CapabilityResource-capability.read"
            },
            "description": "The list of currently active PEPPOL capabilities for this legal entity."
          }
        }
      },
      "Enabled.Capability-capability.write": {
        "type": "object",
        "required": [
          "is_enabled",
          "keys"
        ],
        "properties": {
          "is_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether the receiving capabilities are active for this legal entity."
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "An array of capability keys following the 'domain.service' format (e.g., billing.invoice) to be activated."
          }
        }
      },
      "Enabled.Capability.jsonld-capability.read": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HydraItemBaseSchema"
          },
          {
            "type": "object",
            "required": [
              "is_enabled"
            ],
            "properties": {
              "is_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "enabled_capabilities": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CapabilityResource.jsonld-capability.read"
                }
              }
            }
          }
        ]
      },
      "Error": {
        "type": "object",
        "description": "A representation of common errors.",
        "properties": {
          "title": {
            "readOnly": true,
            "description": "A short, human-readable summary of the problem.",
            "type": [
              "string",
              "null"
            ]
          },
          "detail": {
            "readOnly": true,
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "integer",
              "null"
            ],
            "examples": [
              404
            ],
            "default": 400
          },
          "instance": {
            "readOnly": true,
            "description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "readOnly": true,
            "description": "The type of electronic document or service (e.g., invoice, credit_note).",
            "type": "string"
          }
        }
      },
      "Error.jsonld": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HydraItemBaseSchema"
          },
          {
            "type": "object",
            "properties": {
              "title": {
                "readOnly": true,
                "description": "A short, human-readable summary of the problem.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "detail": {
                "readOnly": true,
                "description": "A human-readable explanation specific to this occurrence of the problem.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "integer",
                  "null"
                ],
                "examples": [
                  404
                ],
                "default": 400
              },
              "instance": {
                "readOnly": true,
                "description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "readOnly": true,
                "description": "A URI reference that identifies the problem type",
                "type": "string"
              },
              "description": {
                "readOnly": true,
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        ],
        "description": "A representation of common errors."
      },
      "HydraCollectionBaseSchema": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HydraCollectionBaseSchemaNoPagination"
          },
          {
            "type": "object",
            "properties": {
              "view": {
                "type": "object",
                "properties": {
                  "@id": {
                    "type": "string",
                    "format": "iri-reference"
                  },
                  "@type": {
                    "type": "string"
                  },
                  "first": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "iri-reference"
                  },
                  "last": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "iri-reference"
                  },
                  "previous": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "iri-reference"
                  },
                  "next": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "iri-reference"
                  }
                },
                "example": {
                  "@id": "string",
                  "@type": "string",
                  "first": "string",
                  "last": "string",
                  "previous": "string",
                  "next": "string"
                }
              }
            }
          }
        ]
      },
      "HydraCollectionBaseSchemaNoPagination": {
        "type": "object",
        "properties": {
          "totalItems": {
            "type": "integer",
            "minimum": 0
          },
          "search": {
            "type": "object",
            "properties": {
              "@type": {
                "type": "string"
              },
              "template": {
                "type": "string"
              },
              "variableRepresentation": {
                "type": "string"
              },
              "mapping": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "@type": {
                      "type": "string"
                    },
                    "variable": {
                      "type": "string"
                    },
                    "property": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "required": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "HydraItemBaseSchema": {
        "type": "object",
        "properties": {
          "@context": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "@vocab": {
                    "type": "string"
                  },
                  "hydra": {
                    "type": "string",
                    "enum": [
                      "http://www.w3.org/ns/hydra/core#"
                    ]
                  }
                },
                "required": [
                  "@vocab",
                  "hydra"
                ],
                "additionalProperties": true
              }
            ]
          },
          "@id": {
            "type": "string"
          },
          "@type": {
            "type": "string"
          }
        },
        "required": [
          "@id",
          "@type"
        ]
      },
      "Invoice-invoice.read": {
        "type": "object",
        "properties": {
          "invoice_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "owner_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The unique identifier of the account owner."
          }
        }
      },
      "Invoice.jsonld-invoice.read": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HydraItemBaseSchema"
          },
          {
            "type": "object",
            "properties": {
              "invoice_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "owner_id": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          }
        ]
      },
      "Legal.Entity-legal_entity.create": {
        "type": "object",
        "required": [
          "name",
          "trn",
          "address",
          "contact"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The official registered name of the legal entity."
          },
          "trn": {
            "pattern": "^(\\d{15})$",
            "type": [
              "string",
              "null"
            ],
            "description": "The 15-digit Tax Registration Number (TRN) in the UAE."
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressResource-legal_entity.create"
              },
              {
                "type": "null"
              }
            ],
            "description": "The official registered address details of the legal entity."
          },
          "contact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContactResource-legal_entity.create"
              },
              {
                "type": "null"
              }
            ],
            "description": "The primary contact details of the legal entity."
          }
        }
      },
      "Legal.Entity-legal_entity.read": {
        "type": "object",
        "properties": {
          "legal_entity_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The unique UUID v4 identifier of the legal entity."
          },
          "owner_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The unique identifier of the account owner."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The official registered name of the legal entity."
          },
          "trn": {
            "pattern": "^(\\d{15})$",
            "type": [
              "string",
              "null"
            ],
            "description": "The 15-digit Tax Registration Number (TRN) in the UAE."
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressResource-legal_entity.read"
              },
              {
                "type": "null"
              }
            ],
            "description": "The official registered address details of the legal entity."
          },
          "contact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContactResource-legal_entity.read"
              },
              {
                "type": "null"
              }
            ],
            "description": "The primary contact details of the legal entity."
          },
          "is_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether the receiving capabilities are active for this legal entity."
          },
          "enabled_capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CapabilityResource-legal_entity.read"
            },
            "description": "The list of currently active PEPPOL capabilities for this legal entity."
          },
          "last_sync_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The timestamp of the last successful synchronization with the Peppol network."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The timestamp when the legal entity was registered in the system."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The timestamp of the last local update."
          }
        },
        "required": [
          "name",
          "address",
          "contact"
        ]
      },
      "Legal.Entity-legal_entity.update": {
        "type": "object",
        "required": [
          "name",
          "address",
          "contact"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The official registered name of the legal entity."
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressResource-legal_entity.update"
              },
              {
                "type": "null"
              }
            ],
            "description": "The official registered address details of the legal entity."
          },
          "contact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContactResource-legal_entity.update"
              },
              {
                "type": "null"
              }
            ],
            "description": "The primary contact details of the legal entity."
          }
        }
      },
      "Legal.Entity.jsonld-legal_entity.read": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HydraItemBaseSchema"
          },
          {
            "type": "object",
            "properties": {
              "legal_entity_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "owner_id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "trn": {
                "pattern": "^(\\d{15})$",
                "type": [
                  "string",
                  "null"
                ]
              },
              "address": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/AddressResource.jsonld-legal_entity.read"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "contact": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ContactResource.jsonld-legal_entity.read"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "enabled_capabilities": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CapabilityResource.jsonld-legal_entity.read"
                }
              },
              "last_sync_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "name",
              "address",
              "contact"
            ]
          }
        ]
      }
    },
    "responses": {},
    "parameters": {},
    "examples": {},
    "requestBodies": {},
    "headers": {},
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "Value for the Authorization header parameter.",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "tags": [
    {
      "name": "Allowed Capability",
      "description": "Resource 'Allowed Capability' operations."
    },
    {
      "name": "Enabled Capability",
      "description": "Resource 'Enabled Capability' operations."
    },
    {
      "name": "Legal Entity",
      "description": "Resource 'Legal Entity' operations."
    },
    {
      "name": "Invoice",
      "description": "Resource 'Invoice' operations."
    }
  ],
  "webhooks": {}
}
