Skip to main content

Documents

In Penneo KYC, documents can be requested for persons and companies in the form of goals. There are also goals that are not documents, such as eID validations.
There are several documents available for upload by default for both persons and companies.

Available document types

In order to get a list of available document types you can use availableDocumentTypesForCompany or availableDocumentTypesForPerson.

They both return DocumentTypes. The identifier is then passed to one of the create goal mutations.

Goals

In order to work with goals there are 3 types of queries available.

They can be read, created, or deleted.

Reading goals

The first allows you to get the current goals of a person or a company.
It returns a list of Goals. They are implemented as GoalTypes.

Example of getting goals for a person

query getPersonWithGoals($id: ID!) {
person(id: $id) {
id
name

goals {
id
acceptance
localizedNames {
da
en
de
no
}
}

timeCreated
timeLastEdited
}
}

variables {
id: <ID>,
}

Example of getting goals for a company

query getCompanyWithGoals($id: ID!) {
company(id: $id) {
id
name

goals {
id
acceptance
localizedNames {
da
en
de
no
}
}

timeCreated
timeLastEdited
}
}

variables {
id: <ID>,
}

This will return a list of goals currently on a person or company

The goals contains an id, whether they have been accepted or rejceted, and names in supported languages.
Supported languages can be found by looking at the Localized type.

Creating new goals

Goals can be added to person or company using the addGoal mutation. The variables are the ID of the person or company to add it to and an identifier from the AvailableDocumentTypes query

Example of adding a new goal to a person

addGoalToPerson documentation here.

mutation addGoalToPerson($personId: ID!, $goalIdentifier: String!) {
addGoalToPerson(personId: $personId, goalIdentifier: $goalIdentifier) {
id
name

goals {
id
acceptance
localizedNames {
da
en
no
}
}

timeCreated
timeLastEdited
}
}

variables {
"personId": <ID>,
"goalIdentifier": "CLA_DocumentTypeDefinition_Person_NO_BankID"
}

This mutation returns a PersonType.

Example of adding a new goal to a company

addGoalToCompany documentation here.

mutation addGoalToCompany($companyId: ID!, $goalIdentifier: String!) {
addGoalToCompany(companyId: $companyId, goalIdentifier: $goalIdentifier) {
id
name

goals {
id
acceptance
localizedNames {
da
en
no
}
}

timeCreated
timeLastEdited
}
}

variables {
"personId": <ID>,
"goalIdentifier": "CLA_DocumentTypeDefinition_Person_NO_BankID"
}

This mutation returns a CompanyType.

Deleting goals

Goals can be removed using the id of a goal found using the query for reading goals You also need the ID of the person or company that the goal should be removed from.

Example of removing goal from a person or a company

removeGoal documentation here.

mutation removeGoal($id: ID!, $goalId: ID!) {
removeGoal(id: $id, goalId: $goalId) {
id
name

goals {
id
acceptance
localizedNames {
da
en
no
}
}
}
}

variables {
"id": <ID>,
"goalId": <GoalID>
}

This mutation returns a DeleteResult.