---
id: openID4vci-issue-credential-deferred
title: OpenID4VCI - Issue Credential (Deferred)
hide_title: false
description: Create credential definition and issue in-time credentials using OpenID for verifiable credentials (OpenID4VCI) issuance in deferred mode
keywords: [OpenID4VCI, credential issuance, deferred, OID4VCI, verifiable credentials, Organisation Wallet, European Business Wallet, EUDI Wallet, async issuance]
sidebar_label: Issue Credential (Deferred)
slug: /openID4vci-issue-credential-deferred/
---

> **Build this with an AI coding agent.** Install the iGrant.io Agent Skills, then ask your agent to build the integration:
>
> ```bash
> npx skills add L3-iGrant/skills
> ```


import Link from '@docusaurus/Link';
import VideoPlayer from '@site/src/components/VideoPlayer';
import NoteBox from '@site/src/components/NoteBox';

In many real-life situations, a credential isn't immediately available when requested, often due to time-consuming business processes happening in the back office. In these cases, deferred issuance is used. Here's how credentials are issued on a deferred basis using OpenID for Verifiable Credentials Issuance (OID4VCI). The process involves the following key stages:

**Create Credential Definition:** This stage consists of two main sub-steps:

  * Define: The credential parameters and rules are established.
  * Prepare: All necessary information and infrastructure are set up for issuing the credential.

**Deferred Issue:** Once the credential definition is created and prepared, the issuance is deferred, allowing for any pending business processes to be completed. The credential will be issued only after authorisation or pre-authorisation is completed (as indicated by the transaction code, Txn_Code).

**Issue Credentials:** After the authorisation step, the credentials can be issued to the holder. At this stage, it's necessary to configure the holder's wallet endpoint to complete the credential transfer.

![Issue credential - Deferred](./images/ow-issue-deferred.png)

The image illustrates this deferred process, where the issuance of the credential happens after a delay, once the back-end processes and authorisation steps have been successfully completed.

### Step 1: Get the API Key (Issuer Admin)

To obtain your API key, please contact [support@igrant.io](mailto:support@igrant.io?subject=Request%20API%20Key). Once you have received your API key, enter it in the field below and click the **Set API Key** button to save it for future use.

import { ApiKeyManager } from '@site/src/components/ApiKeyManager';

<ApiKeyManager />

### Step 2: Create Credential Definition (Issuer Admin)

To create a credential definition, run the code block below using the **Run** button. Alternatively, you can manually copy the code block and use it in the body of the API request available [here](/docs/openid4vc-api/config-create-digital-wallet-open-id-credential-definition). From the API response, copy the `credentialDefinitionId` for use in Step 3. Credentials can be issued in any of the following formats: 
1. [W3C Verifiable Credentials Data Model - JWT](https://www.w3.org/TR/vc-data-model/)
2. [IETF SD-JWT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-selective-disclosure-jwt) 
3. [ISO/IEC 18013-5:2021 mdoc/mDL](https://www.iso.org/standard/69084.html)

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import Step2 from '@site/src/components/DeferredIssuance/Step2';

<Step2
  versionFamily="createCredentialDefinition"
  requestBodyOptions={[
    {
      label: "W3C VC (JWT)",
      requestBodyJson: {
        label: "Legal PID (W3C VC) - Deferred",
        type: ["LegalPersonIdentificationData"],
        credentialDefinition: {
          type: "object",
          properties: {
            identifier: {
              type: "string",
            },
            legalName: {
              type: "string",
            },
          },
          required: ["identifier", "legalName"],
        },
        credentialFormat: "jwt_vc_json",
      },
    },
    {
      label: "IETF SD-JWT",
      requestBodyJson: {
        label: "Legal PID (SD-JWT) - Deferred",
        vct: "LegalPersonIdentificationData",
        claims: {
          type: "object",
          properties: {
            // highlight-start
            identifier: {
              type: "string",
              limitDisclosure: true,
            },
            legalName: {
              type: "string",
              limitDisclosure: true,
            },
            // highlight-end
          },
          required: ["identifier", "legalName"],
        },
        credentialFormat: "dc+sd-jwt",
      },
    },
    {
      label: "ISO 18013-5 mdoc/mDL",
      requestBodyJson: {
        label: "Legal PID (mdoc/mDL) - Deferred",
        expirationInDays: 30,
        supportRevocation: true,
        display: {
          name: "org.iso.18013.5.1.lpid",
          description: "LPID (mdoc)",
          backgroundColor: "",
          textColor: "",
        },
        credentialFormat: "mso_mdoc",
        doctype: "org.iso.18013.5.1.lpid",
        claims: {
          type: "object",
          properties: {
            identifier: {
              type: "string",
              limitDisclosure: true,
            },
            legalName: {
              type: "string",
              limitDisclosure: true,
            },
          },
          required: ["identifier", "legalName"],
        },
      },
    },
  ]}
/>

<NoteBox title="Tip:" variant="tip">
Once a credential definition is created, the <code>credentialDefinitionId</code> can be reused to issue multiple credentials (Step 3).
</NoteBox>

### Step 3: Issue Credential (Issuer)

The holder of the wallet submits a request for the issuance of a credential by executing the JSON code block below using the **Run** button in `Deferred` issuance mode. Choose the credential format and replace `<credentialDefinitionId>` with the actual ID obtained from the previous step. Alternatively, you may use the API available [here](/docs/openid4vc-api/config-digital-wallet-open-id-issue-credential).

After receiving the response, toggle the button provided to dynamically generate a QR code. The EUDI Wallet/Holder can then accept the credential offer using the Data Wallet (or any other EU Digital Identity Wallet) by either scanning the QR code or directly accessing the credential offer on their mobile device, such as via a browser.

import Step3 from '@site/src/components/DeferredIssuance/Step3';

<Step3 versionFamily="issueCredential" initialJsonData={{
  "issuanceMode": "Deferred",
  "credentialDefinitionId": "<credentialDefinitionId>"
}} />

From the API response, copy the `credentialExchangeId` and the `credential.id` for use in the next step. The `credential.id` corresponds to the `id` field from the `credentialDefinitions` array in the create credential definition response. **Note that the `credential.id` is not returned or required if the credential format is DRAFT_11.**

### Step 4: Update Credential Offer and Receive (Issuer/Holder)

Once the request is received and the necessary validations are completed, update the credential offer by executing the code block below using the **Run** button.

Alternatively, you can manually copy the code block, replace the placeholders, and use the `credentialExchangeId` from the response as the path parameter in the API request available [here](/docs/openid4vc-api/config-update-digital-wallet-open-id-credential-history).

import Step4 from '@site/src/components/DeferredIssuance/Step4';

<Step4
  versionFamily="updateCredentialOfferAndReceive"
  requestBodyOptions={[
    {
      label: "W3C VC (JWT)",
      requestBodyJson: {
        credential: {
          credentialSubject: {
            identifier: "000",
            legalName: "Bygg AB, Sweden",
          },
        },
      },
    },
    {
      label: "IETF SD-JWT",
      requestBodyJson: {
        credential: {
          claims: {
            identifier: "000",
            legalName: "Bygg AB, Sweden",
          },
        },
      },
    },
    {
      label: "ISO 18013-5 mdoc/mDL",
      requestBodyJson: {
        credential: {
          claims: {
            identifier: "000",
            legalName: "Bygg AB, Sweden",
          },
        },
      },
    },
  ]}
/>

## Try It Yourself (With Demo Video)

Watch the below demo to learn issue credential API and try it out yourselves:

### W3C VC JWT / SD-JWT Credential Format

<VideoPlayer
  videoId="qtsyvw9alb4"
  title="Deferred Credential Issuance Demo"
  description="Learn how to issue credentials in deferred mode using OpenID4VCI protocol with iGrant.io Digital Wallets."
  uploadDate="2024-01-01"
  duration="PT10M"
/>
