openapi: 3.0.1
info:
  description: The Afnor Connector API
  title: Afnor Connector API
  version: 1.10.0-CR4
servers:
- description: Generated server url
  url: https://api.uat.btx.eu.banqup.com/network/documents
- description: Generated server url
  url: https://api.uat.btx.fr.banqup.com/network/documents
security:
- oauth2: []
paths:
  /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: getDirectoryLineByAddressingIdentifier
      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..
        in: query
        name: include
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siren
            - siret
            - routingCode
      - description: Fields of the Directory Line resource
        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: Retourns a directory line.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              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:
      - Directory Line 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:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad request. The request is invalid or cannot be completed.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized. The request requires user authentication.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden. The server understood the request but denied access
            or access is not authorized.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found. There is no resource at the given URI.
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Request timeout exceeded.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Data validation error.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The client has issued too many calls within a given time frame.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal Server Error.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not implemented.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Service unavailable.
        default:
          content:
            application/problem+json:
              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:
      - Directory Line 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: Header parameter used to correlate logs from several components
        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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 413 : Payload Too Large.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_write
      summary: Submit a new flow
      tags:
      - 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\n <br/> Scope: space_read"
      operationId: searchFlow
      parameters:
      - description: Header parameter used to correlate logs from several components
        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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_read
      summary: Select flows upon criteria
      tags:
      - 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: Header parameter used to correlate logs from several components
        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 when returning the results of a search
            request.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2:
        - space_read
      summary: Download the file of a flow
      tags:
      - Flow API
  /spaces/connectors/afnor/v1/healthcheck:
    get:
      operationId: healthCheck
      parameters:
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Request-Id
        required: false
        schema:
          type: string
          format: uuid
      - description: Header parameter used to correlate logs from several components
        in: header
        name: Organization-Id
        required: false
        schema:
          type: string
      responses:
        '200':
          description: OK - Operation succeeded
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
      security:
      - oauth2: []
      summary: Check whether the API service is up and running.
      tags:
      - 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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              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:
      - RoutingCode 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.
        in: query
        name: include
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - siren
            - siret
      - description: Fields of the Routing Code resource
        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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              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:
      - RoutingCode 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.
        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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              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:
      - Siren 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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            zapplication/problem+json:
              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:
      - Siren 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.
        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.
        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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              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:
      - Siret 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:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 400 : Bad request.'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 401 : Authentication error.'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 403 : Forbidden.'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 404 : Resource Not Found.'
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 408 : Request Timeout Exceeded.'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 422 : Unprocessable entity.'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 429 : Too many requests.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 500 : Server Internal Error.'
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 501 : Not Implemented.'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Error 503 : Unavailable Resource.'
        default:
          content:
            application/problem+json:
              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:
      - Siret API
components:
  schemas:
    Acknowledgement:
      type: object
      properties:
        details:
          $ref: '#/components/schemas/AcknowledgementDetails'
        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
    AcknowledgementDetails:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AcknowledgementDetail'
    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
          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
          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:
      - flowSyntax
      - name
    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})$
    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
      enum:
      - EmptyAttachement
      - AttachmentTypeError
      - EmptyFlow
      - OtherTechnicalError
      - InvalidSchema
      - FileSizeExceeded
      - FlowTypeError
      - AlreadyExistingFlow
      - VirusFound
      - ChecksumMismatch
      - InvoiceLCInvalidStatus
      - InvoiceLCStatusError
      - InvoiceLCRuleError
      - InvoiceLCAccessDenied
      - InvoiceLCAmountError
    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
        include:
          type: array
          items:
            type: string
            enum:
            - siren
            - siret
        limit:
          type: integer
          format: int32
        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
        limit:
          type: integer
          format: int32
          description: AFNOR doesn’t require the limit to be greater than 0, but we
            enforce it here to fail fast
          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
      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
          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
        limit:
          type: integer
          format: int32
          description: AFNOR doesn’t require the limit to be greater than 0, but we
            enforce it here to fail fast
          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
        include:
          type: array
          items:
            type: string
            enum:
            - siren
        limit:
          type: integer
          format: int32
          description: AFNOR doesn’t require the limit to be greater than 0, but we
            enforce it here to fail fast
          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
    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.uat.btx.eu.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.uat.btx.eu.banqup.com/oauth2/auth
          tokenUrl: https://api.uat.btx.eu.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
