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 method | Endpoint |
---|
POST | /api/v1/verifiablePresentation/generate |
Parameters
#
During the generation of a Verifiable Presentation none of requested credential 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 these checks via parameters.
Name | Description | Required | Default Value |
---|
vc-expirationDate | Whether or not to check the expirationDate of the requested Credential | ❌ | false |
vc-proof | Whether or not to check the proof of the requested Credential | ❌ | false |
vc-issuanceDate | Whether or not to check the issuance date of the requested Credential | ❌ | false |
vc-credentialStatus | Whether or not to check the credential status of the requested Credential (revoked or non-revoked) | ❌ | false |
Below is an example screenshot depicting how to apply the query parameters to your API call.

Authentication
Please see Obtaining and using a Token for a detailed description of how to authenticate yourself with our API.
Name | Value |
---|
Content-Type | application/json |
Authorization | Bearer [token] |
Body
#
Key | Description | Type | Required |
---|
corrUUID | Correlation UUIDv4 which identifies a VRS request-response pair across networks | string | ✅ |
holderDID | The DID of the customer who holds the requested DSCSA ATP Credential | string | ✅ |
credentialType | Type of the Credential (IdentityCredential OR DSCSAATPCredential ) | enum | string | ✅ |
Example request body
{
"corrUUID": "5b58c147-1afb-43c1-81fe-84b9394a1e50",
"holderDID": "did:ethr:ropsten:0x022e41cff8e1d8c34f82397312490f96379cac8027696d8774f3eef72551691def",
"credentialType": "DSCSAATPCredential",
}
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 holderDID
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 Field | Description | Type | Values |
---|
success | Boolean value indicating whether or not the request was successful. | Boolean | true | false |
verifiablePresentation | The JWT formatted and base64 encoded Verifiable Presentation. | base64 | string | - |
holderDID | The holderDID that was used to generate the Verifiable Presentation. | string | - |
corrUUID | The corrUUID that was used to generate the Verifiable Presentation. | string | - |
credentialType | The credentialType that was used to generate the verifiable presentation. | enum | string | IdentityCredential | DSCSAATPCredential |
message | Additional message to be included for humans and/or logging systems | string | - |
Error Response
#
{
"success": false,
"errors": [
"Generation of Verifiable Presentation failed because Credential has been revoked"
],
"errorCodes": [
"vc_revoked",
"vc_proof_invalid"
]
}
Fields
#
Response Field | Description | Type | Values |
---|
success | Boolean value indicating whether or not the requested was successful. | Boolean | true | false |
errors | a list of error messages describing the error code(s) encountered while attempting to generate VP | string | - |
errorCodes | a list of error code(s) as specified in the Digital Wallet Conformance Criteria encountered while attempting to generate VP | string | enum | string |
Examples
#
Curl
#
curl --location --request POST 'https://app.caro.vc/api/v1/verifiablePresentation/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"
}'