> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inyett.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Main rating a company

> Returns the company's overall risk rating, combining the fraud, sanctions, finance, debt and payment-remark checks (see `showAllChecks` to include checks that passed). Requires the controlbasic or controlbasicplus scope.



## OpenAPI

````yaml https://api-test.inyett.com/swagger/v3/swagger.json get /3/{profileCountry}/control/companies/{country}/{orgNr}/main-rating
openapi: 3.0.4
info:
  title: Inyett Automation
  description: |-
    <p>Inyett Automation is a payment control and company screening API for
                        Swedish and Norwegian businesses. It lets integrators automatically check a company's
                        status and risk before doing business with it, monitor companies over time for changes,
                        and screen outgoing payment batches for anomalies, sanctions and compliance issues before
                        the money leaves the paying customer. It is used by ERP, payment and procurement systems
                        that need this control built into their own workflows rather than as a manual step.</p><h3>How to connect</h3>
                        <p>Read more about our API and how to connect on <a href='https://docs.inyett.com/home' target='_blank'>docs.inyett.com</a></p> 
  contact:
    email: support@inyett.com
  version: '3.0'
servers: []
security:
  - X-Api-Key: []
  - Bearer: []
tags:
  - name: Inyett Company Control
    description: >-
      Risk assessment endpoints such as main rating, fraud, debt and payment
      remark checks, used to screen a company before paying it.
  - name: Inyett Company Data
    description: >-
      Company master data: addresses, accounts, owners, directors, financial
      statements and other registry information for a company.
  - name: Inyett Company Debts & Credits
    description: >-
      Aggregated debt and credit information for a company, including historical
      claims and payment remarks.
  - name: Inyett Company Find
    description: Free-text and organisation-number search for companies.
  - name: Inyett Company Insights
    description: >-
      The company relation graph: companies related to a given company, grouped
      by relation category (tag).
  - name: Inyett Company Monitor
    description: >-
      Continuous monitoring of company portfolios: create portfolios, add or
      remove companies to watch, and read back detected changes over time.
  - name: Inyett Payment Control
    description: >-
      Batch screening of outgoing payments: submit a payment batch for analysis
      and read back any warnings before the money leaves the customer.
paths:
  /3/{profileCountry}/control/companies/{country}/{orgNr}/main-rating:
    get:
      tags:
        - Inyett Company Control
      summary: Main rating a company
      description: >-
        Returns the company's overall risk rating, combining the fraud,
        sanctions, finance, debt and payment-remark checks (see `showAllChecks`
        to include checks that passed). Requires the controlbasic or
        controlbasicplus scope.
      operationId: mainRatingGet
      parameters:
        - name: profileCountry
          in: path
          description: >-
            The country whose scope/entitlement profile (SE or NO) is used to
            authorize the request. Determines which market-specific rules apply,
            independent of the country the requested company is registered in.
          required: true
          schema:
            $ref: '#/components/schemas/Country'
        - name: country
          in: path
          description: The country the requested company is registered in.
          required: true
          schema:
            $ref: '#/components/schemas/Country'
        - name: orgNr
          in: path
          description: >-
            The company's organisation number (personal identity number for a
            sole proprietorship), without separators.
          required: true
          schema:
            type: string
        - name: showAllChecks
          in: query
          description: >-
            When true, includes checks that passed in addition to any that
            failed or were flagged. When false (default), only failed/flagged
            checks are returned.
          schema:
            type: boolean
            default: false
        - name: languageCode
          in: query
          description: >-
            Language used for human-readable text in the response (e.g. check
            descriptions).
          schema:
            $ref: '#/components/schemas/LanguageCode'
        - name: AppId
          in: header
          description: App id
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rating'
              example:
                level: red
                remarks:
                  level: red
                  indications:
                    - key: CCCC
                      name: Foo
                      description: Lorem ipsum dolor sit amet
                      status: IsOk
                    - key: DDDD
                      name: Bar
                      description: Lorem ipsum dolor sit amet
                      status: HasIndication
                fraud:
                  level: red
                  indications:
                    - key: GGGG
                      name: Foo
                      description: Lorem ipsum dolor sit amet
                      status: IsOk
                    - key: HHHH
                      name: Bar
                      description: Lorem ipsum dolor sit amet
                      status: HasIndication
                finance:
                  level: yellow
                  indications:
                    - key: EEEE
                      name: Foo
                      description: Lorem ipsum dolor sit amet
                      status: IsOk
                    - key: FFFF
                      name: Bar
                      description: Lorem ipsum dolor sit amet
                      status: HasIndication
                debtRating:
                  level: green
                  indications:
                    - key: JJJJ
                      name: Foo
                      description: Lorem ipsum dolor sit amet
                      status: IsOk
                    - key: KKKK
                      name: Bar
                      description: Lorem ipsum dolor sit amet
                      status: HasIndication
                observations:
                  level: green
                  indications:
                    - key: AAAA
                      name: Foo
                      description: Lorem ipsum dolor sit amet
                      status: IsOk
                    - key: BBBB
                      name: Bar
                      description: Lorem ipsum dolor sit amet
                      status: HasIndication
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FailResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FailResponse'
components:
  schemas:
    Country:
      enum:
        - SE
        - 'NO'
      type: string
      description: >-
        ISO country code supported for company lookups: SE (Sweden) or NO
        (Norway).
    LanguageCode:
      enum:
        - SV
        - 'NO'
        - EN
      type: string
      description: >-
        Language used for human-readable text in a response: SV (Swedish), NO
        (Norwegian) or EN (English).
    Rating:
      type: object
      properties:
        level:
          type: string
          nullable: true
        remarks:
          $ref: '#/components/schemas/RatingCheck'
        fraud:
          $ref: '#/components/schemas/RatingCheck'
        sanctions:
          $ref: '#/components/schemas/RatingCheck'
        finance:
          $ref: '#/components/schemas/RatingCheck'
        debtRating:
          $ref: '#/components/schemas/RatingCheck'
        observations:
          $ref: '#/components/schemas/RatingCheck'
      additionalProperties: false
      description: >-
        The company's overall risk rating and the underlying check results it
        was derived from.
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
      description: >-
        A machine-readable error response following the RFC 7807 Problem Details
        format.
    FailResponse:
      type: object
      properties:
        message:
          type: string
          nullable: true
      additionalProperties: false
      description: >-
        Error response returned when a request fails, containing a
        human-readable message.
    RatingCheck:
      type: object
      properties:
        level:
          type: string
          nullable: true
        indications:
          type: array
          items:
            $ref: '#/components/schemas/RatingIndication'
          nullable: true
      additionalProperties: false
      description: >-
        The outcome of a single risk check category (e.g. fraud, sanctions)
        contributing to the overall rating.
    RatingIndication:
      type: object
      properties:
        key:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        status:
          $ref: '#/components/schemas/CheckIndicationStatus'
      additionalProperties: false
      description: >-
        A single flagged indication found by a rating check, with a
        machine-readable key and human-readable description.
    CheckIndicationStatus:
      enum:
        - HasIndication
        - IsOk
      type: string
      description: >-
        Whether a rating check found an indication (HasIndication) or was clean
        (IsOk).
  securitySchemes:
    X-Api-Key:
      type: apiKey
      description: 'Api key needed to access the endpoints. X-Api-Key: My api key'
      name: X-Api-Key
      in: header
    Bearer:
      type: http
      description: Please enter a valid token
      scheme: Bearer
      bearerFormat: JWT

````