> 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/merchant-tokenization/visa-ctf-and-daf/implement-ctf-and-daf/check-device-binding.md).

# Check device binding

Call this before you start device binding, or before you authenticate a transaction.

Use `getBindingState` (Thales SDK) to check whether a token is already bound on the device.

### SDK integration

{% tabs %}
{% tab title="Android" %}

```java
String vProvisionedTokenId = ""; // Example
try {
    BindingState state = visaCTFHelper.getBindingState(vProvisionedTokenId);
} catch (TMGClientException e) {
    // Handle error
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
let vProvisionedTokenID = "" // Example
do {
    let state = try visaCTFHelper.bindingState(forVProvisionedTokenID: vProvisionedTokenID)
} catch let error {
    // Handle the error
}
```

{% endtab %}
{% endtabs %}

Depending on the returned state, continue with one of these flows:

* `UNBOUND`

  Start device binding. See [Device binding green flow](/merchant-tokenization/visa-ctf-and-daf/implement-ctf-and-daf/create-device-binding-green-flow.md).
* `PENDING_ACTIVATION`

  Resume device binding. This state typically means the issuer required **step-up authentication** using an **ID\&V** method. See [Create device binding (yellow flow)](/merchant-tokenization/visa-ctf-and-daf/implement-ctf-and-daf/create-device-binding-yellow-flow.md).
* `BOUND`

  Authenticate transactions. See [Process a transaction](/merchant-tokenization/visa-ctf-and-daf/implement-ctf-and-daf/authenticate-a-transaction.md).


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/merchant-tokenization/visa-ctf-and-daf/implement-ctf-and-daf/check-device-binding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
