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();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.verifiable_credentials.create_offer(service_id: '<id>', vci_offer_create_request: Models::Components::VciOfferCreateRequest.new)
unless res.vci_offer_create_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.VerifiableCredentials.CreateOffer(ctx, "<id>", components.VciOfferCreateRequest{})
if err != nil {
log.Fatal(err)
}
if res.VciOfferCreateResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/vci/offer/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"authorizationCodeGrantIncluded": true,
"issuerStateIncluded": true,
"preAuthorizedCodeGrantIncluded": true,
"subject": "<string>",
"duration": 123,
"context": "<string>",
"properties": [
{
"key": "<string>",
"value": "<string>",
"hidden": true
}
],
"jwtAtClaims": "<string>",
"authTime": 123,
"acr": "<string>",
"credentialConfigurationIds": [
"<string>"
],
"txCode": "<string>",
"txCodeInputMode": "<string>",
"txCodeDescription": "<string>"
}
'{
"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>"
}
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Create Credential Offer
Create a verifiable credential offer
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();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.verifiable_credentials.create_offer(service_id: '<id>', vci_offer_create_request: Models::Components::VciOfferCreateRequest.new)
unless res.vci_offer_create_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.VerifiableCredentials.CreateOffer(ctx, "<id>", components.VciOfferCreateRequest{})
if err != nil {
log.Fatal(err)
}
if res.VciOfferCreateResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/vci/offer/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"authorizationCodeGrantIncluded": true,
"issuerStateIncluded": true,
"preAuthorizedCodeGrantIncluded": true,
"subject": "<string>",
"duration": 123,
"context": "<string>",
"properties": [
{
"key": "<string>",
"value": "<string>",
"hidden": true
}
],
"jwtAtClaims": "<string>",
"authTime": 123,
"acr": "<string>",
"credentialConfigurationIds": [
"<string>"
],
"txCode": "<string>",
"txCodeInputMode": "<string>",
"txCodeDescription": "<string>"
}
'{
"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>"
}
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Authorizations
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
A service ID.
Body
The flag indicating whether the authorization_code object is
included in the grants object.
The flag indicating whether the issuer_state property is
included in the authorization_code object in the grants
object.
The flag to include the
urn:ietf:params:oauth:grant-type:pre-authorized_code object
in the grants object.
The subject associated with the credential offer.
The duration of the credential offer.
The general-purpose arbitrary string.
Extra properties to associate with the credential offer.
Show child attributes
Show child attributes
Additional claims that are added to the payload part of the JWT access token.
The time at which the user authentication was performed during the course of issuing the credential offer.
The Authentication Context Class Reference of the user authentication performed during the course of issuing the credential offer.
The value of the credential_configuration_ids array.
The transaction code that should be associated with the credential offer.
The input mode of the transaction code.
The description of the transaction code.
Response
The code which represents the result of the API call.
A short message which explains the result of the API call.
The result of the /vci/offer/create API call.
CREATED, FORBIDDEN, CALLER_ERROR, AUTHLETE_ERROR Show child attributes
Show child attributes