Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Beskrivning

Hämtar bolagengagemang för en privatperson från Bolagsverket samt bolagsinformation för ett specifikt bolag.

I steg två skall tjänsten byggas ut mot Bolagsverkets Mina Ombud.

Alla lyckade svar från bolagsverket cachas i 30 minuter.

Livscykelstatus

I produktion

Lösningsbeskrivning

Gliffy
imageAttachmentIdatt810057752
macroId8e68bf78-b11f-46cc-829c-91df332effc8
baseUrlhttps://sundsvall.atlassian.net/wiki
nameBusinessEngagements
diagramAttachmentIdatt810778625
containerId793640981
timestamp1640605330419

Hantering av personuppgifter

API specifikation

Expand
titleAPI-nyckel mot sandbox, klicka på "Authorize" och klistra in denna:

eyJ4NXQiOiJPV1l4TkRJd016ZGhPREk1WVdRNU1EZGxPREkzT1RZeU1qTXpZemN4TW1NMU0yRTFaREF5WXpGa01qQmpNV0ZrTkROa1pXVTFPRFk1T1dJMlpHRTBZZyIsImtpZCI6ImdhdGV3YXlfY2VydGlmaWNhdGVfYWxpYXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJQRVJTT05BTFwvV1NPMl9NU19zaWduYXRvcnlAY2FyYm9uLnN1cGVyIiwiYXBwbGljYXRpb24iOnsib3duZXIiOiJQRVJTT05BTFwvV1NPMl9NU19zaWduYXRvcnkiLCJ0aWVyUXVvdGFUeXBlIjpudWxsLCJ0aWVyIjoiVW5saW1pdGVkIiwibmFtZSI6IkRlZmF1bHRBcHBsaWNhdGlvbiIsImlkIjoyNSwidXVpZCI6ImYwZDU4MTc3LWVlNzctNDNjOC1iNDM0LTBmNDQyOTBkMWU5ZiJ9LCJpc3MiOiJodHRwczpcL1wvYXBpLWltLXRlc3Quc3VuZHN2YWxsLnNlOjQ0M1wvb2F1dGgyXC90b2tlbiIsInRpZXJJbmZvIjp7IkJyb256ZSI6eyJ0aWVyUXVvdGFUeXBlIjoicmVxdWVzdENvdW50IiwiZ3JhcGhRTE1heENvbXBsZXhpdHk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cnNpb24iOiIxLjAiLCJzdWJzY3JpcHRpb25UaWVyIjoiVW5saW1pdGVkIn1dLCJwZXJtaXR0ZWRJUCI6IiIsImlhdCI6MTY2MDcyMDE3NiwianRpIjoiM2Q3ZDYxZTgtMzY3YS00YTgwLWJjNDItM2M5N2Y5MjQzNjVkIn0=.rOzKm1CCSVC8PYy5Rb1hOOkDWtNgxMOrBnXUPo1g1u2k8yAoAzPHjskzbXgUdllXFNiJSnDTYg4imGnUv_4o6OF4yoCALLD31OxbmSkosYLnZ-hnVZToZ42mnouIuwsmaTTnuEZSa3GB3eL3K9k5NnjZu-hw_jvAN10cekvYp5JLMDUNI6STPMEtMCXo_jiB-UYbisgUh-2JWSBGgciE_wnakaMFUZKpamHpdHw93B415RzXR5dUJTebVKvafo8oASgO5MElYdBVBretrdmZXipaLYL5b7xObmqokx1MmqhFA_7iyvuLH9csjdYQTrZjG1vmj5LV4pGUDTXofYaC-A==

Swagger ui
openapi: 3.0.1
info:
  title: api-businessengagements
  contact: {}
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "1.1"
servers:
- url: https://api-test.sundsvall.se/businessengagements/1.1/
tags:
- name: Business Engagements
  description: En tjänst som hämtar en persons företagsengagemang och dess information
paths:
  /information/{partyId}:
    get:
      tags:
      - Business Engagements
      operationId: getBusinessInformation
      parameters:
      - name: partyId
        in: path
        description: Unique identifier for an organization number
        required: true
        schema:
          type: string
          description: Unique identifier for an organization number
          example: fb2f0290-3820-11ed-a261-0242ac120002
        example: fb2f0290-3820-11ed-a261-0242ac120002
      - name: organizationName
        in: query
        description: Name of the organization
        required: true
        schema:
          type: string
          description: Name of the organization
      responses:
        "204":
          description: No Content
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/BusinessInformation'
        "400":
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
        "404":
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
        "200":
          description: Successful Operation
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/BusinessInformation'
        "500":
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
  /engagements/{partyId}:
    get:
      tags:
      - Business Engagements
      operationId: getEngagements
      parameters:
      - name: partyId
        in: path
        description: Unique identifier for a person
        required: true
        schema:
          type: string
          description: Unique identifier for a person
          example: 6a5c3d04-412d-11ec-973a-0242ac130003
        example: 6a5c3d04-412d-11ec-973a-0242ac130003
      - name: personalName
        in: query
        description: The first and surname of the person
        required: true
        schema:
          type: string
          description: The first and surname of the person
      - name: serviceName
        in: query
        description: Name of the system initiating the request
        required: true
        schema:
          type: string
          description: Name of the system initiating the request
          example: Mina Sidor
        example: Mina Sidor
      responses:
        "200":
          description: Successful Operation
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/BusinessEngagementsResponse'
        "204":
          description: No Content
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/BusinessEngagementsResponse'
        "400":
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
        "404":
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
        "500":
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
  /api-docs:
    get:
      tags:
      - API
      summary: OpenAPI
      operationId: getApiDocs
      responses:
        "200":
          description: OK
          content:
            application/yaml:
              schema:
                type: string
      x-auth-type: None
      x-throttling-tier: Unlimited
      x-wso2-mutual-ssl: Optional
components:
  schemas:
    Problem:
      type: object
      properties:
        instance:
          type: string
          format: uri
        type:
          type: string
          format: uri
        parameters:
          type: object
          additionalProperties:
            type: object
        title:
          type: string
        detail:
          type: string
        status:
          $ref: '#/components/schemas/StatusType'
    StatusType:
      type: object
      properties:
        reasonPhrase:
          type: string
        statusCode:
          type: integer
          format: int32
    Address:
      type: object
      properties:
        city:
          type: string
          description: City
          example: Sundsvall
        street:
          type: string
          description: Street address
          example: Storgatan 10
        postcode:
          type: string
          description: Postal code
          example: "85740"
        careOf:
          type: string
          description: Care of
          example: John Doe
      description: Address model
    BusinessInformation:
      type: object
      properties:
        legalForm:
          $ref: '#/components/schemas/LegalForm'
        address:
          $ref: '#/components/schemas/Address'
        emailAddress:
          type: string
          description: The companys contact email
          example: somecompany@noreply.com
        phoneNumber:
          type: string
          description: The companys contact phone number
          example: 070-1234567
        municipality:
          $ref: '#/components/schemas/Municipality'
        county:
          $ref: '#/components/schemas/County'
        fiscalYear:
          $ref: '#/components/schemas/FiscalYear'
        companyForm:
          $ref: '#/components/schemas/CompanyForm'
        companyRegistrationTime:
          type: string
          description: When the company was registered
          format: date
          example: 2022-01-01
        liquidationInformation:
          $ref: '#/components/schemas/LiquidationInformation'
        deregistrationDate:
          type: string
          description: When and if the company was deregistered
          format: date
          example: 2022-09-01
        companyLocation:
          $ref: '#/components/schemas/Address'
        businessSignatory:
          type: string
          description: Who may sign for the company
          example: Firman tecknas av styrelsen
        companyDescription:
          type: string
          description: Information regarding the companys operations
          example: Psykologisk forskning på bin samt därmed förenlig verksamhet.
        sharesInformation:
          $ref: '#/components/schemas/SharesInformation'
        errorInformation:
          $ref: '#/components/schemas/ErrorInformation'
      description: Business information model
    CompanyForm:
      type: object
      properties:
        companyFormCode:
          type: string
          description: Company form
          example: AB
        companyFormDescription:
          type: string
          description: Company form description
          example: Aktiebolag
      description: Company form information model
    County:
      type: object
      properties:
        countyName:
          type: string
          description: County
          example: Västernorrland
        countyCode:
          type: string
          description: County code
          example: "22"
      description: County information model
    ErrorInformation:
      type: object
      properties:
        hasErrors:
          type: boolean
          description: Indicates if there was an error while fetching data and that
            one or more parameters could not be fetched
          example: true
        errorDescriptions:
          type: object
          additionalProperties:
            type: string
            description: Map with error code (from bolagsverket) as key and the error
              description as value
            example: "9071006, Ej behörig - ej firmatecknare."
          description: Map with error code (from bolagsverket) as key and the error
            description as value
          example: "9071006, Ej behörig - ej firmatecknare."
      description: Error information model
    FiscalYear:
      type: object
      properties:
        fromDay:
          type: integer
          description: Fiscal year start day
          format: int32
          example: 1
        fromMonth:
          type: integer
          description: Fiscal year start month
          format: int32
          example: 1
        toDay:
          type: integer
          description: Fiscal year end day
          format: int32
          example: 31
        toMonth:
          type: integer
          description: Fiscal year end month
          format: int32
          example: 12
      description: Fiscal year information model
    LegalForm:
      type: object
      properties:
        legalFormDescription:
          type: string
          description: Legal form
          example: Övriga aktiebolag
        legalFormCode:
          type: string
          description: Legal form code
          example: "49"
      description: Legal form information model
    LiquidationInformation:
      type: object
      properties:
        liquidationReasons:
          type: array
          items:
            $ref: '#/components/schemas/LiquidationReason'
        cancelledLiquidation:
          $ref: '#/components/schemas/LiquidationReason'
      description: Liquidation information model
    LiquidationReason:
      type: object
      properties:
        liquidationCode:
          type: string
          description: Liquidation code
          example: "21"
        liquidationDescription:
          type: string
          description: Liquidation description
          example: Konkurs avslutad
        liquidationDate:
          type: string
          description: Liquidation date
          format: date
          example: 2022-09-01
        liquidationType:
          type: string
          description: Type of liquidation
          example: Konkurs
      description: Reason for liquidation or cancellation of liquidation
    Municipality:
      type: object
      properties:
        municipalityName:
          type: string
          description: Municipality
          example: Sundsvalls Kommun
        municipalityCode:
          type: string
          description: Municipality code
          example: "2281"
      description: Municipality information model
    ShareType:
      type: object
      properties:
        label:
          type: string
          description: Label of the shares
          example: B
        numberOfShares:
          type: integer
          description: Number of shares of this class
          example: 25000
        voteValue:
          type: string
          description: The vote value for one share
          example: 1/10
      description: Share information model
    SharesInformation:
      type: object
      properties:
        shareTypes:
          type: array
          items:
            $ref: '#/components/schemas/ShareType'
        numberOfShares:
          type: integer
          description: Number of total shares
          example: 100000
        shareCapital:
          type: number
          description: Shares value
          example: 120000.0
        shareCurrency:
          type: string
          description: Shares value currency
          example: sek
      description: Shares information model
    BusinessEngagementsResponse:
      required:
      - status
      type: object
      properties:
        engagements:
          type: array
          items:
            $ref: '#/components/schemas/Engagement'
        statusDescriptions:
          type: object
          additionalProperties:
            type: string
            description: "In case fetching one or more engagement failed, this will\
              \ show why it failed. There may be more than one description if several\
              \ engagements failed."
            example: Timeout
          description: "In case fetching one or more engagement failed, this will\
            \ show why it failed. There may be more than one description if several\
            \ engagements failed."
          example: Timeout
        status:
          type: string
          description: If fetching all engagements went "OK" or "NOK". A "NOK" may
            still return engagements but indicates that the information is incomplete.
          example: OK
          enum:
          - OK
          - NOK
    Engagement:
      type: object
      properties:
        organizationName:
          type: string
          description: Name of the organization
          example: Styrbjörns båtar
        organizationNumber:
          type: string
          description: "Organization number, may also be personal number in case of\
            \ enskild firma"
          example: "2021005448"
        organizationId:
          type: string
          description: Unique id for the organization (UUID)
          example: bab17d8b-af38-4531-967c-083f15ca1571
      description: Represents a persons business engagement.
  securitySchemes: {}

Alla anrop mot bolagsverket har två tvingande parametrar vilket även är tvingande in i detta API förutom partyId:

  1. serviceName - Det system som anropet initierades ifrån.

  2. personalName - Namnet på den person som företagen skall hämtas för.

Hämta företagsengagemang (/engagements/{partyId})

Request: /engagements/6a5c3d04-412d-11ec-973a-0242ac130003?personalName=Jane%20Doe&serviceName=Kommunen

Code Block
languagejson
{ "partyId": "6a5c3d04-412d-11ec-973a-0242ac130003", "personalName": "Jane Doe", "serviceName": "

Kommunen

" }

Response:

Code Block
languagejson
{
    "engagements": [
        {
            "organizationName": "Fritjofs blommor och blad",
            "organizationNumber": "5561234567",
            "organizationId": " 793afd03-3be5-4e14-863f-a61d4859841d"
        },
        {
            "organizationName": "Vanja Jumpers plåt",
            "organizationNumber": "5561234568"
        }
    ]
    "statusDescriptions": {
      "5561234568": "Couldn't fetch guid for organization number"
    },
    "status": "NOK"
}

Förtydligande response-parametrar:

  • engagements: Kan innehålla 0 → n antal engagemang personen har, varje objekt innehåller organisationsnamn och organisationsnummer.

    • organizationId: unikt uuid/guid för organisationsnumret, om det inte återfinns i LegalEntity utelämnas denna helt.

  • statusDescriptions: Innehåller eventuella fel i samband med hämtandet av bolagsengagemang eller organizationId. T.ex. att underliggande system (från bolagsverket) överskred begärd svarstid eller att det inte gick att hämta organizationId. Typen är en “Map<String, String>”.

  • status: Visar om personens alla engagemang kunde hämtas utan fel. Vid eventuella fel sätts denna till “NOK” och det reflekteras även i parametern statusDescriptions genom att varje felbeskrivning läggs till.

Hämta företagsinformation (/information/{partyId})

Request: /information/6a5c3d04-412d-11ec-973a-0242ac130003?organizationName=Testbusiness

Response:

Code Block
languagejson
{
  "legalForm": {
    "legalFormDescription": "Övriga aktiebolag",
    "legalFormCode": "49"
  },
  "address": {
    "city": "STOCKHOLM",
    "street": "Mäster Samuelsgatan 42",
    "postcode": "11157",
    "careOf": ""
  },
  "emailAddress": "somewhere@nowhere.com",
  "phoneNumber": "070-990463",
  "municipality": {
    "municipalityName": "Stockholm kommun",
    "municipalityCode": "0180"
  },
  "county": {
    "countyName": "Stockholms län",
    "countyCode": "01"
  },
  "fiscalYear": {
    "fromDay": 1,
    "fromMonth": 1,
    "toDay": 31,
    "toMonth": 12
  },
  "companyForm": {
    "companyFormCode": "AB",
    "companyFormDescription": "aktiebolag"
  },
  "companyRegistrationTime": "1993-01-07",
  "liquidationInformation": {
    "liquidationReasons": [
      {
        "liquidationCode": "21",
        "liquidationDescription": "Konkurs avslutad",
        "liquidationDate": "2013-10-24",
        "liquidationType": "Konkurs"
      },
      {
        "liquidationCode": "32",
        "liquidationDescription": "Likvidation beslutad",
        "liquidationDate": "2013-09-03",
        "liquidationType": "Likvidation"
      }
    ],
    "cancelledLiquidation": {
      "liquidationCode": "21",
      "liquidationDescription": "Konkurs avslutad",
      "liquidationDate": "2013-10-24",
      "liquidationType": "Konkurs"
    }
  },
  "deregistrationDate": "2013-10-24",
  "companyLocation": {
    "address": {
      "city": "STOCKHOLM",
      "street": "MÄSTER SAMUELSGATAN",
      "postcode": "11157"
    }
  },
  "businessSignatory": "Firman tecknas av styrelsen",
  "companyDescription": "Psykologisk forskning på bin samt därmed förenlig verksamhet.",
  "errorInformation": {
    "hasErrors": true,
    "errorDescriptions": {
      "9071006": "Ej behörig - ej firmatecknare."
    }
  }
}

Beroende på svaret från Bolagsverket kan det saknas information i en eller flera fält.
Istället för att invalidera hela svaret indikeras det att information inte är komplett / kunde hämtas från bolagsverket i errorInformation-fältet, med tillhörande felmeddelande om varför information inte gick att hämta.
errorDescription är en Map där nyckeln är felkoden och värdet är felbeskrivningen från bolagsverket.

Testdata

Bolagsverket har lagt upp fiktiva personnummer med olika bolagsengagemang, partyId för dessa personer finns upplagda i testmiljön för CitizenMapping och mappar till följande dokument.

Personnummer

partyId

198104112381

65694a6d-5f5d-4bb6-b256-3b81cb419b60

198101032384

d1eda732-5aec-45e2-a673-4debd42b2f04

198101052382

d4554399-91bb-4258-a7a7-afb9f265dd66

198101012386

740c013c-f979-4ad3-a073-42a6d5255e3a

198101042383

5a4afbf9-8897-42a8-aaf0-de9530849f7c

193403223328

af99121e-4dfc-477c-8b02-daf70603b55f

198104152387

ea4a0b53-fa9a-42a6-89a6-7ab1431a014f

Säkerhetsklassning

Säkerhetsklass 1

Autentiseringsmetod: Oauth2

(Ref: Säkerhetsklassning av APIer )

API-ägare

<Kontaktuppgifter till den verksamhet som äger APIets livscykel>

Teknisk ägare

API-teamet

Ansvarigt team: Team Dynasty

För tekniska frågor: mailto:teamdynasty@sundsvall.se

Länkar