Issue Credential #
Issue an ATP Credential #
The Create Credential API creates a verifiable credential in response to an onboarding request launched by a trading partner user. The API can be used by the Credential Issuer to provide CARO with the created credentials.
Issued credentials are revocable by default via Spherity’s EthrRevocationRegistry
revocation method. If you with to use the LDAP revocation method, make sure to specify the optional credentialStatusId
parameter with all necessary information.
Request #
Method #
Request method | Endpoint |
---|---|
POST | /api/v1/credentials |
Headers #
Authentication
Please see 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 #
Issuer Identifier
The Issuer DID is assigned to your Service Provider Account when you get access to CARO. You do not need to specify your DID in any interactions with CARO.
Issuance Date
Issuance Date parameter will only be used to issue credentials that will become valid in the future. You do not need to use this parameter if you are issuing a credential that needs to be valid from the present time onwards.
Key | Description | Type | Required |
---|---|---|---|
credentialId | ID of the issued credential. If left out, CARO will generate an appropriate ID. | string (urn:uuid:) | ❌ |
credentialType | Type of the issued credential | enum(string) / IdentityCredential OR DSCSAATPCredential | ✅ |
credentialStatusId | CredentialStatus URL in LDAP format. If left out, EthrRevocationRegistry method will be used by default. | string | ❌ |
recipientDid | The DID that will receive and hold the credential | string | ✅ |
data | The json of Credential Data | json | ✅ |
expirationDate | Custom expiration date (default: 1 year) | string (ISO 8601 format) | ❌ |
issuanceDate | Custom issuance date (default: current date) | string (ISO 8601 format) | ❌ |
onboardingId | ID of the onboarding the credential issuance originates from | string | ❌ |
Credential Data #
Key | Description | Type | Required |
---|---|---|---|
issuerName | The name of the credential issuer | string | ✅ |
legalName | The legal name of the organization | string | ✅ |
streetAddress | The street address of the organization | string | ✅ |
addressLocality | The address locality of the organization | string | ✅ |
addressRegion | The address region of the organization | string | ✅ |
postalCode | The postal code of the organization | string | ✅ |
addressCountry | The address country of the organization | string | ✅ |
parentOrganization | The name of the parent organization | string | 🟡 \ If type is IdentityCredential |
organizationType | The type of organization | string | 🟡 \ If type is DSCSAATPCredential |
identifier | The identifier DID that the credential is issued to | string | 🟡 \ If type is DSCSAATPCredential |
Response #
Key | Description | Type |
---|---|---|
id | Internal id of the issued credential | string (uuid) |
createdAt | Time of credential creation | string (ISO 8601 format) |
updatedAt | Time of credential creation | string (ISO 8601 format) |
type | Created credential type | enum(string) / IdentityCredential OR DSCSAATPCredential |
data | Verifiable credential | credential data |
Examples #
Example request body
{
"credentialId" : "urn:uuid:31ec4c88-56f4-420d-a525-aba23a59af5d",
"credentialType": "DSCSAATPCredential",
"credentialStatusId": "ldap://example.com",
"expirationDate": "2025-06-01T09:17:17.038Z",
"issuanceDate": "2022-06-01T09:17:17.038Z",
"recipientDid": "did:ethr:ropsten:0x022e41cff8e1d8c34f82397312490f96379cac8027696d8774f3eef72551691def",
"onboardingId": "a0cedaf1-576d-4d6b-a7c6-c3859f9938b2",
"data": {
"issuerName": "Example Company",
"legalName": "ABC Limited",
"streetAddress": "Plot A, Street B, Area C",
"addressLocality": "ABC",
"addressRegion": "EFG",
"postalCode": "000000",
"addressCountry": "US",
"parentOrganization": "Parent",
"organizationType": "NGO",
"identifier": "Some reasonable Identifier",
},
}
Example response body
{
"id": "780ea089-1eef-4e2a-8666-46d0b1118c59",
"createdAt": "2022-06-01T09:17:17.038Z",
"updatedAt": "2022-06-01T09:17:17.038Z",
"type": "DSCSAATPCredential",
"data": {
"@context": [
...
],
"id": "urn:uuid:a620a63c-8206-4825-b469-61bd660979c3",
"type": [
"VerifiableCredential",
"DSCSAATPCredential"
],
"issuer": "did:ethr:...",
"issuanceDate": "2022-06-01T09:17:17.038Z",
"expirationDate": "2023-06-01T09:17:17.038Z",
"onboardingId": "a0cedaf1-576d-4d6b-a7c6-c3859f9938b2",
"credentialSubject": {
"id": "did:ethr:...",
"type": "DSCSAATPCredential",
"issuerName": "Example Issuer",
"legalName": "ABC Limited",
"streetAddress": "Plot A, Street B, Area C",
"postalCode": "000000",
"organizationType": "NGO",
"addressCountry": "US",
"addressLocality": "ABC",
"addressRegion": "EFG",
"identifier": "did:ethr:..."
},
"proof": {
"jws": "...",
"type": "EcdsaSecp256k1RecoverySignature2020",
"created": "2022-06-01T09:17:17.038Z",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:ethr:...#controller"
}
}
}