CPR Direkte PRIV - CPR-nr. Search for Private Companies

CPR Direkte PRIV - CPR-nr. Search for Private Companies

Table of Contents

1. Introduction

This document describes the CPR Direkte service interface for the service "PRIV - CPR-nr. Search for Private Companies".

1.1. Purpose

The purpose of the service is to provide person data to private companies. The service delivers data in the same record format as the batch product U09480P "Persondata Private Ændringsudtræk" and therefore batch customers can use the service to supplement or refresh data in their own systems between CPR batch runs.

Unless otherwise agreed with the CPR office, the service does not deliver name and address data on persons who are registered with name and address protection according to section 38, subsection 4 of the CPR Act.

2. Access

The following sections describe the access requirements for users of the service.

2.1. Customer Focus

Use of this service is aimed at private companies.

2.2. Access Control

Users must be authenticated by the CPR security system to use the service. In addition, users must be assigned a CPR Direkte security profile that grants access to the service.

3. Parameters

The service supports the following parameters:

Parameter: Addressing name format
You can choose whether addressing names are printed in either First name(s) Last name or Last name,First name(s) format.
Default value: Last name,First name(s)

Parameter: Exclude name and address protection
Indicates whether name and address data on persons with active name and address protection registered in CPR should be omitted.
Parameter values: Yes or No
Default value: Yes

Parameter: Address match customer number
Indicates the customer number where the customer’s address match subscriptions are registered.
Default value: (none)

Parameter: Last known address of deceased persons
You can choose whether the service delivers the last known address of deceased (CPR status code 90) persons in records containing address data.
Parameter values: Yes or No
Default value: No

If you wish to change the task’s parameters, you must contact CPR Customer Center.

If the CPR Direkte task is associated with a batch task, settings from the batch task will also be used in the CPR Direkte task.

4. Communication Protocol

Communication with the service takes place over a standard socket connection. Messages between the client application and the service are sent in fixed-length record format according to the record descriptions in this document.

To perform a CPR-nr. lookup, users must first be authenticated by the CPR security system. This is done by performing the following:

  1. Establish a connection to CPR Direkte

  2. Send Login request

  3. Read the authentication token from Login response (or handle any errors indicated in the response)

If the user was authenticated, the token value from the response can be used to perform a CPR-nr. lookup:

  1. Establish a connection to CPR Direkte

  2. Send CPR-nr. search request

  3. Read data from CPR-nr. search response (or handle any errors indicated in the response)

Authentication token values can be reused in the CPR Direkte {transaction code} service. This means that users only need to log in once, after which they can perform multiple CPR-nr. lookups with the same token value.

CPR Direkte token values expire 30 minutes from the time they were last used in the CPR system.

5. Input data

This section describes the record types used to authenticate the user and perform CPR-nr. lookups.

5.1. Login request

Record sent to retrieve a token value from the CPR security system. Authentication is required to obtain a token value, which is necessary to perform lookups in CPR.

Record Field Name

Format

Length

Position

Description

Record Field Name

Format

Length

Position

Description

CPRTRANS

A

4

1

Service transaction code: PRIV

CONSTANT

A

1

5

Constant value (,)

KUNDENR

N

4

6

User’s customer number

CONSTANT

N

1

10

Constant value (9)

CONSTANT

N

1

11

Constant value (0)

USER-ID

A

8

12

CPR Direkte username

PASSWORD

A

8

20

CPR Direkte password

NEW PASSWORD

A

8

28

New password (only if password change is desired)

Record length: 35

Example:

PRIV,111190USER Password

5.2. Login response

Record returned to the user in connection with a login request.

If ERROR NO is 00, the user can retrieve a token value from the TOKEN record field.

Record Field Name

Format

Length

Position

Description

Record Field Name

Format

Length

Position

Description

KUNDENR

N

4

1

User’s customer number

CONSTANT

N

1

5

Constant value (9)

CONSTANT

N

1

6

Constant value (0)

TOKEN

A

8

7

Authentication token value

USER-ID

A

8

15

CPR Direkte username

FEJLNR

N

2

23

Error number. See Error numbers and error texts

LENGTH

N

4

25

Response length

Record length: 28

Example (token value is KETDqhzM):

111190KETDqhzMUSER 000028

5.3. CPR-nr. search request

Record containing data related to the CPR-nr. to be looked up.

Record Field Name

Format

Length

Position

Description

Record Field Name

Format

Length

Position

Description

CPRTRANS

A

4

1

Service transaction code: PRIV

CONSTANT

A

1

5

Constant value (,)

KUNDENR

N

4

6

User’s customer number

ABON_TYPE

N

1

10

Subscription set/delete. See Subscription types

DATA_TYPE

N

1

11

DATA record field format (0=No data requested, 6=Data requested)

TOKEN

A

8

12

Authentication token value

USER ID

A

8

20

User’s CPR Direkte person code

ERROR NO

N

2

28

Error number. See Error numbers and error texts

PNR

N

10

30

CPR number to retrieve data for

Record length: 39

Example (PNR is 1212123333):

PRIV,111106KETDqhzMUSER 001212123333

5.4. CPR-nr. search response

Record containing the response for a CPR-nr. lookup.

If a CPR-nr. was found in CPR, data related to the CPR-nr. is returned in the DATA record field. Which records are returned in the DATA field is controlled by the customer’s task settings.

Record Field Name

Format

Length

Position

Description

Record Field Name

Format

Length

Position

Description

KUNDENR

N

4

1

User’s customer number

ABON_TYPE

N

1

5

Subscription set/delete. See Subscription types

DATA_TYPE

N

1

6

DATA record field format (0=No Output data requested, 6=Output data requested)

TOKEN

A

8

7

Authentication token value

USER-ID

A

8

15

CPR Direkte username

FEJLNR

N

2

23

Error number. See Error numbers and error texts

LENGTH

N

4

25

Response length

DATA

A

*

29

See Output data

Record length: 28 + DATA LENGTH (total length provided in LENGTH record field)

6. Output data

The service returns data in the form of fixed-length records. Which records are delivered in the response from the service depends on the customer’s task configuration. The following sections describe the data format for the records that can be delivered in the response.

The documentation and structure of record fields are identical between CPR batch and CPR Direkte for the record types shared by the different products. In some records, it is stated that "fields may be added to the end of the record without further notice." However, this does not apply to CPR Direkte records, as new fields at the end of the record will affect the start of any subsequent records in the response from the CPR Direkte service.

The following descriptions of record structures are provided in Danish.

6.1. Recordtyper (DATA)

Oversigten viser, hvilke records der kan forekomme i DATA recordfeltet.

6.1.1. 000 Startrecord

Start record.

Format:

Recordfeltnavn

Format

Længde

Position

Beskrivelse

Recordfeltnavn

Format

Længde

Position

Beskrivelse

RECORDTYPE

N

3

1

Lig tre sidste cifre i recordtype

SORTFELT-10

A

10

4