Issue a Verifiable Credential

Issue a JSON-LD Verifiable Credential, signed by a did:cheqd Decentralized Identifier (DID), using the ACA-Py API endpoints.

Using the /issue-credential-2.0 API endpoints, it is possible to issue Verifiable Credentials, signed by a cheqd DID, in a few clicks or lines of code. By following the following steps, you can effectively issue verifiable credentials using ACA-Py integrated with the cheqd ecosystem.

Pre-requisite

For JSON-LD Credential Issuance, the Issuer DID must have assertionMethod set to the verificationMethod.id . If your DID does not have assertionMethod, execute POST /did/cheqd/update API call to add new assertion method matching the verificationMethod.id.

Step 1: Create a Connection with Holder

Use any supported method to create a connection with the Holder of the credential. Automated out-of-band protocol is recommended.

1a: Issuer Creates Connection Invite

The Issuer agent will create a new connection invite for the Holder. This is needed to securely communicate between the Issuer and the Holder agents.

Create a new connection invitation

post
Query parameters
auto_acceptanyOptional

Auto-accept connection (defaults to configuration)

create_unique_didanyOptional

Create unique DID for this invitation (default false)

multi_useanyOptional

Create invitation for multiple use (default false)

Body
acceptstring[]Optional

List of mime type in order of preference that should be use in responding to the message

Example: ["didcomm/aip1","didcomm/aip2;env=rfc19"]
aliasstringOptional

Alias for connection

Example: Barry
goalstringOptional

A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message

Example: To issue a Faber College Graduate credential
goal_codestringOptional

A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message

Example: issue-vc
handshake_protocolsstring[]Optional

Handshake protocol to specify in invitation

mediation_idstringOptional

Identifier for active mediation record to be used

Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6Pattern: [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
metadataobjectOptional

Optional metadata to attach to the connection created with the invitation

my_labelstringOptional

Label for connection invitation

Example: Invitation to Barry
protocol_versionstringOptional

OOB protocol version

Example: 1.1
use_didstringOptional

DID to use in invitation

Example: did:example:123
use_did_methodstring · enumOptional

DID method to use in invitation

Example: did:peer:2Possible values:
use_public_didbooleanOptional

Whether to use public DID in invitation

Responses
200Success
application/json
post
POST /out-of-band/create-invitation HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 475

{
  "accept": [
    "didcomm/aip1",
    "didcomm/aip2;env=rfc19"
  ],
  "alias": "Barry",
  "attachments": [
    {
      "id": "attachment-0",
      "type": "present-proof"
    }
  ],
  "goal": "To issue a Faber College Graduate credential",
  "goal_code": "issue-vc",
  "handshake_protocols": [
    "https://didcomm.org/didexchange/1.0"
  ],
  "mediation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "metadata": {},
  "my_label": "Invitation to Barry",
  "protocol_version": "1.1",
  "use_did": "did:example:123",
  "use_did_method": "did:peer:2",
  "use_public_did": false
}
200Success
{
  "created_at": "2021-12-31T23:59:59Z",
  "invi_msg_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "invitation": {
    "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "@type": "https://didcomm.org/my-family/1.0/my-message-type",
    "accept": [
      "didcomm/aip1",
      "didcomm/aip2;env=rfc19"
    ],
    "goal": "To issue a Faber College Graduate credential",
    "goal_code": "issue-vc",
    "handshake_protocols": [
      "https://didcomm.org/didexchange/1.0"
    ],
    "imageUrl": "http://192.168.56.101/img/logo.jpg",
    "label": "Bob",
    "requests~attach": [
      {
        "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "byte_count": 1234,
        "data": {
          "base64": "ey4uLn0=",
          "json": "{\"sample\": \"content\"}",
          "jws": {
            "header": {
              "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
            },
            "protected": "ey4uLn0",
            "signature": "ey4uLn0",
            "signatures": [
              {
                "header": {
                  "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                },
                "protected": "ey4uLn0",
                "signature": "ey4uLn0"
              }
            ]
          },
          "links": [
            "https://link.to/data"
          ],
          "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
        },
        "description": "view from doorway, facing east, with lights off",
        "filename": "IMG1092348.png",
        "lastmod_time": "2021-12-31T23:59:59Z",
        "mime-type": "image/png"
      }
    ],
    "services": [
      {
        "did": "WgWxqztrNooG92RXvxSTWv",
        "id": "string",
        "recipientKeys": [
          "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH"
        ],
        "routingKeys": [
          "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH"
        ],
        "serviceEndpoint": "http://192.168.56.101:8020",
        "type": "string"
      },
      "did:sov:WgWxqztrNooG92RXvxSTWv"
    ]
  },
  "invitation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "invitation_url": "https://example.com/endpoint?c_i=eyJAdHlwZSI6ICIuLi4iLCAiLi4uIjogIi4uLiJ9XX0=",
  "oob_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "state": "await_response",
  "trace": true,
  "updated_at": "2021-12-31T23:59:59Z"
}

Parameters and Request Body

For automated acceptance, pass the following parameters:

auto_accept

Set this to true

A simple request body is below:

{
    "alias": "Holder",
    "handshake_protocols": ["https://didcomm.org/didexchange/1.0"],
    "use_public_did": false,
    "my_label": "Invitation to Holder"
}

1b: Holder receives invitation

The above request will have an invitation in the response. Holder will have to copy that invitation and pass in the body of the following API call.

Receive a new connection invitation

post
Query parameters
aliasanyOptional

Alias for connection

Example: {"value":"Barry"}
auto_acceptanyOptional

Auto-accept connection (defaults to configuration)

mediation_idanyOptional

Identifier for active mediation record to be used

Example: {"value":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}
use_existing_connectionanyOptional

Use an existing connection, if possible

Body
@idstringOptional

Message identifier

Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
@typestringOptional

Message type

Example: https://didcomm.org/my-family/1.0/my-message-type
acceptstring[]Optional

List of mime type in order of preference

Example: ["didcomm/aip1","didcomm/aip2;env=rfc19"]
goalstringOptional

A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message

Example: To issue a Faber College Graduate credential
goal_codestringOptional

A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message

Example: issue-vc
handshake_protocolsstring[]Optional

Handshake protocol

imageUrlstring · urlOptional

Optional image URL for out-of-band invitation

Example: http://192.168.56.101/img/logo.jpg
labelstringOptional

Optional label

Example: Bob
Responses
200Success
application/json
post
POST /out-of-band/receive-invitation HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 1305

{
  "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "@type": "https://didcomm.org/my-family/1.0/my-message-type",
  "accept": [
    "didcomm/aip1",
    "didcomm/aip2;env=rfc19"
  ],
  "goal": "To issue a Faber College Graduate credential",
  "goal_code": "issue-vc",
  "handshake_protocols": [
    "https://didcomm.org/didexchange/1.0"
  ],
  "imageUrl": "http://192.168.56.101/img/logo.jpg",
  "label": "Bob",
  "requests~attach": [
    {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "byte_count": 1234,
      "data": {
        "base64": "ey4uLn0=",
        "json": "{\"sample\": \"content\"}",
        "jws": {
          "header": {
            "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
          },
          "protected": "ey4uLn0",
          "signature": "ey4uLn0",
          "signatures": [
            {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0"
            }
          ]
        },
        "links": [
          "https://link.to/data"
        ],
        "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
      },
      "description": "view from doorway, facing east, with lights off",
      "filename": "IMG1092348.png",
      "lastmod_time": "2021-12-31T23:59:59Z",
      "mime-type": "image/png"
    }
  ],
  "services": [
    {
      "did": "WgWxqztrNooG92RXvxSTWv",
      "id": "string",
      "recipientKeys": [
        "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH"
      ],
      "routingKeys": [
        "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH"
      ],
      "serviceEndpoint": "http://192.168.56.101:8020",
      "type": "string"
    },
    "did:sov:WgWxqztrNooG92RXvxSTWv"
  ]
}
200Success
{
  "attach_thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2021-12-31T23:59:59Z",
  "invi_msg_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "invitation": {
    "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "@type": "https://didcomm.org/my-family/1.0/my-message-type",
    "accept": [
      "didcomm/aip1",
      "didcomm/aip2;env=rfc19"
    ],
    "goal": "To issue a Faber College Graduate credential",
    "goal_code": "issue-vc",
    "handshake_protocols": [
      "https://didcomm.org/didexchange/1.0"
    ],
    "imageUrl": "http://192.168.56.101/img/logo.jpg",
    "label": "Bob",
    "requests~attach": [
      {
        "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "byte_count": 1234,
        "data": {
          "base64": "ey4uLn0=",
          "json": "{\"sample\": \"content\"}",
          "jws": {
            "header": {
              "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
            },
            "protected": "ey4uLn0",
            "signature": "ey4uLn0",
            "signatures": [
              {
                "header": {
                  "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                },
                "protected": "ey4uLn0",
                "signature": "ey4uLn0"
              }
            ]
          },
          "links": [
            "https://link.to/data"
          ],
          "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
        },
        "description": "view from doorway, facing east, with lights off",
        "filename": "IMG1092348.png",
        "lastmod_time": "2021-12-31T23:59:59Z",
        "mime-type": "image/png"
      }
    ],
    "services": [
      {
        "did": "WgWxqztrNooG92RXvxSTWv",
        "id": "string",
        "recipientKeys": [
          "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH"
        ],
        "routingKeys": [
          "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH"
        ],
        "serviceEndpoint": "http://192.168.56.101:8020",
        "type": "string"
      },
      "did:sov:WgWxqztrNooG92RXvxSTWv"
    ]
  },
  "multi_use": true,
  "oob_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "our_recipient_key": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "role": "receiver",
  "state": "await-response",
  "their_service": {
    "recipientKeys": [
      "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
    ],
    "routingKeys": [
      "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
    ],
    "serviceEndpoint": "http://192.168.56.101:8020"
  },
  "trace": true,
  "updated_at": "2021-12-31T23:59:59Z"
}

Parameters and Request Body

auto_accept

Set this to true

alias

Pass an alias for the connection

use_existing_connection

Set this to true

The request body should be the invitation value from the /create-invitation call by the Issuer.

Step 2: Holder creates local DID

For JSON-LD Credentials, the verification needs a Holder did as well. The Holder DID can be created locally by using the following API Call.

Create a local DID

post
Body
methodstringOptional

Method for the requested DID.Supported methods are 'key', 'sov', and any other registered method.

Example: sov
optionsall ofOptional

To define a key type and/or a did depending on chosen DID method.

seedstringOptional

Optional seed to use for DID, Must be enabled in configuration before use.

Example: 000000000000000000000000Trustee1
Responses
200Success
application/json
post
POST /wallet/did/create HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 131

{
  "method": "sov",
  "options": {
    "did": "did:peer:WgWxqztrNooG92RXvxSTWv",
    "key_type": "ed25519"
  },
  "seed": "000000000000000000000000Trustee1"
}
200Success
{
  "result": {
    "did": "did:peer:WgWxqztrNooG92RXvxSTWv",
    "key_type": "ed25519",
    "metadata": {},
    "method": "sov",
    "posture": "wallet_only",
    "verkey": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
  }
}

Request Body

You can use the following request body to create the local did. Ensure the key_type matches the Issuer DID Key Type.

{
  "method": "key",
  "options": {
    "key_type": "ed25519"
  }
}

Step 3: Request Credential from Issuer

For this example, the Credential is requested from the Holder to the Issuer using the /issue-credential-2.0/send-request API. This request is sent to the Issuer, informing them about the credential request and its attributes in a JSON format.

Send issuer a credential request not bound to an existing thread. Indy credentials cannot start at a request

post
Body
auto_removebooleanOptional

Whether to remove the credential exchange record on completion (overrides --preserve-exchange-records configuration setting)

commentstringOptional

Human-readable comment

connection_idstringRequired

Connection identifier

Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
filterall ofRequired

Credential specification criteria by format

holder_didstringOptional

Holder DID to substitute for the credentialSubject.id

Example: did:key:ahsdkjahsdkjhaskjdhakjshdkajhsdkjahs
tracebooleanOptional

Whether to trace event (default false)

Responses
200Success
application/json
post
POST /issue-credential-2.0/send-request HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 775

{
  "auto_remove": true,
  "comment": "text",
  "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "filter": {
    "ld_proof": {
      "credential": {
        "@context": [
          "https://www.w3.org/2018/credentials/v1",
          "https://w3id.org/citizenship/v1"
        ],
        "credentialSubject": {
          "familyName": "SMITH",
          "gender": "Male",
          "givenName": "JOHN",
          "type": [
            "PermanentResident",
            "Person"
          ]
        },
        "description": "Government of Example Permanent Resident Card.",
        "identifier": "83627465",
        "issuanceDate": "2019-12-03T12:19:52Z",
        "issuer": "did:key:z6MkmjY8GnV5i9YTDtPETC2uUAW6ejw3nk5mXF5yci5ab7th",
        "name": "Permanent Resident Card",
        "type": [
          "VerifiableCredential",
          "PermanentResidentCard"
        ]
      },
      "options": {
        "proofType": "Ed25519Signature2018"
      },
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  },
  "holder_did": "did:key:ahsdkjahsdkjhaskjdhakjshdkajhsdkjahs",
  "trace": false
}
200Success
{
  "auto_issue": false,
  "auto_offer": false,
  "auto_remove": false,
  "by_format": {
    "cred_issue": {},
    "cred_offer": {},
    "cred_proposal": {},
    "cred_request": {}
  },
  "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2021-12-31T23:59:59Z",
  "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "cred_issue": {
    "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "@type": "https://didcomm.org/my-family/1.0/my-message-type",
    "comment": "text",
    "credentials~attach": [
      {
        "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "byte_count": 1234,
        "data": {
          "base64": "ey4uLn0=",
          "json": "{\"sample\": \"content\"}",
          "jws": {
            "header": {
              "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
            },
            "protected": "ey4uLn0",
            "signature": "ey4uLn0",
            "signatures": [
              {
                "header": {
                  "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                },
                "protected": "ey4uLn0",
                "signature": "ey4uLn0"
              }
            ]
          },
          "links": [
            "https://link.to/data"
          ],
          "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
        },
        "description": "view from doorway, facing east, with lights off",
        "filename": "IMG1092348.png",
        "lastmod_time": "2021-12-31T23:59:59Z",
        "mime-type": "image/png"
      }
    ],
    "formats": [
      {
        "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "format": "aries/[email protected]"
      }
    ],
    "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  },
  "cred_offer": {
    "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "@type": "https://didcomm.org/my-family/1.0/my-message-type",
    "comment": "text",
    "credential_preview": {
      "@type": "issue-credential/2.0/credential-preview",
      "attributes": [
        {
          "mime-type": "image/jpeg",
          "name": "favourite_drink",
          "value": "martini"
        }
      ]
    },
    "formats": [
      {
        "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "format": "aries/[email protected]"
      }
    ],
    "offers~attach": [
      {
        "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "byte_count": 1234,
        "data": {
          "base64": "ey4uLn0=",
          "json": "{\"sample\": \"content\"}",
          "jws": {
            "header": {
              "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
            },
            "protected": "ey4uLn0",
            "signature": "ey4uLn0",
            "signatures": [
              {
                "header": {
                  "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                },
                "protected": "ey4uLn0",
                "signature": "ey4uLn0"
              }
            ]
          },
          "links": [
            "https://link.to/data"
          ],
          "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
        },
        "description": "view from doorway, facing east, with lights off",
        "filename": "IMG1092348.png",
        "lastmod_time": "2021-12-31T23:59:59Z",
        "mime-type": "image/png"
      }
    ],
    "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  },
  "cred_preview": {
    "@type": "issue-credential/2.0/credential-preview",
    "attributes": [
      {
        "mime-type": "image/jpeg",
        "name": "favourite_drink",
        "value": "martini"
      }
    ]
  },
  "cred_proposal": {
    "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "@type": "https://didcomm.org/my-family/1.0/my-message-type",
    "comment": "text",
    "credential_preview": {
      "@type": "issue-credential/2.0/credential-preview",
      "attributes": [
        {
          "mime-type": "image/jpeg",
          "name": "favourite_drink",
          "value": "martini"
        }
      ]
    },
    "filters~attach": [
      {
        "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "byte_count": 1234,
        "data": {
          "base64": "ey4uLn0=",
          "json": "{\"sample\": \"content\"}",
          "jws": {
            "header": {
              "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
            },
            "protected": "ey4uLn0",
            "signature": "ey4uLn0",
            "signatures": [
              {
                "header": {
                  "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                },
                "protected": "ey4uLn0",
                "signature": "ey4uLn0"
              }
            ]
          },
          "links": [
            "https://link.to/data"
          ],
          "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
        },
        "description": "view from doorway, facing east, with lights off",
        "filename": "IMG1092348.png",
        "lastmod_time": "2021-12-31T23:59:59Z",
        "mime-type": "image/png"
      }
    ],
    "formats": [
      {
        "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "format": "aries/[email protected]"
      }
    ]
  },
  "cred_request": {
    "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "@type": "https://didcomm.org/my-family/1.0/my-message-type",
    "comment": "text",
    "formats": [
      {
        "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "format": "aries/[email protected]"
      }
    ],
    "requests~attach": [
      {
        "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "byte_count": 1234,
        "data": {
          "base64": "ey4uLn0=",
          "json": "{\"sample\": \"content\"}",
          "jws": {
            "header": {
              "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
            },
            "protected": "ey4uLn0",
            "signature": "ey4uLn0",
            "signatures": [
              {
                "header": {
                  "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                },
                "protected": "ey4uLn0",
                "signature": "ey4uLn0"
              }
            ]
          },
          "links": [
            "https://link.to/data"
          ],
          "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
        },
        "description": "view from doorway, facing east, with lights off",
        "filename": "IMG1092348.png",
        "lastmod_time": "2021-12-31T23:59:59Z",
        "mime-type": "image/png"
      }
    ]
  },
  "error_msg": "The front fell off",
  "initiator": "self",
  "parent_thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "role": "issuer",
  "state": "done",
  "thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "trace": true,
  "updated_at": "2021-12-31T23:59:59Z"
}

Request Body

The following request is a sample for creating a Citizenship credential.

{
    "auto_remove": true,
    "comment": "Holder asking for Citizenship credential.",
    "connection_id": "{{holder-conn-id}}",
    "filter": {
        "ld_proof": {
            "credential": {
                "@context": [
                    "https://www.w3.org/2018/credentials/v1",
                    "https://w3id.org/citizenship/v1"
                ],
                "type": [
                    "VerifiableCredential",
                    "PermanentResident"
                ],
                "identifier": "{{$randomAlphaNumeric}}",
                "issuer": "{{issuer-did}}",
                "issuanceDate": "2020-01-01T12:00:00Z",
                "credentialSubject": {
                    "type": [
                        "PermanentResident",
                        "Person"
                    ],
                    "givenName": "ALICE",
                    "familyName": "SMITH",
                    "gender": "Female",
                    "birthCountry": "Bahamas",
                    "birthDate": "1958-07-17"
                }
            },
            "options": {
                "proofType": "Ed25519Signature2020"
            }
        }
    },
    "holder_did": "{{holder-local-did}}",
  "trace": false
}

Step 4: Issuer accepts and issues credential

After the Issuer received and validated the request, they can issue the credential using the /issue-credential-2.0/records/<credential-exchange-id>/issue API endpoint. The credential-exchange-id can be retrieved by calling GET /issue-credential-2.0/records?state=request-received API.

Send holder a credential

post
Path parameters
cred_ex_idanyRequired

Credential exchange identifier

Example: {"value":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}
Body
commentstringOptional

Human-readable comment

Responses
200Success
application/json
post
POST /issue-credential-2.0/records/{cred_ex_id}/issue HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "comment": "text"
}
200Success
{
  "cred_ex_record": {
    "auto_issue": false,
    "auto_offer": false,
    "auto_remove": false,
    "by_format": {
      "cred_issue": {},
      "cred_offer": {},
      "cred_proposal": {},
      "cred_request": {}
    },
    "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_issue": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credentials~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_offer": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "offers~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_preview": {
      "@type": "issue-credential/2.0/credential-preview",
      "attributes": [
        {
          "mime-type": "image/jpeg",
          "name": "favourite_drink",
          "value": "martini"
        }
      ]
    },
    "cred_proposal": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "filters~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ]
    },
    "cred_request": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "requests~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ]
    },
    "error_msg": "The front fell off",
    "initiator": "self",
    "parent_thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "role": "issuer",
    "state": "done",
    "thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "trace": true,
    "updated_at": "2021-12-31T23:59:59Z"
  },
  "indy": {
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_ex_indy_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_id_stored": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_request_metadata": {},
    "cred_rev_id": "12345",
    "rev_reg_id": "WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0",
    "state": "active",
    "updated_at": "2021-12-31T23:59:59Z"
  },
  "ld_proof": {
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_ex_ld_proof_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_id_stored": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "state": "active",
    "updated_at": "2021-12-31T23:59:59Z"
  },
  "vc_di": {
    "auto_issue": false,
    "auto_offer": false,
    "auto_remove": false,
    "by_format": {
      "cred_issue": {},
      "cred_offer": {},
      "cred_proposal": {},
      "cred_request": {}
    },
    "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_issue": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credentials~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_offer": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "offers~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_preview": {
      "@type": "issue-credential/2.0/credential-preview",
      "attributes": [
        {
          "mime-type": "image/jpeg",
          "name": "favourite_drink",
          "value": "martini"
        }
      ]
    },
    "cred_proposal": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "filters~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ]
    },
    "cred_request": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "requests~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ]
    },
    "error_msg": "The front fell off",
    "initiator": "self",
    "parent_thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "role": "issuer",
    "state": "done",
    "thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "trace": true,
    "updated_at": "2021-12-31T23:59:59Z"
  }
}

Step 5: Holder stores Credential

The Holder has to store the issued credential into their wallet using the following API. The cred_ex_id can be retrieved by running API GET /issue-credential-2.0/records?state=credential-received on the Holder side.

Store a received credential

post
Path parameters
cred_ex_idanyRequired

Credential exchange identifier

Example: {"value":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}
Body
credential_idstringOptional
Responses
200Success
application/json
post
POST /issue-credential-2.0/records/{cred_ex_id}/store HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "credential_id": "text"
}
200Success
{
  "cred_ex_record": {
    "auto_issue": false,
    "auto_offer": false,
    "auto_remove": false,
    "by_format": {
      "cred_issue": {},
      "cred_offer": {},
      "cred_proposal": {},
      "cred_request": {}
    },
    "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_issue": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credentials~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_offer": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "offers~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_preview": {
      "@type": "issue-credential/2.0/credential-preview",
      "attributes": [
        {
          "mime-type": "image/jpeg",
          "name": "favourite_drink",
          "value": "martini"
        }
      ]
    },
    "cred_proposal": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "filters~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ]
    },
    "cred_request": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "requests~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ]
    },
    "error_msg": "The front fell off",
    "initiator": "self",
    "parent_thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "role": "issuer",
    "state": "done",
    "thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "trace": true,
    "updated_at": "2021-12-31T23:59:59Z"
  },
  "indy": {
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_ex_indy_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_id_stored": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_request_metadata": {},
    "cred_rev_id": "12345",
    "rev_reg_id": "WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0",
    "state": "active",
    "updated_at": "2021-12-31T23:59:59Z"
  },
  "ld_proof": {
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_ex_ld_proof_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_id_stored": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "state": "active",
    "updated_at": "2021-12-31T23:59:59Z"
  },
  "vc_di": {
    "auto_issue": false,
    "auto_offer": false,
    "auto_remove": false,
    "by_format": {
      "cred_issue": {},
      "cred_offer": {},
      "cred_proposal": {},
      "cred_request": {}
    },
    "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_at": "2021-12-31T23:59:59Z",
    "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "cred_issue": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credentials~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_offer": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "offers~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "replacement_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "cred_preview": {
      "@type": "issue-credential/2.0/credential-preview",
      "attributes": [
        {
          "mime-type": "image/jpeg",
          "name": "favourite_drink",
          "value": "martini"
        }
      ]
    },
    "cred_proposal": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "credential_preview": {
        "@type": "issue-credential/2.0/credential-preview",
        "attributes": [
          {
            "mime-type": "image/jpeg",
            "name": "favourite_drink",
            "value": "martini"
          }
        ]
      },
      "filters~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ],
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ]
    },
    "cred_request": {
      "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "@type": "https://didcomm.org/my-family/1.0/my-message-type",
      "comment": "text",
      "formats": [
        {
          "attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "format": "aries/[email protected]"
        }
      ],
      "requests~attach": [
        {
          "@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "byte_count": 1234,
          "data": {
            "base64": "ey4uLn0=",
            "json": "{\"sample\": \"content\"}",
            "jws": {
              "header": {
                "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
              },
              "protected": "ey4uLn0",
              "signature": "ey4uLn0",
              "signatures": [
                {
                  "header": {
                    "kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
                  },
                  "protected": "ey4uLn0",
                  "signature": "ey4uLn0"
                }
              ]
            },
            "links": [
              "https://link.to/data"
            ],
            "sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
          },
          "description": "view from doorway, facing east, with lights off",
          "filename": "IMG1092348.png",
          "lastmod_time": "2021-12-31T23:59:59Z",
          "mime-type": "image/png"
        }
      ]
    },
    "error_msg": "The front fell off",
    "initiator": "self",
    "parent_thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "role": "issuer",
    "state": "done",
    "thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "trace": true,
    "updated_at": "2021-12-31T23:59:59Z"
  }
}

Step 6: Check the received Credential

As this is a JSON-LD Credential, Holder must use POST /credentials/w3c API to check the credential.

Fetch W3C credentials from wallet

post
Query parameters
countanyOptional

Maximum number to retrieve

Example: {"value":"1"}
startanyOptional

Start index

Example: {"value":"0"}
wqlanyOptional

(JSON) WQL query

Example: {"value":"{\"attr::name::value\": \"Alex\"}"}
Body
contextsstring[]Optional

Credential context to match

given_idstringOptional

Given credential id to match

issuer_idstringOptional

Credential issuer identifier to match

max_resultsintegerOptional

Maximum number of results to return

proof_typesstring[]Optional

Signature suite used for proof

schema_idsstring[]Optional

Schema identifiers, all of which to match

subject_idsstring[]Optional

Subject identifiers, all of which to match

typesstring[]Optional

Credential type to match

Responses
200Success
application/json
post
POST /credentials/w3c HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 267

{
  "contexts": [
    "https://myhost:8021"
  ],
  "given_id": "text",
  "issuer_id": "text",
  "max_results": 1,
  "proof_types": [
    "Ed25519Signature2018"
  ],
  "schema_ids": [
    "https://myhost:8021"
  ],
  "subject_ids": [
    "text"
  ],
  "tag_query": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "types": [
    "https://myhost:8021"
  ]
}
200Success
{
  "results": [
    {
      "contexts": [
        "https://myhost:8021"
      ],
      "cred_tags": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      },
      "cred_value": {},
      "expanded_types": [
        "https://w3id.org/citizenship#PermanentResidentCard"
      ],
      "given_id": "http://example.edu/credentials/3732",
      "issuer_id": "https://example.edu/issuers/14",
      "proof_types": [
        "Ed25519Signature2018"
      ],
      "record_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "schema_ids": [
        "https://example.org/examples/degree.json"
      ],
      "subject_ids": [
        "did:example:ebfeb1f712ebc6f1c276e12ec21"
      ]
    }
  ]
}

Request Body

For our citizenship credential example, the following request can be used

{
    "contexts": [
        "https://www.w3.org/2018/credentials/v1",
        "https://w3id.org/citizenship/v1"
    ],
    "proof_types": [
        "Ed25519Signature2020"
    ]
}

Last updated

Was this helpful?