> For the complete documentation index, see [llms.txt](https://docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verifone.com/api-reference/open-api-references/3d-secure/jwt.md).

# JWT

The **JWT endpoints** handle the authentication handshake between your server and the 3DS Client SDK. JWT Create produces a signed token the SDK uses to initialise the 3DS session; JWT Validate decodes the token returned by the SDK after cardholder authentication and provides the final authentication outcome.

{% stepper %}
{% step %}

### Step 1 — Create a JWT

The JWT Create endpoint produces a signed JSON Web Token used as the initial authentication handshake with the 3DS Client SDK. Pass this token to the SDK on page load before initiating the Lookup flow.

{% hint style="info" %}
The `jwt` value returned by this endpoint should be passed to `Cardinal.setup()` (or the equivalent SDK initialisation call) as the session token. The `device_info_id` returned here should be included in the subsequent [Lookup](/api-reference/open-api-references/3d-secure/lookup.md) request.
{% endhint %}
{% endstep %}

{% step %}

### Step 2 — Validate a JWT

After the cardholder completes the 3DS authentication (frictionless or challenge), the 3DS Client SDK returns a signed JWT. Pass this JWT to the Validate endpoint to decode the result and retrieve the authentication outcome.

{% hint style="danger" %}
The `authentication_id` in the JWT Validate response must match the `authentication_id` from your original [Lookup](/api-reference/open-api-references/3d-secure/lookup.md) response. Store the Lookup `authentication_id` before calling Validate and verify the values match before proceeding to authorization.
{% endhint %}
{% endstep %}
{% endstepper %}

## JWT Validate Response Fields

```
JwtValidateResponse
  ├── authentication_id   ← Match against Lookup response — required for authorization
  ├── action_code         ← Resulting state of the transaction
  ├── error_no            ← 0 = no error; non-zero = error encountered
  ├── error_desc          ← Human-readable error description (comma-separated if multiple)
  └── validation_result   ← Full authentication result object
```

{% hint style="warning" %}
A non-zero `error_no` indicates an error during JWT processing. Multiple errors are returned as comma-separated values in `error_no` and `error_desc`. Do not proceed to authorization if `error_no` is non-zero.
{% endhint %}

## Full Flow Summary

{% columns %}
{% column %}

#### JWT Create (Step 1)

1. Call `POST /v2/jwt/create` from your server
2. Pass the returned `jwt` to the 3DS Client SDK
3. Store the `device_info_id` for the Lookup request
4. SDK initialises the 3DS session
   {% endcolumn %}

{% column %}

#### JWT Validate (Step 2)

1. SDK returns a JWT after cardholder authentication
2. Call `POST /v2/jwt/validate` with that JWT
3. Verify `authentication_id` matches Lookup
4. Use `action_code` and `validation_result` to complete authorization
   {% endcolumn %}
   {% endcolumns %}


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.verifone.com/api-reference/open-api-references/3d-secure/jwt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
