Skip to main content

Receive a credential

Learn how to receive a credential.

The issuance workflow for wallets has three steps:

  1. Handle invitation

  2. Get credential

  3. Respond to the offer

This page explains each step and how to complete them. Samples for the Desk API (for organizational wallets) and for the SDK (for mobile devices) are provided.

Issuance workflow for wallets

Handle invitation

The issuer will share an invitation URL, often encoded as a QR code. The URL is generated from the issuance protocol; your system must support the issuance protocol used to be able to parse the offer correctly.

Use the "Handle invitation" endpoint to parse the invitation URL:

curl -L -X POST '/api/interaction/v1/handle-invitation' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"url": "https://example.com/invitation"
}'

This endpoint takes an invitation URL from the issuer and retrieves the offer, returning two things:

  • Interaction ID: this is a reference for the newly created interaction. You will use this ID when you later respond to the offer.
  • Credential IDs: this is an array of IDs representing the offered credentials. You can look up details of the offered credentials but they are not yet issued to the wallet.

Transport array

If you have multiple transport protocols configured you can use this array to override the default protocol. For wallets, this is generally only the case for mobile devices.

Get credential

To see the offer, look up the credential:

curl -L '/api/credential/v1/{credentialId}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \

Respond to offer

Review the offered credential and either accept it or reject it.

Accept offer

Choose an identifier to use to accept the credential — the identifier becomes part of the issued credential and will need to be used again when you present the credential to a verifier.

Choosing an identifier

Check the following capabilities for a report of which identifiers and associated key algorithms can be used with the format of the credential you want to accept:

  • holderIdentifierTypes
  • holderKeyAlgorithms
  • holderDidMethods
curl -L -X POST '/api/interaction/v1/issuance-accept' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"identifierId":"{{CHOOSE-IDENTIFIER}}",
"interactionId":"{{FROM-HANDLE-INVITATION}}"
}'

Reject offer

curl -L -X POST '/api/interaction/v1/issuance-reject' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"interactionId":"{{FROM-HANDLE-INVITATION}}"
}'