Skip to main content
POST
/
api
/
{serviceId}
/
vci
/
offer
/
create
Typescript (SDK)
import { Authlete } from "@authlete/typescript-sdk";

const authlete = new Authlete({
  bearer: process.env["AUTHLETE_BEARER"] ?? "",
});

async function run() {
  const result = await authlete.verifiableCredentials.createOffer({
    serviceId: "<id>",
    vciOfferCreateRequest: {},
  });

  console.log(result);
}

run();
{
  "resultCode": "<string>",
  "resultMessage": "<string>",
  "action": "CREATED",
  "info": {
    "identifier": "<string>",
    "credentialOffer": "<string>",
    "credentialIssuer": "<string>",
    "authorizationCodeGrantIncluded": true,
    "issuerStateIncluded": true,
    "issuerState": "<string>",
    "preAuthorizedCodeGrantIncluded": true,
    "preAuthorizedCode": "<string>",
    "subject": "<string>",
    "expiresAt": 123,
    "context": "<string>",
    "properties": [
      {
        "key": "<string>",
        "value": "<string>",
        "hidden": true
      }
    ],
    "jwtAtClaims": "<string>",
    "authTime": 123,
    "acr": "<string>",
    "credentialConfigurationIds": [
      "<string>"
    ],
    "txCode": "<string>",
    "txCodeInputMode": "<string>",
    "txCodeDescription": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Authenticate every request with a Service Access Token or Organization Token. Set the token value in the Authorization: Bearer <token> header.

Service Access Token: Scoped to a single service. Use when automating service-level configuration or runtime flows.

Organization Token: Scoped to the organization; inherits permissions across services. Use for org-wide automation or when managing multiple services programmatically.

Both token types are issued by the Authlete console or provisioning APIs.

Path Parameters

serviceId
string
required

A service ID.

Body

authorizationCodeGrantIncluded
boolean

The flag indicating whether the authorization_code object is included in the grants object.

issuerStateIncluded
boolean

The flag indicating whether the issuer_state property is included in the authorization_code object in the grants object.

preAuthorizedCodeGrantIncluded
boolean

The flag to include the urn:ietf:params:oauth:grant-type:pre-authorized_code object in the grants object.

subject
string

The subject associated with the credential offer.

duration
integer<int64>

The duration of the credential offer.

context
string

The general-purpose arbitrary string.

properties
object[]

Extra properties to associate with the credential offer.

jwtAtClaims
string

Additional claims that are added to the payload part of the JWT access token.

authTime
integer<int64>

The time at which the user authentication was performed during the course of issuing the credential offer.

acr
string

The Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.

credentialConfigurationIds
string[]

The value of the credential_configuration_ids array.

{
"credential_issuer": "...",
"credential_configuration_ids": [ ... ],
"grants": { ... }
}

This property is mandatory.

txCode
string

The transaction code that should be associated with the credential offer.

If this parameter is not empty and the preAuthorizedCodeGrantIncluded parameter is true, the urn:ietf:params:oauth:grant-type:pre-authorized_code object will include the tx_code object.

The length of the value of this parameter will be used as the value of the length property in the tx_code object.

{
"credential_issuer": "...",
"credential_configuration_ids": [ ... ],
"grants": {
"urn:ietf:params:oauth:grant-type:pre-authorized_code": {
"pre-authorized_code": "...",
"tx_code": {
"length": length
}
}
}
}
txCodeInputMode
string

The input mode of the transaction code.

The value of this property will be used as the value of the input_mode property in the tx_code object.

{
"credential_issuer": "...",
"credential_configuration_ids": [ ... ],
"grants": {
"urn:ietf:params:oauth:grant-type:pre-authorized_code": {
"pre-authorized_code": "...",
"tx_code": {
"length": length,
"input_mode": "..."
}
}
}
}
txCodeDescription
string

The description of the transaction code.

The value of this property will be used as the value of the description property in the tx_code object.

{
"credential_issuer": "...",
"credential_configuration_ids": [ ... ],
"grants": {
"urn:ietf:params:oauth:grant-type:pre-authorized_code": {
"pre-authorized_code": "...",
"tx_code": {
"length": length,
"description": "..."
}
}
}
}

Response

resultCode
string

The code which represents the result of the API call.

resultMessage
string

A short message which explains the result of the API call.

action
enum<string>

The result of the /vci/offer/create API call.

Available options:
CREATED,
FORBIDDEN,
CALLER_ERROR,
AUTHLETE_ERROR
info
object