Create a basic JSON-LD credential


This guide will demonstrate how to create a verifiable credential using VII Core.


You need access to the MATTR VII APIs. If you’re experiencing any difficulties, contact us.

In order to create a credential, you will need the following information:

  • Issuer DID

  • Subject DID

  • Credential type

  • JSON-LD claim names as defined by

  • Claim values

If you wish to use our experimental ZKP feature see the tutorial on issuing a ZKP-enabled credential.

You can only create Web Credentials using DIDs created using a ed25519 or bls12381g2 keyType, not DIDs with a keyType of P-256

Credential provider works with a single DID model, where it would take the default did for any credential issuance. Issuer cannot use different DIDs to issue different credentials.

Create a credential

Create a credential by making an API request as follows (replacing the issuer and subject IDs in the below example with DIDs from your tenant) :


Copy to clipboard.
1POST https://YOUR_TENANT_URL/v2/credentials/web-semantic/sign
Copy to clipboard.
2    "payload": {
3        "@context": [
4        ""
5        ],       
6      "name": "Course credential",
7        "description": "Course credential description",
8        "type": [
9        "CourseCredential"
10        ],
11        "credentialSubject": {
12            "id": "did:key:z6MkfxQU7dy8eKxyHpG267FV23agZQu9zmokd8BprepfHALi",
13            "givenName": "Chris",
14            "familyName": "Shin",
15            "educationalCredentialAwarded": "Certificate Name"
17        },       
18        "issuer": {
19            "id": " ",
20            "name": "tenant"   
21        },
22        "expirationDate": "2024-02-07T06:44:28.952Z"
23    },
24    "tag": "identifier123",
25    "persist": false,
26    "revocable": false,

The contains the DID of the issuer, this issuer attests the claims in the credential.

The @context must include use a common data vocab which is referenced in the claims field.

The credentialSubject.Id specifies an identifier bound to the credential. This is usually a decentralised identifier (DID) that's owned by the credential holder.

type is an array of credential types. It indicates what sort of information a credential holds. This is a unique identifier that the system uses to differentiate between different types of Web Credentials. There MUST be a value of type other than VerifiableCredential in the payload.

expirationDate field indicates the expiration date of the credential.


Copy to clipboard.
2  "id": "c6667bb7-9442-49a5-bb0b-fce269e97fc6",
3  "tag": "identifier123",
4  "credential": {
5    "@context": [
6      "",
7      "",
8      ""
9    ],
10    "type": [
11      "VerifiableCredential",
12      "CourseCredential"
13    ],
14    "issuer": {
15      "id": "",
16      "name": "tenant"
17    },
18    "name": "Course credential",
19    "description": "Course credential description",
20    "issuanceDate": "2021-07-26T01:05:05.152Z",
21    "expirationDate": "2024-02-07T06:44:28.952Z",
22    "credentialSubject": {
23      "id": "did:key:z6MkfxQU7dy8eKxyHpG267FV23agZQu9zmokd8BprepfHALi",
24      "givenName": "Chris",
25      "familyName": "Shin",
26      "educationalCredentialAwarded": "Certificate Name"
27    },
28    "proof": {
29      "type": "Ed25519Signature2018",
30      "created": "2021-07-26T01:05:06Z",
31      "jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..o6hnrrWpArG8LQz2Ex_u66_BtuPdp3Hkz18nhNdNhJ7J1k_2lmCCwsNdmo-kNFirZdSIMzqO-V3wEjMDphVEAA",
32      "proofPurpose": "assertionMethod",
33      "verificationMethod": "did:key:z6MkndAHigYrXNpape7jgaC7jHiWwxzB3chuKUGXJg2b5RSj#z6MkndAHigYrXNpape7jgaC7jHiWwxzB3chuKUGXJg2b5RSj"
34    }
35  },
36  "issuanceDate": "2021-07-26T01:05:05.152Z"

The returned credential object is the credential, with id and issuanceDate shown as meta-data. and which is the reference to the W3C credential definition is auto-injected as the first element in the context array.

VerifiableCredential is also auto-injected as the first element in the type array.  Every W3C verifiable credential must include VerifiableCredential in the type property.

If you wish to create a credential that supports revocation, please see the maintain a revocation list tutorial.

To hold an issued credential in a registry, please see the use a credential registry tutorial.