# CreateDigitalCredentialRequest

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/CreateDigitalCredentialRequest.kt+class:androidx.credentials.CreateDigitalCredentialRequest) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.6.0)

*** ** * ** ***


```
@ExperimentalDigitalCredentialApi
class CreateDigitalCredentialRequest : CreateCredentialRequest
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.credentials.CreateCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest) ||
|   | ↳ | [androidx.credentials.CreateDigitalCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateDigitalCredentialRequest) |

*** ** * ** ***

A request to save a digital credential to a holder application of the user's choice.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/CreateDigitalCredentialRequest#CreateDigitalCredentialRequest(kotlin.String,kotlin.String)(requestJson: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, origin: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Constructs a request to save a digital credential to a holder application of the user's choice. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateDigitalCredentialRequest#requestJson()` The [JSON](https://w3c-fedid.github.io/digital-credentials/#extensions-to-credentialcreationoptions-dictionary) string representing the request |

| ### Inherited properties |
|---|
| From [androidx.credentials.CreateCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest) |---|---| | `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#candidateQueryData()` the partial request data in the `https://developer.android.com/reference/android/os/Bundle.html` format that will be sent to the provider during the initial candidate query stage, which should not contain sensitive user credential information (note: bundle keys in the form of `androidx.credentials.*` are reserved for internal library use) | | `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#credentialData()` the request data in the `https://developer.android.com/reference/android/os/Bundle.html` format | | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#displayInfo()` the information to be displayed on the screen | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#isAutoSelectAllowed()` whether a create option will be automatically chosen if it is the only one available to the user | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#isSystemProviderRequired()` true if must only be fulfilled by a system provider and false otherwise | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#origin()` the origin of a different application if the request is being made on behalf of that application (Note: for API level \>=34, setting a non-null value for this parameter will throw a SecurityException if android.permission.CREDENTIAL_MANAGER_SET_ORIGIN is not present) | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#preferImmediatelyAvailableCredentials()` true if you prefer the operation to return immediately when there is no available passkey registration offering instead of falling back to discovering remote options, and false (preferred by default) otherwise | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#type()` the credential type determined by the credential-type-specific subclass (e.g. the type for `https://developer.android.com/reference/kotlin/androidx/credentials/CreatePasswordRequest` is `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()` and for `https://developer.android.com/reference/kotlin/androidx/credentials/CreatePublicKeyCredentialRequest` is `https://developer.android.com/reference/kotlin/androidx/credentials/PublicKeyCredential#TYPE_PUBLIC_KEY_CREDENTIAL()`) | |

## Public constructors

### CreateDigitalCredentialRequest

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.6.0)

```
CreateDigitalCredentialRequest(requestJson: String, origin: String?)
```

Constructs a request to save a digital credential to a holder application of the user's choice.

| Parameters |
|---|---|
| `requestJson: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The [JSON](https://w3c-fedid.github.io/digital-credentials/#extensions-to-credentialcreationoptions-dictionary) string representing the request |
| `origin: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | the origin of a different application if the request is being made on behalf of that application |

## Public properties

### requestJson

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.6.0)

```
val requestJson: String
```

The [JSON](https://w3c-fedid.github.io/digital-credentials/#extensions-to-credentialcreationoptions-dictionary) string representing the request