Verifiable presentation generation

Verifiable presentation generation #

Generating a “Verifiable Presentation” #

The VP generation API generates a Verifiable Presentation of the requested ATP Credential in JWT format for usage in ATP Credential exchange.

Request #

Method #

Request methodEndpoint
POST/api/v1/verifiablePresentations/generate

Parameters #

During the generation of a Verifiable Presentation none of requested credentials fields are checked for validity by default. This is done on purpose to save on processing time in generation use cases, as all fields will always be validated by a verifing side via the /api/v1/verifiablePresentation/verify endpoint. You may optionally enable theses checks via parameters.
NameDescriptionRequiredDefault Value
vc-expirationDateWhether or not to check the expirationDate of the requested Credentialfalse
vc-proofWhether or not to check the proof of the requested Credentialfalse
vc-issuanceDateWhether or not to check the issuance date of the requested Credentialfalse
vc-credentialStatusWhether or not to check the credential status of the requested Credential (revoked or non-revoked)false

Headers #

Authentication
Please see Obtaining and using a Token for a detailed description of how to authenticate yourself with our API.
NameValue
Content-Typeapplication/json
AuthorizationBearer: [token]

Body #

Example request body
{
    "corrUUID": "5b58c147-1afb-43c1-81fe-84b9394a1e50",
    "did": "did:ethr:ropsten:0x022e41cff8e1d8c34f82397312490f96379cac8027696d8774f3eef72551691def",
    "credentialType": "DSCSAATPCredential",
}
KeyDescriptionTypeRequired
corrUUIDCorrelation UUIDv4 which identifies a VRS request-response pair across networksstring
didThe DID of the customer who holds the requested DSCSA ATP Credentialstring
credentialTypeType of the Credential (IdentityCredential OR DSCSAATPCredential)enum | string
Choosing corrUUID
The corrUUID is to connect all events in a full VRS roundtrip (request and response) for a consistent audit trail. Hence, as a responder you must re-use the randomly generated corrUUID that you have received from the requester instead of creating a new random corrUUID. The requester’s corrUUID can be extracted from the decoded received Verifiable Presentation.
Choosing DID
The customer you are serving VRS Events for will either share their DID with you via traditional communication formats or you can view a list of Identifiers in your web frontend after the customer has invited you to their Enterprise Account.
Choosing credentialType
While two values are allowed here, most VRS Events will use DSCSAATPCredential.

Response #

Successful Response #

{
    "success": true,
    "verifiablePresentation": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDpleGFtcGxlOmFiZmUxM2Y3MTIxMjA0[...]",
    "holderDID": "did:ethr:example",
    "corrUUID": "5b58c147-1afb-43c1-81fe-84b9394a1e50",
    "credentialType": "DSCSAATPCredential",
    "message": "Generation succeeded"
}

Fields #

Response FieldDescriptionTypeValues
successBoolean value indicating whether or not the request was successful.Booleantrue | false
verifiablePresentationThe JWT formatted and base64 encoded Verifiable Presentation.base64 | string-
holderDIDThe holderDID that was used to generate the Verifiable Presentation.string-
corrUUIDThe corrUUID that was used to generate the Verifiable Presentation.string-
credentialTypeThe credentialType that was used to generate the verifiable presentation.enum | stringIdentityCredential | DSCSAATPCredential
messageAdditional message to be included for humans and/or logging systemsstring-

Error Response #

{
  "success": false,
  "errors": [
    "Generation of Verifiable Presentation failed because Credential has been revoked"
  ],
  "errorCodes": [
    "vc_revoked",
    "vc_proof_invalid"
  ]
}

Fields #

Response FieldDescriptionTypeValues
successBoolean value indicating whether or not the requested was successful.Booleantrue | false
errorsa list of error messages describing the error code(s) encountered while attempting to generate VPstring-
errorCodesa list of error code(s) as specified in the Digital Wallet Conformance Criteria encountered while attempting to generate VPstringenum | string

Examples #

Curl #

curl --location --request POST 'https://app.caro.vc/api/v1/verifiablePresentations/generate' \
--header 'Authorization: Bearer [YOUR_API_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
    "did": "did:key:z6Mkvuuw4EhjssdXj3SShaSWNoEyJ1escEtj1tTnArcWCcDf",
    "corrUUID": "5b58c147-1afb-43c1-81fe-84b9394a1e50",
    "credentialType": "DSCSAATPCredential"
}'