> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/help/sdk-api-requirements.md).

# SDK API requirements

### Overview

Most NFC Wallet SDK APIs require an Android `Context`.

Some APIs also require the NFC Wallet SDK initialization to be complete.

Use this page to understand what happens if you call an API too early.

#### Prerequisite definitions

* **SDK configuration**: the SDK has an Android `Context`.
  * This is available after you call `SDKInitializer.INSTANCE.configure(...)`.
  * This is also available after you start `SDKInitializer.INSTANCE.initialize(...)`.
* **SDK initialization**: `SDKInitializer.INSTANCE.initialize(...)` completed successfully.

See [Initialize the NFC Wallet SDK](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/get-started/configuration/4.-initialize-the-nfc-wallet-sdk.md).

{% hint style="warning" %}
Some APIs can throw runtime exceptions (for example: `NullPointerException`) if prerequisites are missing.
{% endhint %}

### DigitalizedCardManager

| API                    | Requires SDK configuration | Requires SDK initialization           | If prerequisites are missing                                                                                                                                      |
| ---------------------- | -------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getAllCards`          | Required                   | Not required                          | Returns `DigitalizedCardErrorCodes.NULL_CONTEXT` with an empty `String[]`.                                                                                        |
| `getDefault`           | Required                   | Not required                          | Returns `DigitalizedCardErrorCodes.NULL_CONTEXT` with an empty `String`.                                                                                          |
| `getDigitalizedCardId` | Required                   | Not required                          | Returns `null`.                                                                                                                                                   |
| `getTokenizedCardId`   | Required                   | Not required                          | Returns `null`.                                                                                                                                                   |
| `unsetDefaultCard`     | Required                   | Required                              | Returns `DigitalizedCardErrorCodes.SDK_NOT_INITIALIZED` and does not perform the operation.                                                                       |
| `getTokenSyncSchedule` | Required                   | Required                              | Throws `NullPointerException`.                                                                                                                                    |
| `isTokenSyncAllowed`   | Required                   | Required                              | Throws `NullPointerException`.                                                                                                                                    |
| `invokeTokenSync`      | Required                   | Required (Mobile Gateway initialized) | Throws `IllegalStateException` if CPS is not initialized. Returns `TokenSyncErrorCode.TOKEN_SYNC_ERROR_SDK_NOT_INITIALIZED` if Mobile Gateway is not initialized. |

### DigitalizedCard

| API                  | Requires SDK configuration | Requires SDK initialization | If prerequisites are missing                                                                |
| -------------------- | -------------------------- | --------------------------- | ------------------------------------------------------------------------------------------- |
| `getCardDetails`     | Required                   | Not required                | Returns `DigitalizedCardErrorCodes.NULL_CONTEXT` with `null`.                               |
| `getCardState`       | Required                   | Not required                | Returns `DigitalizedCardErrorCodes.NULL_CONTEXT` with `null`.                               |
| `isDefault`          | Required                   | Not required                | Returns `DigitalizedCardErrorCodes.NULL_CONTEXT` with `false`.                              |
| `setDefault`         | Required                   | Required                    | Returns `DigitalizedCardErrorCodes.SDK_NOT_INITIALIZED` and does not perform the operation. |
| `isMultiAids`        | Required                   | Not required                | Returns `false`.                                                                            |
| `hasAuxiliaryScheme` | Required                   | Not required                | Returns `false`.                                                                            |
| `getAllAids`         | Required                   | Not required                | Returns an empty `ArrayList`.                                                               |
| `updateAidList`      | Required                   | Not required                | Does not perform the operation.                                                             |

### PaymentBusinessService

| API                                   | Requires SDK configuration | Requires SDK initialization | If prerequisites are missing                                                              |
| ------------------------------------- | -------------------------- | --------------------------- | ----------------------------------------------------------------------------------------- |
| `activate`                            | Required                   | Required                    | Returns the `errorCode: PaymentServiceErrorCode.PAYMENT_NOT_ALLOWED_SDK_NOT_INITIALIZED`. |
| `startAuthentication`                 | Required                   | Required                    | Returns the `errorCode: PaymentServiceErrorCode.PAYMENT_NOT_ALLOWED_SDK_NOT_INITIALIZED`. |
| `getAuthenticationFlowPriorToPayment` | Required                   | Required                    | Returns the `errorCode: PaymentServiceErrorCode.PAYMENT_NOT_ALLOWED_SDK_NOT_INITIALIZED`. |
| `generateQRCodePaymentData`           | Required                   | Required                    | Returns the `errorCode: PaymentServiceErrorCode.PAYMENT_NOT_ALLOWED_SDK_NOT_INITIALIZED`. |
| `generateApplicationCryptogram`       | Required                   | Required                    | Returns the `errorCode: PaymentServiceErrorCode.PAYMENT_NOT_ALLOWED_SDK_NOT_INITIALIZED`. |
| `deactivate`                          | Required                   | Required                    | Does not perform the operation.                                                           |

### EnrollingBusinessService

| API                  | Requires SDK configuration | Requires SDK initialization | If prerequisites are missing                                                                                                                                                    |
| -------------------- | -------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `isEnrolled`         | Required                   | Not required                | Returns `EnrollmentStatus.ENROLLMENT_NEEDED`.                                                                                                                                   |
| `continueEnrollment` | Required                   | Required                    | Returns `ProvisioningServiceErrorCodes.NULL_CONTEXT` if SDK configuration is missing. Returns `ProvisioningServiceErrorCodes.SDK_NOT_INITIALIZED` if initialization is missing. |
| `enroll`             | Required                   | Required                    | Returns `ProvisioningServiceErrorCodes.NULL_CONTEXT` if SDK configuration is missing. Returns `ProvisioningServiceErrorCodes.SDK_NOT_INITIALIZED` if initialization is missing. |

### ProvisioningBusinessService

| API                                   | Requires SDK configuration | Requires SDK initialization | If prerequisites are missing                                                |
| ------------------------------------- | -------------------------- | --------------------------- | --------------------------------------------------------------------------- |
| `processIncomingMessage`              | Required                   | Required                    | Returns the `errorCode: ProvisioningServiceErrorCodes.SDK_NOT_INITIALIZED`. |
| `sendActivationCode`                  | Required                   | Not required                | Returns the `errorCode: ProvisioningServiceErrorCodes.NULL_CONTEXT`.        |
| `sendRequestForReplenishment`         | Required                   | Not required                | Returns the `errorCode: ProvisioningServiceErrorCodes.NULL_CONTEXT`.        |
| `updatePushToken`                     | Required                   | Not required                | Returns the `errorCode: ProvisioningServiceErrorCodes.NULL_CONTEXT`.        |
| `getAccessToken`                      | Required                   | Not required                | Returns the `errorCode: ProvisioningServiceErrorCodes.NULL_CONTEXT`.        |
| `sendRequestForODACertificateRenewal` | Required                   | Not required                | Returns the `errorCode: ProvisioningServiceErrorCodes.NULL_CONTEXT`.        |

### WalletSecureEnrollmentService

| API                           | Requires SDK configuration | Requires SDK initialization           | If prerequisites are missing                                                                                                                         |
| ----------------------------- | -------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getState`                    | Required                   | Not required                          | Returns `null`.                                                                                                                                      |
| `startWalletSecureEnrollment` | Required                   | Required (Mobile Gateway initialized) | Returns `WalletSecureEnrollmentErrorCodes.WSE_CPS_COMPONENT_NOT_INITIALIZED` or `WalletSecureEnrollmentErrorCodes.WSE_MG_COMPONENT_NOT_INITIALIZED`. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/help/sdk-api-requirements.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
