Skip to main content

Single, Batch, and Multi-Format Issuance

Procivis One can issue a credential as a single credential, as a batch, or in several formats at once. You choose between single and batch on the credential schema. You choose formats on the schema and again each time you create a credential.

Single vs. batch issuance​

To issue batch credentials, set batchSize to 2 or higher when you create the credential schema:

{
"name": "Membership Card",
...
"batchSize": 10
}

batchSize sets the maximum number of credentials the wallet can request in one batch. With the schema above, the wallet can receive up to 10 credentials each time it is issued a credential from this schema. If you leave out batchSize, the schema issues single credentials.

batchSize must be at least 2; a value of 1 is rejected. It also cannot exceed globalSettings.credentialSchema.maxBatchSize in your configuration, which caps the batch size of every schema in the deployment. See Reading the Configuration.

Decide when you create the schema

You can change the batch size of an existing batch schema, but you cannot add batch issuance to a schema that was created without it. See Editing credential schemas.

SingleBatch
Set on the schemaLeave out batchSizebatchSize ≥ 2
What the wallet receivesOne credentialUp to batchSize credentials, each with its own holder-binding key
How the wallet uses itPresents the same credential every timePresents each credential once
RefreshNot supportedSupported, depending on expiration and refresh token settings
type in credential endpointsSINGLEBATCH_PARENT and BATCH_ITEM

Single credentials​

A single credential is one credential that the wallet presents as often as needed. You cannot refresh it. It stays valid until it expires or you suspend or revoke it.

The list and detail credential endpoints show these credentials as "type": "SINGLE".

Batch credentials​

A batch credential is a set of credentials that are identical except for the holder-binding key: the wallet uses a different key for each one. The wallet presents each credential only once. Depending on your expiration and refresh token settings, the wallet can refresh the batch to get a new set.

The system represents each batch as two kinds of record:

  • Batch parent ("type": "BATCH_PARENT"): the logical credential. This is where you manage the batch. When you suspend or revoke the parent, the system applies the change to every item. The parent's status is the status of the logical credential, because individual items can have different statuses.
  • Batch items ("type": "BATCH_ITEM"): the credentials the wallet actually holds and presents. You can suspend or revoke a single item, but for most use cases you should manage the batch through its parent.

Multi-format issuance​

The system issues a credential in multiple formats when both of the following are true:

To see which formats a credential was offered in and what happened to each offer, fetch the credential details:

GET /api/credential/v1/{id}

{
"offeredFormats": [
{
"format": "MDOC",
"state": "ACCEPTED"
}
],
"schema": {
"formats": [
{
"ecosystemSchemaId": "org.example.membership",
"format": "MDOC"
},
{
"ecosystemSchemaId": "membership_example",
"format": "SD_JWT_VC"
}
]
}
}

schema.formats lists every format the schema supports. offeredFormats lists the formats this credential was offered in. Here the schema supports MDOC and SD_JWT_VC, but the credential was created with only MDOC, and the holder has accepted it.

Each offered format has one of these state values:

StateMeaning
PENDINGThe holder has not accepted the offer yet.
ACCEPTEDThe credential has been issued.
REJECTEDThe wallet reported that it deleted the credential. Not all wallets support this.

Single and batch logic​

batchSize applies to the whole schema. A credential issued from a multi-format schema is therefore either single in every format or a batch in every format, never a mix. See Single credentials and Batch credentials.

Lifecycle management​

To manage a multi-format credential, use the logical credential that POST /api/credential/v1 returns. See Expiration, suspension, and revocation.

Expiration, suspension, and revocation​