Jämförda versioner

Nyckel

  • Dessa rader lades till.
  • Denna rad togs bort.
  • Formateringen ändrades.

Birth Report Service API Documentation

This API is used for reporting the birth of a child to Skatteverket (the Swedish Tax Agency) and retrieving a personal identity number for the child.

Base URL

<https://birth-report-service-devtest.intyg.nordicmedtest.se<Contact Inera to obtain Base URL>

Endpoints

POST /v1/birthreport

...

  • 201 Created: Birth report created successfully. Response includes the generated personal identity number for the child.

    Kodblock
    languagejson
    {
      "reportId": "string", // The same identifier that was sent in the report (UUID, e.g., "e58ed763-928c-4155-bee9-fdbaaadc15f3")
      "personalIdentityNumber": "string" // The new personal identity number assigned to the child (e.g., "202411190000")
    }

  • 202 Accepted: Birth report requires manual processing. The response contains a confirmation message explaining why a personal identity number could not be assigned immediately.

    Kodblock
    languagejson
    {
      "reportId": "string", // The same identifier that was sent in the report (UUID, e.g., "e58ed763-928c-4155-bee9-fdbaaadc15f3")
      "message": {
        "message": "string", // This message can be forwarded to the end user (e.g., "Anmälan mottagen. Skatteverket skickar underrättelse till barnets förälder.")
        "description": "string", // This description is only meant for debugging and is passed up from SKV (e.g., "Anmälan avser inte \\\"nyanmälan\\\", tilldelning av personnummer får inte ske")
        "messageConfirmationCode": "string" // This code is passed up from SKV (e.g., "201")
      }
    }

  • 400 Bad Request: Invalid request data. The response includes details about invalid parameters and validation failures.

    Kodblock
    languagejson
    {
      "title": "string",
      "detail": "string",
      "status": int,
      "errorId": "string",
      "invalidParameters": [
        {
          "reason": "string",
          "value": "string",
          "property": "string"
        }
      ]
    }
    

  • 403 Forbidden: The request is forbidden.422 Unprocessable Entity: The server understands the request but is unable

    Kodblock
    languagejson
    {
      "timestamp": "2024-11-22T11:03:06.771+00:00",
      "status": 403,
      "error": "Forbidden",
      "message": "No message available",
      "path": "/v1/birthreport"
    }

  • 422 Unprocessable Entity: The server understands the request but is unable to process the contained instructions (e.g. syntax error).
    {code:json}
    {

    Kodblock
    languagejson
     {
         "title": "string",

    
         "detail": "string",

    
         "status": int,

    
         "errorId": "string"

    
     }

  • {code}500 Internal Server Error: An unexpected error occurred on the server.{

    Kodblock
    :
    languagejson
    }
    {

    
      "title": "string",

    
      "detail": "string",

    
      "status": int,

    
      "errorId": "string"

    }
    {code
    
    }

  • 502 Bad Gateway: Birth report not created due to an error when communicating with Skatteverket.{

    Kodblock
    :
    languagejson
    }
    {

    
      "title": "string",

    
      "detail": "string",

    
      "status": int,

    
      "errorId": "string"

    
    }
    {code}

...

Data Models (Schemas)

The above documentation refers to the following schemas, which describe the request and response structure:

  • BirthReportRequest: See Request Body description above.

  • ReportedBy: Defines information about the reporter.{

    Kodblock
    :
    languagejson
    }
    {

    
      "reporter": "string",  // Required.

    
      "phoneNumber": "string" // Optional.

    }
    {code
    
    }

  • Parent: Defines information about a parent (mother or father).{

    Kodblock
    :
    languagejson
    }
    {

    
      "personalIdentityNumber": { //Optional. Either this or dateOfBirth must be set

    
       "id": "string",  // Required.

    
       "oid": "string" // Optional.

    
      },

    
      "dateOfBirth": { //Optional. Either this or personalIdentityNumber must be set

    
      "year": "string", // Required.

    
      "month": "string", // Optional.

    
      "day": "string"  // Optional.

    
      },

    
      "name": { // Optional

    
      "firstName": "string", // Optional.

    
      "middleName": "string", // Optional.

    
      "lastName": "string" // Optional.

    }
    }
    {code
    
      }
    }

  • Name: Defines information about a name.{

    Kodblock
    :
    languagejson
    }
     {

    
       "firstName": "string", // Optional.

    
       "middleName": "string", // Optional.

    
       "lastName": "string" // Optional.

    }
    {code
    
     }

  • PersonalIdentityNumber: Defines a Swedish personal identity number.{

    Kodblock
    :
    languagejson
    }
    {

    
      "id": "string", // Required.

    
      "oid": "string" // Optional.

    }
    {code
    
    }

  • PartialDate: Defines a date{

    Kodblock
    :
    languagejson
    }
    {

    
      "year": "string", // Required.

    
      "month": "string", // Optional.

    
      "day": "string" // Optional.

    }
    {code
    
    }

  • Child: Defines information about the child.{

    Kodblock
    :
    languagejson
    }
    {

    
      "date": "string", // Required.

    
      "gender": "string", // Required.

    
      "municipality": "string", // Required.

    
      "aliveAtBirth": "boolean", // Required.

    
      "order": "integer" // Required.

    
    }

  • {code}ApiError: Describes the format of error responses.{

    Kodblock
    :
    languagejson
    }
    {

    
      "title": "string",

    
      "detail": "string",

    
      "status": "integer",

    
      "errorId": "string",

    
      "invalidParameters": [

    {
    
        {
          "reason": "string",

    
          "value": "string",

    
          "property": "string"

    }
    ]
    }
    {code
    
        }
      ]
    }

  • InvalidParameter: Describes a single invalid request parameter{

    Kodblock
    :
    languagejson
    }
    {

    
     "reason": "string",

    
     "value": "string",

    
     "property": "string"

    
    }

  • {code}BirthReportResponse: See Response Codes 201 and 202.

  • ConfirmationMessage: Describes the message returned in the 202 response, for manual processing{

    Kodblock
    :
    languagejson
    }
    {

    
      "message": "string",

    
      "description": "string",

    
      "messageConfirmationCode": "string"

    
    }
    {code}

...

Important Notes:

  • The reportId is a UUID and must be unique for each report.

  • The date formats should conform to the specified format.

  • The personalIdentityNumber should adhere to the format YYYYMMDD-NNNN or YYYYMMDD+NNNN or YYYYMMDDNNNN.