openapi: 3.0.1
info:
  title: network_documents API
  description: Merged OpenAPI spec for network_documents domain
  version: 1.0.0
servers:
- url: https://api.cve.btx.eu.banqup.com/network/documents
paths:
  /v1/spaces/connectors/peppol/configurationUI:
    post:
      description: "\tRetrieves a list of Peppol participant IDs that can be registered\
        \ on the Peppol network\n\tbased on the configured identifiers within a given\
        \ space.\n\n\t- The UI should display this information in the Peppol Connector\
        \ configuration screen.\n\t- A participant ID is eligible for registration/un-registration\
        \ if it is registered on another platform. \n\n <br/> Scope: space_read"
      operationId: configurationUI
      parameters:
      - in: query
        name: spaceId
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PeppolParticipantInformation'
          description: Success - List of address lines.
        '400':
          content:
            application/json: {}
          description: Bad Request - Invalid input data.
      security:
      - oauth2:
        - space_read
      summary: Retrieve Peppol participant registration eligibility
      tags:
      - Peppol Connector API
  /v1/spaces/connectors/peppol/lookup:
    post:
      description: 'Checks Peppol status and National Directory presence for identifiers
        before a client space is created. <br/> Scope: []'
      operationId: lookupConfiguration
      requestBody:
        content:
          application/json:
            example:
              be:en: 0888837427
              fr:siret: '33856698600012'
              global:gln:
              - '7182913726182'
              - '9182534172619'
            schema:
              type: object
              additionalProperties:
                type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PeppolParticipantInformation'
          description: Success - List of address lines.
        '400':
          content:
            application/json: {}
          description: Bad Request - Invalid input data.
      summary: Partner-level identifier lookup by identifiers (No Space context)
      tags:
      - Peppol Connector API
  /spaces/connectors/afnor/v1/directory-line/code:{addressingIdentifier}:
    get:
      description: Retrieve the data from the directory line corresponding to the
        identifier passed in parameters.
      operationId: getDirectoryLineById
      parameters:
      - description: Addressing identifier of the directory line
        in: path
        name: addressingIdentifier
        required: true
        schema:
          type: string
          maxLength: 125
          minLength: 0
      - description: Relations to include in the response..
        explode: false
        in: query
        name: include
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siren
            - siret
            - routingCode
      - description: Fields of the Directory Line resource
        explode: false
        in: query
        name: fields
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - addressingIdentifier
            - siren
            - siret
            - routingIdentifier
            - addressingSuffix
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryLinePayloadLegalUnitFacilityRoutingCode'
          description: Return a directory line.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: Get a directory line
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/directory-line/search:
    post:
      description: "Search for directory lines that meet all the criteria passed as\
        \ parameters and return the results in the desired format. \n\n**If no limit\
        \ is set or it exceeds 200, and more than 200 matches are found, the API returns\
        \ the first 200 records with an HTTP 206 (Partial Content) status.**\n"
      operationId: searchDirectoryLine
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchDirectoryLine'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryLineSearchResponse'
          description: returns the directory line(s) matching the search criteria.
        '204':
          description: No Content - No content expected
        '206':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryLineSearchResponse'
          description: Request processed without error, but the volume of information
            returned has been reduced.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: Search for a directory line
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/flows:
    post:
      description: "\tSubmit a flow. A flow is a single-invoice file, with: \n\n\t\
        \ \t- an XML/PDF file with the data of the invoice \n\n\tThe flow is created\
        \ with a `flowInfo` object, allowing to qualify the flow. \n\n\tA flow can\
        \ be: \n\n\t\t- an invoice (CII, UBL, Factur-X,...)\n\t\t- a lifecycle (CDAR)\n\
        \t \t- or a e-reporting file \n\n <br/> Scope: space_write"
      operationId: createFlow
      parameters:
      - description: Jefacture space_id
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          multipart/form-data:
            encoding:
              file:
                contentType: application/pdf, application/xml
              flowInfo:
                contentType: application/json
            schema:
              $ref: '#/components/schemas/CreateFlowRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FullFlowInfo'
          description: OK - Response message once the flow has been uploaded.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '413':
          content:
            application/json:
              example:
                errorCode: FILE_SIZE_EXCEEDED
                errorMessage: Provided file is too big
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 413 : Payload Too Large.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_write
      summary: Submit a new flow
      tags:
      - AFNOR Flow API
  /spaces/connectors/afnor/v1/flows/search:
    post:
      description: "\t\tRetrieves a set of flows matching the provided search criteria:\
        \ \n\n\t\t\t- Need at least one criterion to be specified\n\t\t\t- Assuming\
        \ a logical AND when combining criteria\n\t\t\t- Assuming a logical OR for\
        \ criteria allowing a list of values \n\n\t\tPagination works with the updatedAfter\
        \ property\n \t\tThe comparison with current date is strict : updatedAt >\
        \ updatedAfter \n\n <br/> Scope: space_read"
      operationId: searchFlow
      parameters:
      - description: Jefacture space_id
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchFlowParams'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchFlowContent'
          description: OK - Response message when returning the results of a search
            request.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_read
      summary: Select flows upon criteria
      tags:
      - AFNOR Flow API
  /spaces/connectors/afnor/v1/flows/{flowId}:
    get:
      description: "Download a file related to a given flow: \n\n- an invoice\n- a\
        \ life cycle\n- an e-reporting \n\n <br/> Scope: space_read"
      operationId: getFlow
      parameters:
      - description: Jefacture space_id
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      - in: path
        name: flowId
        required: true
        schema:
          type: string
          description: Unique identifier supporting UUID but not only, for flexibility
            purpose
          maxLength: 36
      - description: "This parameter allows to provide the type of file to be downloaded,\
          \ can be either one: \n\n- Metadata [Default]: provides the flow metadata\
          \ as a JSON payload, no download\n- Original: the document that has been\
          \ initially sent/provided by the emitter\n- Converted: the document that\
          \ has been optionally converted by the system\n- ReadableView: the document\
          \ that has been optionally generated as the readable file\n"
        in: query
        name: docType
        required: false
        schema:
          type: string
          default: Metadata
          enum:
          - Metadata
          - Original
          - Converted
          - ReadableView
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flow'
            application/octet-stream:
              schema:
                type: string
                format: binary
          description: OK - Response message once the flow has been downloaded.
          headers:
            Content-Disposition:
              description: ' Header specifying attached file name'
              schema:
                type: string
              style: simple
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_read
      summary: Download the file of a flow
      tags:
      - AFNOR Flow API
  /spaces/connectors/afnor/v1/healthcheck:
    get:
      operationId: getHealth
      parameters:
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      - description: Jefacture space_id
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      responses:
        '200':
          description: OK - Operation succeeded
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2: []
      summary: Check whether the API service is up and running.
      tags:
      - AFNOR Flow API
      description: ''
  /spaces/connectors/afnor/v1/routing-code/search:
    post:
      description: "Search for routing codes that meet all the criteria passed as\
        \ parameters and return the routing codes in the desired format. \n\n**If\
        \ no limit is set or it exceeds 200, and more than 200 matches are found,\
        \ the API returns the first 200 records with an HTTP 206 (Partial Content)\
        \ status.**"
      operationId: searchRoutingCode
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoutingCodeSearch'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingCodeSearchResponse'
          description: Returns the routing code(s) matching the search criteria.
        '204':
          description: No Content - No content expected
        '206':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingCodeSearchResponse'
          description: Request processed without error, but the volume of information
            returned has been reduced.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: Search for a routing code
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/routing-code/siret:{siret}/code:{routingIdentifier}:
    get:
      description: Retrieve the Routing Code data corresponding to the identifier
        passed in parameters.
      operationId: getRoutingCodeBySiretAndId
      parameters:
      - in: path
        name: siret
        required: true
        schema:
          type: string
          maxLength: 14
          minLength: 0
          pattern: ^([0-9]{14})$
      - in: path
        name: routingIdentifier
        required: true
        schema:
          type: string
          maxLength: 100
          minLength: 0
      - description: Relations to include in the response.
        explode: false
        in: query
        name: include
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siren
            - siret
      - description: Fields of the Routing Code resource
        explode: false
        in: query
        name: fields
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siret
            - routingIdentifierType
            - routingCodeName
            - routingIdentifier
            - managesLegalCommitmentCode
            - administrativeStatus
            - address
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingCodePayloadHistoryLegalUnitFacility'
          description: Returns a routing code.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: Get a routing code by SIRET and routing identifier
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/siren/code-insee:{siren}:
    get:
      description: Returns the details of a company (legal unit) identified by the
        SIREN number passed as a parameter.
      operationId: getCompanyBySiren
      parameters:
      - in: path
        name: siren
        required: true
        schema:
          type: string
          maxLength: 9
          minLength: 0
          pattern: ^([0-9]{9})$
      - description: Fields of the SIREN resource.
        explode: false
        in: query
        name: fields
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siren
            - businessName
            - entityType
            - administrativeStatus
            - instructions
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegalUnitPayloadHistory'
          description: Returns a company.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: Consult a siren (legal unit) by SIREN number
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/siren/search:
    post:
      description: Multi-criteria company search.
      operationId: searchCompanyBySiren
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchSiren'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SirenSearchResponse'
          description: "Returns one or more companies. \n\n**If no limit is set or\
            \ it exceeds 200, and more than 200 matches are found, the API returns\
            \ the first 200 records with an HTTP 206 (Partial Content) status.**"
        '204':
          description: No Content - No content expected
        '206':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SirenSearchResponse'
          description: Request processed without error, but the volume of information
            returned has been reduced.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: SIREN search (or legal unit)
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/siret/code-insee:{siret}:
    get:
      description: Returns the details of a facility associated to a SIRET.
      operationId: getFacilityBySiret
      parameters:
      - in: path
        name: siret
        required: true
        schema:
          type: string
          maxLength: 14
          minLength: 0
          pattern: ^([0-9]{14})$
      - description: Fields of the SIRET resource.
        explode: false
        in: query
        name: fields
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siret
            - siren
            - name
            - facilityType
            - administrativeStatus
            - siretInstructions
            - address
            - pmStatus
            - pmOnly
            - managesPaymentStatus
            - managesLegalCommitment
            - managesLegalCommitmentOrService
            - serviceCodeStatus
      - description: Relations to include in the response.
        explode: false
        in: query
        name: include
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siren
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FacilityPayloadHistory'
          description: Returns a facility.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: Gets a siret (facility) by SIRET number
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/siret/search:
    post:
      description: "Multi-criteria search for facilities. \n\n**If no limit is set\
        \ or it exceeds 200, and more than 200 matches are found, the API returns\
        \ the first 200 records with an HTTP 206 (Partial Content) status.**"
      operationId: searchFacilityBySiret
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchSiret'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiretSearchResponse'
          description: Returns an establishment as defined on a given observation
            date or as defined on the current date if the observation date is not
            specified.
        '204':
          description: No Content - No content expected
        '206':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiretSearchResponse'
          description: Request processed without error, but the volume of information
            returned has been reduced.
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              example:
                errorCode: REQUEST_TIMEOUT
                errorMessage: Requested timeout is Exceeded
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              example:
                errorCode: UNPROCESSABLE_ENTITY
                errorMessage: Entity consistency error
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              example:
                errorCode: TOO_MANY_REQUESTS
                errorMessage: The client emitted too many requests
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              example:
                errorCode: NOT_IMPLEMENTED
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
                type: /path/reference-url
                details: Error detailed description
                instance: /chemin/url-de-reference#instance-du-contexte
              schema:
                $ref: '#/components/schemas/Error'
          description: An error has occurred - See the status code and json response
            for more information.
      security:
      - oauth2: []
      summary: Search for a SIRET (facility)
      tags:
      - AFNOR Directory API
  /spaces/connectors/afnor/v1/webhooks:
    get:
      operationId: listWebhooks
      parameters:
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      - description: Jefacture space_id
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWebhookResponse'
          description: OK - Webhook Id List Response
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_read
      summary: Retrieve the list of webhooks created by the owner of the token
      tags:
      - AFNOR Flow API
      description: ' <br/> Scope: space_read'
    post:
      description: '- Create a new webhook - With technical & security parameters
        - With metadata to filter on subsets  <br/> Scope: space_write'
      operationId: createWebhook
      parameters:
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      - description: Jefacture space_id
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookParams'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookIdParam'
          description: OK - Webhook Created
        '400':
          content:
            application/json:
              example:
                errorCode: MISSING_REQUIRED_FIELD
                errorMessage: Invalid request format
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              example:
                errorCode: MISSING_TOKEN
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              example:
                errorCode: FORBIDDEN_ACCESS
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '500':
          content:
            application/json:
              example:
                errorCode: INTERNAL_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              example:
                errorCode: RESOURCE_ERROR
                errorMessage: null
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_write
      summary: Subscribe to a webhook
      tags:
      - AFNOR Flow API
  /spaces/connectors/afnor/v1/webhooks/{webhookId}:
    delete:
      description: '- Delete a subscription owned by the owner of the token - The
        operation is allowed only by the owner of the token <br/> Scope: space_write'
      operationId: deleteWebhook
      parameters:
      - description: The webhook unique ID
        in: path
        name: webhookId
        required: true
        schema:
          type: string
          format: uuid
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      - description: Jefacture space_id
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      responses:
        '204':
          description: No Content - No content expected
        '404':
          content:
            application/json:
              example:
                errorCode: MISSING_RESOURCE
                errorMessage: Requested resource is Not Found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
      security:
      - oauth2:
        - space_write
      summary: Unsubscribe to a webhook
      tags:
      - AFNOR Flow API
components:
  schemas:
    AcceptDesignationPdpRequest:
      type: object
      properties:
        authorizingSpaceId:
          type: string
          format: uuid
        spaces:
          type: array
          items:
            $ref: '#/components/schemas/AcceptDesignationPdpSpace'
          minItems: 1
      required:
      - spaces
    AcceptDesignationPdpSpace:
      type: object
      properties:
        identifiers:
          type: array
          items:
            type: string
        spaceId:
          type: string
          format: uuid
      required:
      - spaceId
    ConfigureExtensionRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        namespace:
          type: string
          minLength: 1
        settings:
          $ref: '#/components/schemas/ConnectorConfigurationSettings'
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - name
      - namespace
      - spaceId
    ConnectorConfigurationSettings:
      type: object
    DocumentValidationRequest:
      type: object
      properties:
        documentId:
          type: string
          format: uuid
        dryRun:
          type: boolean
        spaceId:
          type: string
          format: uuid
        validationId:
          type: string
          format: uuid
      required:
      - documentId
      - spaceId
      - validationId
    ExtensionActivateRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        namespace:
          type: string
          minLength: 1
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - name
      - namespace
      - spaceId
    ExtensionAddRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - spaceId
    ExtensionDeactivateRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        namespace:
          type: string
          minLength: 1
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - name
      - namespace
      - spaceId
    ExtensionUpdateConfigureDetailResult:
      type: object
      properties:
        enabled:
          type: boolean
        identifier:
          type: string
        message:
          type: string
        migrationCode:
          type: string
        migrations:
          $ref: '#/components/schemas/MigrationState'
        success:
          type: boolean
    ExtensionUpdateConfigureResult:
      type: object
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/ExtensionUpdateConfigureDetailResult'
        totalFailure:
          type: integer
          format: int64
        totalSuccess:
          type: integer
          format: int64
    ExtensionUpgradeRequest:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        extensionId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - entityId
      - extensionId
      - spaceId
    MigrationState:
      type: object
      properties:
        direction:
          type: string
        errorReasonCode:
          type: string
          enum:
          - UNKNOWN
          - MIGRATION_CODE_INVALID
          - MIGRATION_CODE_EXPIRED
        status:
          type: string
          enum:
          - PENDING
          - MIGRATED
          - FAILED
    PDPInfo:
      type: object
      description: PDP information (optional)
      example: {}
      properties:
        endDate:
          type: string
        peppolNetworkUrl:
          type: string
        startDate:
          type: string
    PeppolDirectorySearchRequest:
      type: object
      properties:
        connectionId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - connectionId
      - spaceId
    PeppolDocumentAddRequest:
      type: object
      properties:
        deliveryId:
          type: string
        description:
          type: string
        documentNumber:
          type: string
        documentTypeCode:
          type: string
        documentTypeId:
          type: string
        entityId:
          type: string
          format: uuid
        invoiceIssueDate:
          type: string
        invoiceReceiverCountryCode:
          type: string
        originalReceiver:
          type: string
        originalReceiverCountryCode:
          type: string
        originalSender:
          type: string
        originalSenderCountryCode:
          type: string
        processId:
          type: string
        receiverLegalName:
          type: string
        senderLegalName:
          type: string
        spaceId:
          type: string
          format: uuid
        ublFile:
          type: string
          format: binary
      required:
      - deliveryId
      - entityId
      - spaceId
      - ublFile
    PeppolDocumentAddResult:
      type: object
      properties:
        entityId:
          type: string
          format: uuid
        fileId:
          type: string
        message:
          type: string
        spaceId:
          type: string
          format: uuid
        status:
          type: boolean
    PeppolDocumentSendRequest:
      type: object
      properties:
        documentIds:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
        spaceId:
          type: string
          format: uuid
      required:
      - documentIds
      - spaceId
    PeppolMessageResult:
      type: object
      properties:
        message:
          type: string
        messageId:
          type: string
    PeppolParticipantInformation:
      type: object
      properties:
        globalidentifierKey:
          type: string
          description: The key that used in globalidentifier
          example: fr:vat
        inNationalDirectory:
          type: boolean
          description: True if found in the country's National Directory (France only)
        isDefault:
          type: boolean
          description: True if this is the default identifier for the space
        migrationCode:
          type: string
          description: Migration code used for the last inbound SMP migration (if
            any)
        migrations:
          $ref: '#/components/schemas/MigrationState'
        participantId:
          type: string
          description: The Peppol participant ID
          example: 0208:0417497106
          minLength: 1
        pdpInfo:
          $ref: '#/components/schemas/PDPInfo'
        platform:
          type: string
          description: The platform name (optional)
          example: banqup
        registered:
          type: boolean
          description: Indicates if the participant already registered
          example: true
        registrable:
          type: boolean
          description: Indicates if the participant can be registered/unregistered
          example: true
        schemaId:
          type: string
          description: The scheme identifier for the participant
          example: 0208
          minLength: 1
        sendOnly:
          type: boolean
      required:
      - participantId
      - registered
      - registrable
      - schemaId
    PeppolSearchDocumentType:
      type: object
      properties:
        scheme:
          type: string
        value:
          type: string
    PeppolSearchParticipantId:
      type: object
      properties:
        scheme:
          type: string
        value:
          type: string
    PeppolSearchResponse:
      type: object
      properties:
        name:
          type: string
        settings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PeppolSearchSetting'
    PeppolSearchSetting:
      type: object
      properties:
        docTypes:
          type: array
          items:
            $ref: '#/components/schemas/PeppolSearchDocumentType'
        participantId:
          $ref: '#/components/schemas/PeppolSearchParticipantId'
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
          format: uri
        properties:
          type: object
          additionalProperties:
            type: object
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
    KSeFDirectorySearchRequest:
      type: object
      properties:
        connectionId:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
      required:
      - connectionId
      - spaceId
    Acknowledgement:
      type: object
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/AcknowledgementDetail'
          minItems: 1
        status:
          type: string
          enum:
          - Pending
          - Ok
          - Error
      required:
      - status
    AcknowledgementDetail:
      type: object
      properties:
        item:
          type: string
        level:
          type: string
          enum:
          - Error
          - Warning
        reasonCode:
          $ref: '#/components/schemas/ReasonCode'
        reasonMessage:
          type: string
      required:
      - item
      - level
      - reasonCode
      - reasonMessage
    BasicAuthentication:
      type: object
      allOf:
      - $ref: '#/components/schemas/CallbackAuthentication'
      - type: object
        properties:
          userId:
            type: string
          userPassword:
            type: string
            format: password
      required:
      - authType
      - userId
      - userPassword
    CallbackAuthentication:
      type: object
      discriminator:
        mapping:
          BASIC: '#/components/schemas/BasicAuthentication'
          OAUTH2: '#/components/schemas/OAuth2Authentication'
        propertyName: authType
      properties:
        authType:
          type: string
          enum:
          - BASIC
          - OAUTH2
      required:
      - authType
    CallbackHeader:
      type: object
      properties:
        headerName:
          type: string
        headerValue:
          type: string
      required:
      - headerName
      - headerValue
    CallbackParameters:
      type: object
      properties:
        authentication:
          oneOf:
          - $ref: '#/components/schemas/BasicAuthentication'
          - $ref: '#/components/schemas/OAuth2Authentication'
        headers:
          type: array
          items:
            $ref: '#/components/schemas/CallbackHeader'
        signature:
          $ref: '#/components/schemas/CallbackSignature'
        url:
          type: string
          format: uri
      required:
      - url
    CallbackSignature:
      type: object
      properties:
        algo:
          type: string
          enum:
          - RS256
          - HS256
          - ECDSA
          - EDDSA_25519
          - RSA_PSS
          - EDDSA_448
        key:
          type: string
          format: byte
          description: Base 64 encoded string
      required:
      - algo
      - key
    CreateFlowRequest:
      type: object
      properties:
        file:
          type: string
          format: binary
        flowInfo:
          $ref: '#/components/schemas/FlowInfo'
      required:
      - file
      - flowInfo
    DirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodeRoutingCode:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/addressRead'
        administrativeStatus:
          type: string
          enum:
          - A
          - C
        managesLegalCommitment:
          type: boolean
        routingCodeName:
          type: string
          maxLength: 100
          minLength: 0
          pattern: ^(?!\s*$).+
        routingIdentifier:
          type: string
          maxLength: 100
          minLength: 0
          pattern: ^(?!\s+$)[\-_/a-zA-Z0-9]{1,100}$
        routingIdentifierType:
          type: string
          maxLength: 4
          minLength: 0
          pattern: ^(?!\s*$).+
    DirectoryLinePayloadLegalUnitFacilityRoutingCode:
      type: object
      properties:
        addressingIdentifier:
          type: string
          maxLength: 125
          minLength: 0
        addressingSuffix:
          type: string
          maxLength: 100
          minLength: 0
        facility:
          $ref: '#/components/schemas/FacilityPayloadIncluded'
        legalUnit:
          $ref: '#/components/schemas/LegalUnitPayloadIncluded'
        platformType:
          type: string
          enum:
          - WK
          - DFH
          maxLength: 3
          minLength: 0
        routingCode:
          $ref: '#/components/schemas/DirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodeRoutingCode'
        siren:
          type: string
          maxLength: 9
          minLength: 0
          pattern: ^([0-9]{9})$
        siret:
          type: string
          maxLength: 14
          minLength: 0
          pattern: ^([0-9]{14})$
    DirectoryLinePayloadStatusLegalUnitFacilityRoutingCode:
      type: object
      properties:
        addressingIdentifier:
          type: string
          maxLength: 125
          minLength: 0
        addressingSuffix:
          type: string
          maxLength: 100
          minLength: 0
        directoryLineStatus:
          type: string
          enum:
          - Enabled
          - Disabled
          - Upcoming
        facility:
          $ref: '#/components/schemas/FacilityPayloadIncluded'
        legalUnit:
          $ref: '#/components/schemas/LegalUnitPayloadIncluded'
        platformType:
          type: string
          enum:
          - WK
          - DFH
        routingCode:
          $ref: '#/components/schemas/DirectoryLinePayloadHistoryLegalUnitFacilityRoutingCodeRoutingCode'
        siren:
          type: string
          maxLength: 9
          minLength: 0
          pattern: ^([0-9]{9})$
        siret:
          type: string
          maxLength: 14
          minLength: 0
          pattern: ^([0-9]{14})$
    DirectoryLineSearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/DirectoryLinePayloadStatusLegalUnitFacilityRoutingCode'
        search:
          $ref: '#/components/schemas/SearchDirectoryLine'
        totalNumberOfResults:
          type: integer
          format: int32
    Error:
      type: object
      description: We have another field called type under the string-uri format.
        It is currently hidden because it causes the document portal page to crash.
      properties:
        details:
          type: string
        errorCode:
          type: string
        errorMessage:
          type: string
        instance:
          type: string
          format: uri
      required:
      - errorCode
    FacilityPayloadHistory:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/addressRead'
        administrativeStatus:
          type: string
          enum:
          - A
          - C
        b2gAdditionalData:
          $ref: '#/components/schemas/FacilityPayloadHistoryUleB2gAdditionalData'
        facilityType:
          type: string
          enum:
          - P
          - S
        legalUnit:
          $ref: '#/components/schemas/LegalUnitPayloadIncluded'
        name:
          type: string
          maxLength: 100
          minLength: 0
        siren:
          type: string
          maxLength: 9
          minLength: 0
          pattern: ^([0-9]{9})$
        siret:
          type: string
          maxLength: 14
          minLength: 0
          pattern: ^([0-9]{14})$
        siretInstructions:
          $ref: '#/components/schemas/SiretInstructions'
    FacilityPayloadHistoryUleB2gAdditionalData:
      type: object
      properties:
        managesLegalCommitmentCode:
          type: boolean
        managesLegalCommitmentOrServiceCode:
          type: boolean
        managesPaymentStatus:
          type: boolean
        pm:
          type: boolean
        pmOnly:
          type: boolean
        serviceCodeStatus:
          type: boolean
    FacilityPayloadIncluded:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/addressRead'
        administrativeStatus:
          type: string
          enum:
          - A
          - C
        b2gAdditionalData:
          $ref: '#/components/schemas/FacilityPayloadHistoryUleB2gAdditionalData'
        facilityType:
          type: string
          enum:
          - P
          - S
        name:
          type: string
          maxLength: 100
          minLength: 0
        siren:
          type: string
          maxLength: 9
          minLength: 0
          pattern: ^([0-9]{9})$
        siret:
          type: string
          maxLength: 14
          minLength: 0
          pattern: ^([0-9]{14})$
    Flow:
      type: object
      properties:
        acknowledgement:
          $ref: '#/components/schemas/Acknowledgement'
        flowDirection:
          type: string
          enum:
          - In
          - Out
        flowId:
          type: string
          description: Unique identifier supporting UUID but not only, for flexibility
            purpose
          maxLength: 36
          minLength: 0
        flowProfile:
          type: string
          enum:
          - Basic
          - CIUS
          - Extended-CTC-FR
        flowSyntax:
          type: string
          enum:
          - CII
          - UBL
          - Factur-X
          - CDAR
          - FRR
        flowType:
          type: string
          enum:
          - CustomerInvoice
          - SupplierInvoice
          - StateInvoice
          - CustomerInvoiceLC
          - SupplierInvoiceLC
          - StateCustomerInvoiceLC
          - StateSupplierInvoiceLC
          - AggregatedCustomerTransactionReport
          - UnitaryCustomerTransactionReport
          - AggregatedCustomerPaymentReport
          - UnitaryCustomerPaymentReport
          - UnitarySupplierTransactionReport
          - MultiFlowReport
        name:
          type: string
          maxLength: 255
          minLength: 0
        processingRule:
          type: string
          enum:
          - B2B
          - B2BInt
          - B2C
          - B2G
          - B2GInt
          - OutOfScope
          - B2GOutOfScope
          - ArchiveOnly
          - NotApplicable
        processingRuleSource:
          type: string
          enum:
          - Input
          - Computed
        submittedAt:
          type: string
          format: date-time
        trackingId:
          type: string
          description: Unique identifier supporting UUID but not only, for flexibility
            purpose
          maxLength: 36
        updatedAt:
          type: string
          format: date-time
      required:
      - acknowledgement
      - flowDirection
      - flowId
      - flowSyntax
      - flowType
      - name
      - processingRuleSource
      - submittedAt
      - updatedAt
    FlowInfo:
      type: object
      description: Signaling of the flow
      properties:
        flowProfile:
          type: string
          enum:
          - Basic
          - CIUS
          - Extended-CTC-FR
        flowSyntax:
          type: string
          enum:
          - CII
          - UBL
          - Factur-X
          - CDAR
          - FRR
        name:
          type: string
          maxLength: 255
          minLength: 0
        processingRule:
          type: string
          enum:
          - B2B
          - B2BInt
          - B2C
          - B2G
          - B2GInt
          - OutOfScope
          - B2GOutOfScope
          - ArchiveOnly
          - NotApplicable
        sha256:
          type: string
          format: byte
          description: 'The sha256 is the fingerprint of the attached file:


            if provided in the request: it should be checked once received

            if not provided in the request: it may be computed and returned in the
            response

            '
          pattern: ^[a-f0-9]{64}$
        trackingId:
          type: string
          description: Unique identifier supporting UUID but not only, for flexibility
            purpose
          maxLength: 36
      required:
      - flowSyntax
      - name
    FullFlowInfo:
      type: object
      properties:
        flowId:
          type: string
          description: Unique identifier supporting UUID but not only, for flexibility
            purpose
          maxLength: 36
          minLength: 0
        flowProfile:
          type: string
          enum:
          - Basic
          - CIUS
          - Extended-CTC-FR
        flowSyntax:
          type: string
          enum:
          - CII
          - UBL
          - Factur-X
          - CDAR
          - FRR
        name:
          type: string
          maxLength: 255
          minLength: 0
        processingRule:
          type: string
          enum:
          - B2B
          - B2BInt
          - B2C
          - B2G
          - B2GInt
          - OutOfScope
          - B2GOutOfScope
          - ArchiveOnly
          - NotApplicable
        sha256:
          type: string
          format: byte
          description: 'The sha256 is the fingerprint of the attached file:


            if provided in the request: it should be checked once received

            if not provided in the request: it may be computed and returned in the
            response

            '
          pattern: ^[a-f0-9]{64}$
        submittedAt:
          type: string
          format: date-time
        trackingId:
          type: string
          description: Unique identifier supporting UUID but not only, for flexibility
            purpose
          maxLength: 36
      required:
      - flowId
      - flowSyntax
      - name
      - submittedAt
    LegalUnitPayloadHistory:
      type: object
      properties:
        administrativeStatus:
          type: string
          enum:
          - A
          - C
          maxLength: 1
          minLength: 0
        businessName:
          type: string
          maxLength: 150
          minLength: 0
        entityType:
          type: string
          enum:
          - Public
          - PrivateVatRegistered
          maxLength: 20
          minLength: 0
        instructions:
          $ref: '#/components/schemas/SirenInstructions'
        siren:
          type: string
          maxLength: 9
          minLength: 0
          pattern: ^([0-9]{9})$
    LegalUnitPayloadIncluded:
      type: object
      properties:
        administrativeStatus:
          type: string
          enum:
          - A
          - C
          maxLength: 1
          minLength: 0
        businessName:
          type: string
          maxLength: 150
          minLength: 0
        entityType:
          type: string
          enum:
          - Public
          - PrivateVatRegistered
          maxLength: 20
          minLength: 0
        siren:
          type: string
          maxLength: 9
          minLength: 0
          pattern: ^([0-9]{9})$
    ListWebhookResponse:
      type: object
      properties:
        webhookIds:
          type: array
          items:
            type: string
            format: uuid
      required:
      - webhookIds
    OAuth2Authentication:
      type: object
      allOf:
      - $ref: '#/components/schemas/CallbackAuthentication'
      - type: object
        properties:
          clientId:
            type: string
          clientSecret:
            type: string
            format: password
          tokenUrl:
            type: string
            format: uri
      required:
      - authType
      - clientId
      - clientSecret
      - tokenUrl
    ReasonCode:
      type: object
      description: A predefined set of reason code values + ability to extend this
        set
      oneOf:
      - $ref: '#/components/schemas/ReasonCodeEnum'
      - type: string
    ReasonCodeEnum:
      type: string
      description: '- `EmptyAttachement`      : One or more attachments are empty.
        (ie IRR_VID_PJ)

        - `AttachmentTypeError`   : The type and/or extension of one or more attachments
        is not compliant. (ie IRR_EXT_DOC)

        - `EmptyFlow`             : The binary flow is empty. (ie IRR_VID_F)

        - `OtherTechnicalError`   : Other technical error. (ie AUTRE)

        - `InvalidSchema`         : Invalid XML schema. (ie IRR_SYNTAX)

        - `FileSizeExceeded`      : File size limit reached. (ie IRR_TAILLE_F)

        - `FlowTypeError`         : The flow type and/or extension are not compliant.
        (ie IRR_TYPE_F)

        - `AlreadyExistingFlow`   : The flow has already been sent and received. (ie
        N/A)

        - `VirusFound`            : Presence of a virus. (ie IRR_ANTIVIRUS)

        - `ChecksumMismatch`      : Checksum provided is different from computed one

        - `InvoiceLCInvalidStatus`: One or more statuses are inconsistent

        - `InvoiceLCStatusError`  : One or more statuses are incorrect or not allowed

        - `InvoiceLCRuleError`    : One or more rules are not matched

        - `InvoiceLCAccessDenied` : One of the request is not authorized and requests
        permissions

        - `InvoiceLCAmountError`  : One or more amounts are not consistent in regards
        to the VAT

        '
      enum:
      - EmptyAttachement
      - AttachmentTypeError
      - EmptyFlow
      - OtherTechnicalError
      - InvalidSchema
      - FileSizeExceeded
      - FlowTypeError
      - AlreadyExistingFlow
      - VirusFound
      - ChecksumMismatch
      - InvoiceLCInvalidStatus
      - InvoiceLCStatusError
      - InvoiceLCRuleError
      - InvoiceLCAccessDenied
      - InvoiceLCAmountError
      - ValidationError
    RoutingCodePayloadHistoryLegalUnitFacility:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/addressRead'
        administrativeStatus:
          type: string
          enum:
          - A
          - C
          maxLength: 1
          minLength: 0
        facility:
          $ref: '#/components/schemas/FacilityPayloadIncluded'
        legalUnit:
          $ref: '#/components/schemas/LegalUnitPayloadIncluded'
        managesLegalCommitmentCode:
          type: boolean
        routingCodeName:
          type: string
          maxLength: 100
          minLength: 0
          pattern: ^(?!\s*$).+
        routingIdentifier:
          type: string
          maxLength: 100
          minLength: 0
          pattern: ^(?!\s+$)[\-_/a-zA-Z0-9]{1,100}$
        routingIdentifierType:
          type: string
          maxLength: 4
          minLength: 0
          pattern: ^(?!\s*$).+
        siret:
          type: string
          maxLength: 14
          minLength: 0
          pattern: ^([0-9]{14})$
    RoutingCodeSearch:
      type: object
      properties:
        fields:
          type: array
          items:
            type: string
            enum:
            - siret
            - routingIdentifierType
            - routingCodeName
            - routingIdentifier
            - managesLegalCommitmentCode
            - administrativeStatus
            - address
        filters:
          $ref: '#/components/schemas/RoutingCodeSearchFilters'
        ignore:
          type: integer
          format: int32
          description: Number of results to skip
        include:
          type: array
          items:
            type: string
            enum:
            - siren
            - siret
        limit:
          type: integer
          format: int32
          description: It should be not set or greater than 0
          minimum: 1
        sorting:
          type: array
          items:
            $ref: '#/components/schemas/RoutingCodeSearchSortingInner'
    RoutingCodeSearchFilters:
      type: object
      properties:
        addressLines:
          $ref: '#/components/schemas/SearchSiretFiltersAddressLines'
        administrativeStatus:
          $ref: '#/components/schemas/RoutingCodeSearchFiltersAdministrativeStatus'
        locality:
          $ref: '#/components/schemas/SearchSiretFiltersLocality'
        postalCode:
          $ref: '#/components/schemas/SearchSiretFiltersPostalCode'
        routingCodeName:
          $ref: '#/components/schemas/RoutingCodeSearchFiltersRoutingCodeName'
        routingIdentifier:
          $ref: '#/components/schemas/RoutingCodeSearchFiltersRoutingIdentifier'
        siret:
          $ref: '#/components/schemas/SearchSiretFiltersSiret'
    RoutingCodeSearchFiltersAdministrativeStatus:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          enum:
          - A
          - C
    RoutingCodeSearchFiltersRoutingCodeName:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
          - strict
        value:
          type: string
          maxLength: 100
          minLength: 0
          pattern: ^$|^(?!\s*$).+
    RoutingCodeSearchFiltersRoutingIdentifier:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
          - strict
        value:
          type: string
          maxLength: 100
          minLength: 0
          pattern: ^$|^(?!\s*$).+
    RoutingCodeSearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/RoutingCodePayloadHistoryLegalUnitFacility'
        search:
          $ref: '#/components/schemas/RoutingCodeSearch'
        totalNumberOfResults:
          type: integer
          format: int32
    RoutingCodeSearchSortingInner:
      type: object
      properties:
        field:
          type: string
          enum:
          - siret
          - routingIdentifierType
          - routingCodeName
          - routingIdentifier
          - managesLegalCommitmentCode
          - administrativeStatus
          - address
        order:
          type: string
          enum:
          - ascending
          - descending
    SearchDirectoryLine:
      type: object
      properties:
        fields:
          type: array
          items:
            type: string
            enum:
            - addressingIdentifier
            - siren
            - siret
            - routingIdentifier
            - addressingSuffix
        filters:
          $ref: '#/components/schemas/SearchDirectoryLineFilters'
        ignore:
          type: integer
          format: int32
          description: Number of results to skip
        limit:
          type: integer
          format: int32
          description: It should be not set or greater than 0
          minimum: 1
        sorting:
          type: array
          items:
            $ref: '#/components/schemas/SearchDirectoryLineSortingInner'
    SearchDirectoryLineFilters:
      type: object
      properties:
        addressingIdentifier:
          $ref: '#/components/schemas/SearchDirectoryLineFiltersAddressingIdentifier'
        addressingSuffix:
          $ref: '#/components/schemas/SearchDirectoryLineFiltersAddressingSuffix'
        routingIdentifier:
          $ref: '#/components/schemas/RoutingCodeSearchFiltersRoutingIdentifier'
        siren:
          $ref: '#/components/schemas/SearchSirenFiltersSiren'
        siret:
          $ref: '#/components/schemas/SearchSiretFiltersSiret'
    SearchDirectoryLineFiltersAddressingIdentifier:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
          - strict
        value:
          type: string
          maxLength: 125
          minLength: 0
    SearchDirectoryLineFiltersAddressingSuffix:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
          - strict
        value:
          type: string
          maxLength: 100
          minLength: 0
    SearchDirectoryLineSortingInner:
      type: object
      properties:
        field:
          type: string
          enum:
          - addressingIdentifier
          - siren
          - siret
          - routingIdentifier
          - addressingSuffix
        sortingOrder:
          type: string
          enum:
          - ascending
          - descending
    SearchFlowContent:
      type: object
      properties:
        filters:
          $ref: '#/components/schemas/SearchFlowFilters'
        limit:
          type: integer
          format: int32
        results:
          type: array
          items:
            $ref: '#/components/schemas/Flow'
    SearchFlowFilters:
      type: object
      description: Filtering criteria, at least one is required
      properties:
        ackStatus:
          type: string
          enum:
          - Pending
          - Ok
          - Error
        flowDirection:
          type: array
          items:
            type: string
            enum:
            - In
            - Out
        flowType:
          type: array
          items:
            type: string
            enum:
            - CustomerInvoice
            - SupplierInvoice
            - StateInvoice
            - CustomerInvoiceLC
            - SupplierInvoiceLC
            - StateCustomerInvoiceLC
            - StateSupplierInvoiceLC
            - AggregatedCustomerTransactionReport
            - UnitaryCustomerTransactionReport
            - AggregatedCustomerPaymentReport
            - UnitaryCustomerPaymentReport
            - UnitarySupplierTransactionReport
            - MultiFlowReport
        processingRule:
          type: array
          items:
            type: string
            enum:
            - B2B
            - B2BInt
            - B2C
            - B2G
            - B2GInt
            - OutOfScope
            - B2GOutOfScope
            - ArchiveOnly
            - NotApplicable
        trackingId:
          type: string
          description: Unique identifier supporting UUID but not only, for flexibility
            purpose
          maxLength: 36
        updatedAfter:
          type: string
          format: date-time
        updatedBefore:
          type: string
          format: date-time
    SearchFlowParams:
      type: object
      properties:
        limit:
          type: integer
          format: int32
          description: 'default: 25'
          maximum: 100
        where:
          $ref: '#/components/schemas/SearchFlowFilters'
      required:
      - where
    SearchSiren:
      type: object
      properties:
        fields:
          type: array
          items:
            type: string
            enum:
            - siren
            - businessName
            - entityType
            - administrativeStatus
            - instructions
        filters:
          $ref: '#/components/schemas/SearchSirenFilters'
        ignore:
          type: integer
          format: int32
          description: Number of results to skip
        limit:
          type: integer
          format: int32
          description: It should be not set or greater than 0
          minimum: 1
        sorting:
          type: array
          items:
            $ref: '#/components/schemas/SearchSirenSortingInner'
    SearchSirenFilters:
      type: object
      properties:
        administrativeStatus:
          $ref: '#/components/schemas/SearchSirenFiltersAdministrativeStatus'
        businessName:
          $ref: '#/components/schemas/SearchSirenFiltersBusinessName'
        entityType:
          $ref: '#/components/schemas/SearchSirenFiltersEntityType'
        siren:
          $ref: '#/components/schemas/SearchSirenFiltersSiren'
    SearchSirenFiltersAdministrativeStatus:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          enum:
          - A
          - C
    SearchSirenFiltersBusinessName:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
          - strict
        value:
          type: string
          maxLength: 150
          minLength: 0
    SearchSirenFiltersEntityType:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          enum:
          - Public
          - PrivateVatRegistered
    SearchSirenFiltersSiren:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          maxLength: 9
          minLength: 0
          pattern: '[0-9]*'
    SearchSirenSortingInner:
      type: object
      properties:
        field:
          type: string
          enum:
          - siren
          - businessName
          - entityType
          - administrativeStatus
          - instructions
        sortingOrder:
          type: string
          enum:
          - ascending
          - descending
    SearchSiret:
      type: object
      properties:
        fields:
          type: array
          items:
            type: string
            enum:
            - siret
            - siren
            - name
            - facilityType
            - administrativeStatus
            - siretInstructions
            - address
            - pmStatus
            - pmOnly
            - managesPaymentStatus
            - managesLegalCommitment
            - managesLegalCommitmentOrService
            - serviceCodeStatus
        filters:
          $ref: '#/components/schemas/SearchSiretFilters'
        ignore:
          type: integer
          format: int32
          description: Number of results to skip
        include:
          type: array
          items:
            type: string
            enum:
            - siren
        limit:
          type: integer
          format: int32
          description: It should be not set or greater than 0
          minimum: 1
        sorting:
          type: array
          items:
            $ref: '#/components/schemas/SearchSiretSortingInner'
    SearchSiretFilters:
      type: object
      properties:
        addressLines:
          $ref: '#/components/schemas/SearchSiretFiltersAddressLines'
        administrativeStatus:
          $ref: '#/components/schemas/SearchSiretFiltersAdministrativeStatus'
        countrySubdivision:
          $ref: '#/components/schemas/SearchSiretFiltersCountrySubdivision'
        facilityType:
          $ref: '#/components/schemas/SearchSiretFiltersFacilityType'
        locality:
          $ref: '#/components/schemas/SearchSiretFiltersLocality'
        name:
          $ref: '#/components/schemas/SearchSiretFiltersName'
        postalCode:
          $ref: '#/components/schemas/SearchSiretFiltersPostalCode'
        siren:
          $ref: '#/components/schemas/SearchSirenFiltersSiren'
        siret:
          $ref: '#/components/schemas/SearchSiretFiltersSiret'
    SearchSiretFiltersAddressLines:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
        value:
          type: string
          maxLength: 600
          minLength: 0
    SearchSiretFiltersAdministrativeStatus:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          enum:
          - A
          - C
    SearchSiretFiltersCountrySubdivision:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          maxLength: 255
          minLength: 0
    SearchSiretFiltersFacilityType:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          enum:
          - P
          - S
    SearchSiretFiltersLocality:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
          - strict
        value:
          type: string
          maxLength: 100
          minLength: 0
    SearchSiretFiltersName:
      type: object
      properties:
        op:
          type: string
          enum:
          - contains
          - strict
        value:
          type: string
          maxLength: 100
          minLength: 0
    SearchSiretFiltersPostalCode:
      type: object
      properties:
        op:
          type: string
          enum:
          - startWith
          - strict
        value:
          type: string
          maxLength: 5
          minLength: 0
          pattern: '[0-9]*'
    SearchSiretFiltersSiret:
      type: object
      properties:
        op:
          type: string
          enum:
          - strict
        value:
          type: string
          maxLength: 14
          minLength: 0
          pattern: '[0-9]*'
    SearchSiretSortingInner:
      type: object
      properties:
        field:
          type: string
          enum:
          - siret
          - siren
          - name
          - facilityType
          - administrativeStatus
          - siretInstructions
          - address
          - pmStatus
          - pmOnly
          - managesPaymentStatus
          - managesLegalCommitment
          - managesLegalCommitmentOrService
          - serviceCodeStatus
        sortingOrder:
          type: string
          enum:
          - ascending
          - descending
    SirenInstructions:
      type: object
      properties:
        isSalesProspectingForbidden:
          type: boolean
    SirenSearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/LegalUnitPayloadHistory'
        search:
          $ref: '#/components/schemas/SearchSiren'
        totalNumberOfResults:
          type: integer
          format: int32
    SiretInstructions:
      type: object
      properties:
        isSalesProspectingForbidden:
          type: boolean
    SiretSearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/FacilityPayloadHistory'
        search:
          $ref: '#/components/schemas/SearchSiret'
        totalNumberOfResults:
          type: integer
          format: int32
    WebhookIdParam:
      type: object
      properties:
        webhookId:
          type: string
          format: uuid
    WebhookMetadata:
      type: object
      properties:
        ackStatus:
          type: string
          enum:
          - Pending
          - Ok
          - Error
        flowDirection:
          type: string
          enum:
          - In
          - Out
        flowType:
          type: string
          enum:
          - CustomerInvoice
          - SupplierInvoice
          - StateInvoice
          - CustomerInvoiceLC
          - SupplierInvoiceLC
          - StateCustomerInvoiceLC
          - StateSupplierInvoiceLC
          - AggregatedCustomerTransactionReport
          - UnitaryCustomerTransactionReport
          - AggregatedCustomerPaymentReport
          - UnitaryCustomerPaymentReport
          - UnitarySupplierTransactionReport
          - MultiFlowReport
        processingRule:
          type: string
          enum:
          - B2B
          - B2BInt
          - B2C
          - B2G
          - B2GInt
          - OutOfScope
          - B2GOutOfScope
          - ArchiveOnly
          - NotApplicable
      required:
      - flowDirection
      - flowType
    WebhookParams:
      type: object
      description: Create a webhook
      properties:
        callback:
          $ref: '#/components/schemas/CallbackParameters'
        metadata:
          $ref: '#/components/schemas/WebhookMetadata'
      required:
      - callback
      - metadata
    addressRead:
      type: object
      description: Wrapper for postal addresses
      properties:
        addressLine1:
          type: string
          maxLength: 255
          minLength: 0
        addressLine2:
          type: string
          maxLength: 255
          minLength: 0
        addressLine3:
          type: string
          maxLength: 255
          minLength: 0
        countryCode:
          type: string
          maxLength: 2
          minLength: 0
        countryName:
          type: string
          maxLength: 100
          minLength: 0
        countrySubdivision:
          type: string
          maxLength: 255
          minLength: 0
        locality:
          type: string
          maxLength: 100
          minLength: 0
        postalCode:
          type: string
          maxLength: 5
          minLength: 0
          pattern: '[0-9]*'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.cve.btx.eu.banqup.com/oauth2/auth
          tokenUrl: https://api.cve.btx.eu.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
tags:
- description: AFNOR Directory Service
  name: AFNOR Directory API
- description: AFNOR Flow Service
  name: AFNOR Flow API
security:
- oauth2: []
