Gå till slutet av bannern
Gå till början av bannern

Birth Report Service API Documentation

Hoppa till slutet på meta-data
Gå till början av metadata

You are viewing an old version of this content. View the current version.

Jämför med nuvarande View Version History

Version 1 Nästa »

h1. 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.

h2. Base URL

<https://birth-report-service-devtest.intyg.nordicmedtest.se>

h2. Endpoints

h3. 1. POST /v1/birthreport

  • Summary: Report the birth of a child to retrieve a personal identity number.

  • Description: Report the birth of a child with details about the mother, father, child, and delivery.

h4. Request Headers

  • x-trace-id (Optional): Unique identifier attached to logs that are processed when handling the request. (Type: string)

h4. Request Body (application/json)

{code:json}
{
"reportId": "string", // Required. Unique identifier for the report (UUID, e.g., "e58ed763-928c-4155-bee9-fdbaaadc15f3")
"reportedBy": { // Required
"reporter": "string", // Required. Name of hospital, clinic or corresponding and the name of the midwife or corresponding (e.g., "Alfa Medicincentrum, Alfa Allergimottagningen, Alfa Regionen, Bertil Barnmorska")
"phoneNumber": "string" // Optional. A phone number to contact the healthcare provider (e.g., "070 00 00 000")
},
"mother": { // Required
"personalIdentityNumber": { // Optional. Either personalIdentityNumber or dateOfBirth must be set, both cannot be set.
"id": "string", // Required. A 12-digit Personal identity number (e.g., "19960628-2391")
"oid": "string" // Optional. Identity type (e.g., "1.2.752.129.2.1.3.1")
},
"dateOfBirth": { // Optional. Either personalIdentityNumber or dateOfBirth must be set, both cannot be set.
"year": "string", // Required. A year represented by 4 digits between 1900 and 2100 (e.g. "2024")
"month": "string", // Optional. A month represented by 2 digits between 01 and 12 (e.g. "04")
"day": "string" // Optional. A day represented by 2 digits between 01 and 31 (e.g. "04")
},
"name": { // Optional
"firstName": "string", // Optional. (e.g. "Alex")
"middleName": "string", // Optional. (e.g. "Blomman")
"lastName": "string" // Optional. (e.g. "Svensson")
}
},
"father": { // Optional
"personalIdentityNumber": { // Optional. Either personalIdentityNumber or dateOfBirth must be set, both cannot be set.
"id": "string", // Required. A 12-digit Personal identity number (e.g., "19960628-2391")
"oid": "string" // Optional. Identity type (e.g., "1.2.752.129.2.1.3.1")
},
"dateOfBirth": { // Optional. Either personalIdentityNumber or dateOfBirth must be set, both cannot be set.
"year": "string", // Required. A year represented by 4 digits between 1900 and 2100 (e.g. "2024")
"month": "string", // Optional. A month represented by 2 digits between 01 and 12 (e.g. "04")
"day": "string" // Optional. A day represented by 2 digits between 01 and 31 (e.g. "04")
},
"name": { // Optional
"firstName": "string", // Optional. (e.g. "Alex")
"middleName": "string", // Optional. (e.g. "Blomman")
"lastName": "string" // Optional. (e.g. "Svensson")
}
},
"child": { // Required
"date": "string", // Required. The child's date of birth. It must not be later than today's date. (Format: date, e.g., "2024-10-04")
"gender": "string", // Required. Child's gender. Possible values: "BOY", "GIRL", "UNKNOWN".
"municipality": "string", // Required. The municipality where the birth took place (e.g. "Östersund")
"aliveAtBirth": boolean, // Required
"order": int // Required. Order of the child in relation to other siblings born during the same delivery (e.g. 1)
},
"totalNumberOfChildren": int, // Required. Total number of children born during this delivery (min:1, max:9)
"residentialAddress": [ "string" ], //Optional. An array of strings representing a Swedish address. (max 5 items).
"residentialAddressAbroad": [ "string" ], //Optional. An array of strings representing a foreign address. (max 5 items).
"phoneNumber": [ "string" ] //Optional. An array of strings representing a phone number to contact the mother. (max 5 items).
}
{code}

h4. Response Codes

  • 201 Created: Birth report created successfully. Response includes the generated personal identity number for the child.
    {code:json}
    {
    "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")
    }
    {code}

  • 202 Accepted: Birth report requires manual processing. The response contains a confirmation message explaining why a personal identity number could not be assigned immediately.
    {code:json}
    {
    "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")
    }
    }
    {code}

  • 400 Bad Request: Invalid request data. The response includes details about invalid parameters and validation failures.
    {code:json}
    {
    "title": "string",
    "detail": "string",
    "status": int,
    "errorId": "string",
    "invalidParameters": [
    {
    "reason": "string",
    "value": "string",
    "property": "string"
    }
    ]
    }
    {code}

  • 403 Forbidden: The request is forbidden.

  • 422 Unprocessable Entity: The server understands the request but is unable to process the contained instructions (e.g. syntax error).
    {code:json}
    {
    "title": "string",
    "detail": "string",
    "status": int,
    "errorId": "string"
    }
    {code}

  • 500 Internal Server Error: An unexpected error occurred on the server.
    {code:json}
    {
    "title": "string",
    "detail": "string",
    "status": int,
    "errorId": "string"
    }
    {code}

  • 502 Bad Gateway: Birth report not created due to an error when communicating with Skatteverket.
    {code:json}
    {
    "title": "string",
    "detail": "string",
    "status": int,
    "errorId": "string"
    }
    {code}

h2. 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.
    {code:json}
    {
    "reporter": "string", // Required.
    "phoneNumber": "string" // Optional.
    }
    {code}

  • Parent: Defines information about a parent (mother or father).
    {code:json}
    {
    "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.
    {code:json}
    {
    "firstName": "string", // Optional.
    "middleName": "string", // Optional.
    "lastName": "string" // Optional.
    }
    {code}

  • PersonalIdentityNumber: Defines a Swedish personal identity number.
    {code:json}
    {
    "id": "string", // Required.
    "oid": "string" // Optional.
    }
    {code}

  • PartialDate: Defines a date
    {code:json}
    {
    "year": "string", // Required.
    "month": "string", // Optional.
    "day": "string" // Optional.
    }
    {code}

  • Child: Defines information about the child.
    {code:json}
    {
    "date": "string", // Required.
    "gender": "string", // Required.
    "municipality": "string", // Required.
    "aliveAtBirth": "boolean", // Required.
    "order": "integer" // Required.
    }
    {code}

  • ApiError: Describes the format of error responses.
    {code:json}
    {
    "title": "string",
    "detail": "string",
    "status": "integer",
    "errorId": "string",
    "invalidParameters": [
    {
    "reason": "string",
    "value": "string",
    "property": "string"
    }
    ]
    }
    {code}

  • InvalidParameter: Describes a single invalid request parameter
    {code:json}
    {
    "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
    {code:json}
    {
    "message": "string",
    "description": "string",
    "messageConfirmationCode": "string"
    }
    {code}

h2. 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.

  • Inga etiketter