# Guide for issuing and verifying Legal Personal Identification Data (LPID) using iGrant.io APIs
## Pre-requisites
1. An API key must be available with scope including 'Config'.
## Issuance
### Notes:
1. When making API call directly using cURL commands, replace `<apikey>` with yours.
2. When executing `issue deferred credential` endpoint, replace `<credentialexchangeid>` with one obtained from the previous `issue credential` endpoint
### In-Time For JWT
#### Request body
```json
{
"issuanceMode": "InTime",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
],
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
}
}
```
#### cURL command for [issue credential](https://docs.igrant.io/docs/api/config-digital-wallet-open-id-issue-credential)
```curl
curl -L -X POST 'https://staging-api.igrant.io/v2/config/digital-wallet/openid/sdjwt/credential/issue' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <apiKey>' \
--data-raw '{
"issuanceMode": "InTime",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
],
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
}
}'
```
### Deferred For JWT
#### [Issue credential](https://docs.igrant.io/docs/api/config-digital-wallet-open-id-issue-credential)
##### Request body
```json
{
"issuanceMode": "Deferred",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
]
}
}
```
##### cURL command for [issue credential](https://docs.igrant.io/docs/api/config-digital-wallet-open-id-issue-credential)
```curl
curl -L -X POST 'https://staging-api.igrant.io/v2/config/digital-wallet/openid/sdjwt/credential/issue' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <apiKey>' \
--data-raw '{
"issuanceMode": "Deferred",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
]
}
}'
```
#### Issue [deferred credential](https://docs.igrant.io/docs/api/config-update-digital-wallet-open-id-credential-history)
##### Request body
```json
{
"credential": {
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
}
}
```
##### cURL command for [issue deferred credential](https://docs.igrant.io/docs/api/config-update-digital-wallet-open-id-credential-history)
*Note: Replace `<credentialexchangeid>` with one obtained from the previous `issue credential` endpoint.*
```curl
curl -L -X PUT 'https://staging-api.igrant.io/v2/config/digital-wallet/openid/sdjwt/credential/history/<credentialexchangeid>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <apiKey>' \
--data-raw '{
"credential": {
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
}
}'
```
### In-Time For SD-JWT
#### Request body
```json
{
"issuanceMode": "InTime",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
],
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
},
"disclosureMapping": {
"credentialSubject": {
"identifier": {
"limitedDisclosure": true
},
"legalName": {
"limitedDisclosure": true
}
}
}
}
```
#### cURL command for [issue credential](https://docs.igrant.io/docs/api/config-digital-wallet-open-id-issue-credential)
```curl
curl -L -X POST 'https://staging-api.igrant.io/v2/config/digital-wallet/openid/sdjwt/credential/issue' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <apiKey>' \
--data-raw '{
"issuanceMode": "InTime",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
],
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
},
"disclosureMapping": {
"credentialSubject": {
"identifier": {
"limitedDisclosure": true
},
"legalName": {
"limitedDisclosure": true
}
}
}
}'
```
### Defered For SD-JWT
#### [Issue credential](https://docs.igrant.io/docs/api/config-digital-wallet-open-id-issue-credential)
##### Request body
```json
{
"issuanceMode": "Deferred",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
]
},
"disclosureMapping": {
"credentialSubject": {
"identifier": {
"limitedDisclosure": true
},
"legalName": {
"limitedDisclosure": true
}
}
}
}
```
##### cURL command for [issue credential](https://docs.igrant.io/docs/api/config-digital-wallet-open-id-issue-credential)
```curl
curl -L -X POST 'https://staging-api.igrant.io/v2/config/digital-wallet/openid/sdjwt/credential/issue' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <apiKey>' \
--data-raw '{
"issuanceMode": "Deferred",
"userPin": "",
"credential": {
"type": [
"VerifiableLegalPersonalIdentificationData"
]
},
"disclosureMapping": {
"credentialSubject": {
"identifier": {
"limitedDisclosure": true
},
"legalName": {
"limitedDisclosure": true
}
}
}
}'
```
#### Issue [deferred credential](https://docs.igrant.io/docs/api/config-update-digital-wallet-open-id-credential-history)
##### Request body
```json
{
"credential": {
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
}
}
```
##### cURL command for [issue deferred credential](https://docs.igrant.io/docs/api/config-update-digital-wallet-open-id-credential-history)
*Note: Replace `<credentialexchangeid>` with one obtained from the previous `issue credential` endpoint.*
```curl
curl -L -X PUT 'https://staging-api.igrant.io/v2/config/digital-wallet/openid/sdjwt/credential/history/<credentialexchangeid>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <apiKey>' \
--data-raw '{
"credential": {
"credentialSubject": {
"identifier": "123400-7899",
"legalName": "Bygg AB"
}
}
}'
```
## Verification
### Request body
```
{
"presentationDefinition": {
"id": "046acbac-ea8d-4f95-8b57-f58dd178132b",
"format": {
"jwt_vc": {
"alg": [
"ES256"
]
},
"jwt_vp": {
"alg": [
"ES256"
]
}
},
"input_descriptors": [
{
"id": "ef91319b-81a5-4f71-a602-de3eacccb543",
"constraints": {
"limit_disclosure": "required",
"fields": [
{
"path": [
"$.type"
],
"filter": {
"type": "array",
"contains": {
"const": "VerifiableLegalPersonalIdentificationData"
}
}
}
]
}
}
]
}
}
```
### cURL command for [send verification request](https://docs.igrant.io/docs/api/config-create-digital-wallet-open-id-verification-request)
```curl
curl -L -X POST 'https://staging-api.igrant.io/v2/config/digital-wallet/openid/sdjwt/verification/send' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <apiKey>' \
--data-raw '{
"presentationDefinition": {
"id": "046acbac-ea8d-4f95-8b57-f58dd178132b",
"format": {
"jwt_vc": {
"alg": [
"ES256"
]
},
"jwt_vp": {
"alg": [
"ES256"
]
}
},
"input_descriptors": [
{
"id": "ef91319b-81a5-4f71-a602-de3eacccb543",
"constraints": {
"limit_disclosure": "required",
"fields": [
{
"path": [
"$.type"
],
"filter": {
"type": "array",
"contains": {
"const": "VerifiableLegalPersonalIdentificationData"
}
}
}
]
}
}
]
}
}'
```