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.
Use any supported method to create a connection with the Holder of the credential. Automated out-of-band protocol is recommended.
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.
{% swagger src="../../../.gitbook/assets/swagger.json" path="/out-of-band/create-invitation" method="post" %} swagger.json {% endswagger %}
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"
}
The above request will have an invitation
in the response. Holder will have to copy that inivitation and pass in the body of the following API call.
{% swagger src="../../../.gitbook/assets/swagger.json" path="/out-of-band/receive-invitation" method="post" %} swagger.json {% endswagger %}
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.
Generate a credential offer using the /issue-credential-2.0/send-offer
API. This offer is sent to the holder, informing them about the available credential and its attributes.
{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential-2.0/send-offer" method="post" %} swagger.json {% endswagger %}
The Holder has to retrieve the credential exchange id, and call this API to accept the offer.
{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential/records/{cred_ex_id}/send-request" method="post" %} swagger.json {% endswagger %}
Once the credential request is received and validated, issue the credential using the /issue-credential-2.0/records/<exchange-id>/issue
API endpoint.
{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential-2.0/records/{cred_ex_id}/issue" method="post" %} swagger.json {% endswagger %}
The Holder has to store the issued credential into their wallet using the following API.
{% swagger src="../../../.gitbook/assets/swagger.json" path="/issue-credential-2.0/records/{cred_ex_id}/store" method="post" %} swagger.json {% endswagger %}