---
id: dcql-2-4-2-claim-set-age-verification
title: "DCQL: Claim Sets (Selective Disclosure)"
sidebar_label: Claim Sets (Selective Disclosure)
description: DCQL claim sets for selective disclosure, requesting preferred claims with fallback alternatives.
keywords: [DCQL, claim sets, selective disclosure, age verification, OpenID4VP, credential query, EUDI Wallet, verifiable credentials]
---

> **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
> ```
>
> This page maps to the `igrantio-dcql-claim-sets` skill. Install just that one with:
>
> ```bash
> npx skills add L3-iGrant/skills -s igrantio-dcql-claim-sets
> ```


import { ApiKeyManager } from "@site/src/components/ApiKeyManager";
import DcqlStepTemplate from "@site/src/components/DCQL/DcqlStepTemplate";

DCQL `claim_sets` allow a verifier to request preferred claims with fallback alternatives, enabling selective disclosure where only the minimum necessary data is shared.

**Scenario:** A verifier requests age verification from a PID credential, preferring a simple boolean `over_21` claim and falling back to the full `birthdate` if unavailable.

For the underlying DCQL query, diagram and example, see the **“Claim set for age verification (selective disclosure)”** use case in our [DCQL concepts article](/concepts/eudi-wallet-dcql-openid4vp-business-wallet-payments/#242-use-case-claim-set-for-age-verification-selective-disclosure).

![Fig 02: Verify age with minimal disclosure (Mandatory), for example by sharing an age-over-18 claim instead of a full date of birth.](../cDocs/articles/dcql-images/fig-02-dcql-eudi-wallet-age-verification-minimal-disclosure.png)

## 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.

<ApiKeyManager />

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

To create a credential definition, run the interactive block below using the **Run** button. Alternatively, you can manually copy the JSON and use it in the body of the API available [here](/docs/openid4vc-api/config-create-digital-wallet-open-id-credential-definition).

> Note: The `kid` value is mandatory with trust anchor `x509`. To obtain the `kid` value for the respective organisation use the API available [here](https://docs.igrant.io/docs/openid4vc-api/config-read-digital-wallet-open-id-organisation-identifier).

From the API response, copy the `credentialDefinitionId` and `id` value from the `credentialDefinitions` array for use in the Step 3.

<DcqlStepTemplate
  initialJsonData={{
    label: "PID - Person Identification Data",
    trustAnchor: "x509",
    kid: "<kid>",
    credentialDefinitions: [
      {
        credentialFormat: "dc+sd-jwt",
        vct: "urn:eu.europa.ec.eudi:pid:1",
        display: {
          name: "PID - Person Identification Data",
          description: "Person Identification Data credential",
        },
        claims: {
          claims: [
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["address", "country"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["address", "locality"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["address", "region"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["address", "street_address"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["birth_date"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["email"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["family_name"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["given_name"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["is_over_18"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["is_over_21"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["is_over_65"],
            },
            {
              limitDisclosure: true,
              mandatory: true,
              path: ["phone_number"],
            },
          ],
        },
      },
    ],
  }}
  endpointPath="/v2/config/digital-wallet/openid/sdjwt/credential-definition"
  extractJsonResponse={(result) => result}
/>

## Step 3: Issue and Receive Credential (Issuer/Holder)

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 `InTime` issuance mode. Choose the credential format and replace `<credentialDefinitionId>` and `<id>` with the actual values 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, you can toggle the switch to dynamically generate a QR code. The EUDI Wallet/Holder can then accept the credential offer using the [Data Wallet](https://www.igrant.io/datawallet.html) (or any other EU Digital Identity Wallet) by either scanning the QR code or by directly accessing the credential offer on their mobile device (e.g. via a browser).

<DcqlStepTemplate
  initialJsonData={{
    issuanceMode: "InTime",
    credentialDefinitionId: "<credentialDefinitionId>",
    urlScheme: "openid-credential-offer://",
    credentials: [
      {
        id: "<id>",
        claims: {
          address: {
            country: "Sweden",
            locality: "Stockholm",
            region: "Stockholm County",
            street_address: "Sveavägen 44",
          },
          birth_date: "1958-01-07",
          email: "alice.andersson@example.com",
          family_name: "Andersson",
          given_name: "Alice",
          is_over_18: true,
          is_over_21: true,
          is_over_65: false,
          phone_number: "+46 70 123 45 67",
        },
      },
    ],
    userPin: "",
  }}
  endpointPath="/v2/config/digital-wallet/openid/sdjwt/credential/issue"
  extractJsonResponse={(result) => result}
  extractQrValue={(result) => result?.credentialHistory?.credentialOffer}
/>

To receive and accept the credential via API. First, use the `credentialOffer` to call the [Receive Credential API](https://docs.igrant.io/docs/openid4vc-api/config-receive-digital-wallet-open-id-credential/). Once you have the response, copy the `credentialId` and provide it at [Accept Credential API](https://staging-docs.igrant.io/docs/openid4vc-api/config-accept-digital-wallet-open-id-credential/) to accept the credential.

## Step 4: Create Presentation Definition (Verifier Admin)

To create a presentation definition for requesting proof, you can 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 provided [here](/docs/openid4vc-api/config-digital-wallet-open-id-presentation-definition).

> Note: The `kid` value is mandatory with trust anchor `x509`. To obtain the `kid` value for the respective organisation use the API available [here](https://docs.igrant.io/docs/openid4vc-api/config-read-digital-wallet-open-id-organisation-identifier).

Once a presentation definition has been created, the `presentationDefinitionId` can be reused to verify multiple credentials (Step 6).

<DcqlStepTemplate
  initialJsonData={{
    label: "Claim Set for age verification (Selective Disclosure)",
    trustAnchor: "x509",
    kid: "<kid>",
    dcqlQuery: {
      credentials: [
        {
          id: "pid",
          format: "dc+sd-jwt",
          meta: {
            vct_values: ["urn:eu.europa.ec.eudi:pid:1"],
          },
          claims: [
            {
              id: "over_21",
              path: ["is_over_21"],
            },
            {
              id: "birthdate",
              path: ["birth_date"],
            },
          ],
          claim_sets: [["over_21"], ["birthdate"]],
        },
      ],
    },
  }}
  endpointPath="/v2/config/digital-wallet/openid/sdjwt/presentation-definition"
  extractJsonResponse={(result) => result}
/>

## Step 5: Create Verification Request (Verifier/Relying Party)

To create the verification request, execute the code block below using the **Run** button. Alternatively, you can manually copy the JSON and use it in the body of the API available [here](/docs/openid4vc-api/config-create-digital-wallet-open-id-verification-request-v-3).

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

<DcqlStepTemplate
  initialJsonData={{
    requestByReference: true,
    presentationDefinitionId: "<presentationDefinitionId>",
  }}
  endpointPath="/v3/config/digital-wallet/openid/sdjwt/verification/send"
  extractJsonResponse={(result) => result}
  extractQrValue={(result) => result?.verificationHistory?.vpTokenQrCode}
/>

Users can copy the `presentationExchangeId` from the JSON response for use in Step 7 to read verification history.

## Step 6: Send and Receive Verifiable Presentation (Holder)

The holder wallet accepts (consents) to send the requested credentials.

- **Receive Verification:**
  - Use the `vpTokenQrCode`(step 5) with the API available [here](/docs/openid4vc-api/config-receive-digital-wallet-open-id-verification-v-3/) to receive the verification.
  - Copy the `presentationId` from the JSON response received from **Receive Verification** for use in Step 6b.
- **Filter Verification:**
  - Use that `presentationId` with the API available [here](/docs/openid4vc-api/config-filter-digital-wallet-open-id-verification) to find matching credentials.
  - Save the `<id>` and `<credentialId>` from the response.
- **Send Verification:**
  - Use the `presentationId`, `<id>` and `<credentialId>` with the API available [here](/docs/openid4vc-api/config-send-digital-wallet-open-id-verification-presentation-v-3) to send the credentials to the verifier.

## Step 7: Send and Receive Verifiable Presentation (Verifier/Relying Party)

- The Verfier (Relying Party) receives the requested credentials and can verify it. They may read the received credential by executing the [Read Verification History API](/docs/openid4vc-api/config-read-digital-wallet-open-id-verification-history-v-3).
- From the response received, the `vpTokenResponse` can be decoded using [JWT Decoder](/docs/devtools-jwt-decoder/).
- From the decoded response, the `verifiableCredential` inside the 'vp' can be further decoded to view the received credentials.
