> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Token Provision Schema

> Schema reference for the `TOKEN_PROVISION_RT` event type used by Marqeta's Real-Time Decisioning integration with the token provisioning flow.

Real-Time Decisioning (RTD) references a JSON object called derived type in an `eventType` attribute.
A derived type object typically corresponds to a bundle of information, such as an address or provisioning data.
The following tables describe the derived types used by RTD.

Every provisioning processed by RTD is classified as an event.
For example, provisioning a card is classified as a `TOKEN_PROVISION_RT` event.

The following sections describe the derived types for the `TOKEN_PROVISION_RT` event.

## Prerequisites

This feature requires additional activation steps.
To activate it for your program, contact your Marqeta representative.

## TOKEN\_PROVISION\_RT

The following fields make up the `TOKEN_PROVISION_RT` schema.

| Attribute                                                       | Description                                                                                                                                                                                                                            |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tokenmanager\_event\_type<br /><br />string<br /><br />Required | The specific provisioning step that generated this event.<br /><br />**Expected values:**<br />`CHECK_ELIGIBILITY`, `TOKEN_ACTIVATION`                                                                                                 |
| created\_time<br /><br />string<br /><br />Required             | Timestamp of when the event was created, in UTC.<br /><br />**Format:**<br />yyyy-MM-ddThh:mm:ssZ                                                                                                                                      |
| program\_short\_code<br /><br />string<br /><br />Required      | The program's short code identifier.<br /><br />**Format:**<br />2-8 chars                                                                                                                                                             |
| network<br /><br />string<br /><br />Required                   | The card network through which the provisioning request was received.<br /><br />**Expected values:**<br />`VISA`, `MASTERCARD`                                                                                                        |
| device\_data<br /><br />object<br /><br />Optional              | Device information provided by the card network.<br /><br />**Schema:**<br />`device_data`<br /><br />**Expected values:**<br />See the <a href="#device_data">device\_data</a> object.                                                |
| decisioning\_data<br /><br />object<br /><br />Required         | The Marqeta platform's decision about the provisioning request.<br /><br />**Schema:**<br />`decisioning_data`<br /><br />**Expected values:**<br />See the <a href="#decisioning_data">decisioning\_data</a> object.                  |
| token\_requestor\_data<br /><br />object<br /><br />Required    | Information about the entity requesting the token.<br /><br />**Schema:**<br />`token_requestor_data`<br /><br />**Expected values:**<br />See the <a href="#token_requestor_data">token\_requestor\_data</a> object.                  |
| card\_data<br /><br />object<br /><br />Required                | Card information associated with the provisioning request.<br /><br />**Schema:**<br />`card_data`<br /><br />**Expected values:**<br />See the <a href="#card_data">card\_data</a> object.                                            |
| user\_data<br /><br />object<br /><br />Optional                | Cardholder information.<br /><br />**Schema:**<br />`user_data`<br /><br />**Expected values:**<br />See the <a href="#user_data">user\_data</a> object.                                                                               |
| token\_data<br /><br />object<br /><br />Required               | Token identifiers from the card network.<br /><br />**Schema:**<br />`token_data`<br /><br />**Expected values:**<br />See the <a href="#token_data">token\_data</a> object.                                                           |
| transaction\_data<br /><br />object<br /><br />Required         | Authorization verification results from the token activation request.<br /><br />**Schema:**<br />`transaction_data`<br /><br />**Expected values:**<br />See the <a href="#transaction_data">transaction\_data</a> object.            |
| wallet\_provider\_data<br /><br />object<br /><br />Required    | Information about the wallet provider and how the PAN was supplied.<br /><br />**Schema:**<br />`wallet_provider_data`<br /><br />**Expected values:**<br />See the <a href="#wallet_provider_data">wallet\_provider\_data</a> object. |

### device\_data

Device information provided by the card network.
Available for both `CHECK_ELIGIBILITY` and `TOKEN_ACTIVATION` events, though fields may be null depending on what the network supplies.

| Attribute                                                 | Description                                                                                                                                                                                                                                                                                      |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id<br /><br />string<br /><br />Optional                  | Device identifier provided by the network.<br /><br />**Format:**<br />1-50 chars                                                                                                                                                                                                                |
| device\_type<br /><br />string<br /><br />Optional        | Type of device used in the provisioning request.<br /><br />**Expected values:**<br />`UNKNOWN`, `MOBILE_PHONE`, `TABLET`, `WATCH`, `MOBILE_PHONE_OR_TABLET`, `PERSONAL_COMPUTER`, `LAPTOP`, `APPLIANCE`, `VEHICLE`, `GAMING_DEVICE`, `HOUSEHOLD_DEVICE`, `WEARABLE_DEVICE`, `AUTOMOBILE_DEVICE` |
| device\_name<br /><br />string<br /><br />Optional        | Name of the device.<br /><br />**Format:**<br />1-50 chars                                                                                                                                                                                                                                       |
| device\_number<br /><br />string<br /><br />Optional      | Device number provided by the network.<br /><br />**Format:**<br />1-36 chars                                                                                                                                                                                                                    |
| device\_location<br /><br />string<br /><br />Optional    | Device location coordinates provided by the network.<br /><br />**Example:** `0/0`                                                                                                                                                                                                               |
| device\_ip\_address<br /><br />string<br /><br />Optional | IP address of the device.<br /><br />**Format:**<br />1-50 chars                                                                                                                                                                                                                                 |

### decisioning\_data

The Marqeta platform's decision about the provisioning request that was evaluated before RTD is consulted.

| Attribute                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| decision<br /><br />string<br /><br />Required     | Whether the Marqeta platform approved or declined the provisioning request.<br /><br />**Expected values:**<br />`APPROVED`, `DECLINED`                                                                                                                                                                                                                                                                     |
| reason\_code<br /><br />string<br /><br />Optional | The reason code from the Marqeta platform's evaluation.<br /><br />For `CHECK_ELIGIBILITY` events, approved requests use `0000` and declined requests use error codes specific to the Marqeta platform.<br />For `TOKEN_ACTIVATION` events, the value comes from the transaction log reason code.<br /><br />**Expected values:**<br />See [Marqeta platform reason codes](#decisioning-data-reason-codes). |

#### decisioning\_data reason codes

The following table lists possible reason codes returned in the `reason_code` field of the `decisioning_data` object with their meaning.

| Code                       | Meaning                                                   |
| -------------------------- | --------------------------------------------------------- |
| `0000`                     | Approved                                                  |
| `card.not.found`           | PAN not found in Marqeta system                           |
| `card.expiration.mismatch` | Expiry date does not match                                |
| `card.terminated`          | Card is terminated                                        |
| `cardholder.not.active`    | Cardholder is not active                                  |
| `cardaccount.verified`     | Card account verified (token activation request approved) |

### token\_requestor\_data

Information about the entity requesting the token, such as a merchant or digital wallet provider.

| Attribute                                  | Description                                                                                           |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| id<br /><br />string<br /><br />Required   | The token requestor ID assigned by the card network.<br /><br />**Format:**<br />1-11 chars           |
| name<br /><br />string<br /><br />Optional | Human-readable name of the token requestor, when available.<br /><br />**Format:**<br />255 chars max |

### card\_data

Card information associated with the provisioning request.

When the Marqeta platform cannot find a matching card (`card.not.found`), the `card_token`, `card_product_token`, `card_product_active`, and `card_state` fields will be null.
The `bin` and `last_four` fields are derived from the PAN provided in the network request and are always present.

| Attribute                                                   | Description                                                                                                                                                                                 |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| pan\_reference\_id<br /><br />string<br /><br />Required    | The network's PAN reference identifier.<br /><br />**Format:**<br />1-32 chars                                                                                                              |
| bin<br /><br />string<br /><br />Required                   | The bank identification number (BIN) — first six digits of the PAN.<br /><br />Always present, even when the card is not found.<br /><br />**Format:**<br />6 digits                        |
| last\_four<br /><br />string<br /><br />Required            | Last four digits of the PAN.<br /><br />Always present, even when the card is not found.<br /><br />**Format:**<br />4 digits                                                               |
| card\_token<br /><br />string<br /><br />Optional           | The Marqeta card token.<br /><br />Null when the card is not found.<br /><br />**Format:**<br />1-36 chars                                                                                  |
| card\_product\_token<br /><br />string<br /><br />Optional  | The Marqeta card product token.<br /><br />Null when the card is not found.<br /><br />**Format:**<br />1-36 chars                                                                          |
| card\_product\_active<br /><br />string<br /><br />Optional | Indicates whether the card product is active.<br /><br />Sent as a string `"true"` or `"false"`.<br />Null when the card is not found.<br /><br />**Expected values:**<br />`true`, `false` |
| card\_state<br /><br />string<br /><br />Optional           | The current state of the card.<br /><br />Null when the card is not found.<br /><br />**Expected values:**<br />`ACTIVE`, `SUSPENDED`, `TERMINATED`, `UNACTIVATED`                          |

### user\_data

The following table lists cardholder information.
Fields are null when the card is not found (`card.not.found`).

| Attribute                                         | Description                                                                                                                   |
| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| user\_token<br /><br />string<br /><br />Optional | The Marqeta user token for the cardholder.<br /><br />Null when the card is not found.<br /><br />**Format:**<br />1-36 chars |

### token\_data

Token identifiers from the card network.

| Attribute                                                  | Description                                                                                                                                                                                                                     |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token\_reference\_id<br /><br />string<br /><br />Required | The network's token reference identifier.<br /><br />**Format:**<br />1-32 chars                                                                                                                                                |
| correlation\_id<br /><br />string<br /><br />Optional      | Correlation identifier for the provisioning request.<br /><br />Always null for Visa.<br />Always populated for Mastercard — used to correlate provisioning events across the MDES flow.<br /><br />**Format:**<br />1-32 chars |

### transaction\_data

Authorization verification results from the token activation request.

For `CHECK_ELIGIBILITY` events, both fields are null.
For `TOKEN_ACTIVATION` events, the fields reflect Address Verification System (AVS) and Card Verification Value 2 (CVV2) results from the token activation.

| Attribute                                        | Description                                                                                                                                                 |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| avs\_code<br /><br />string<br /><br />Optional  | AVS result code.<br /><br />Only populated for `TOKEN_ACTIVATION` events.<br /><br />**Expected values:**<br />See [AVS codes](#avs-codes).                 |
| cvv2\_code<br /><br />string<br /><br />Optional | CVV2 verification result code.<br /><br />Only populated for `TOKEN_ACTIVATION` events.<br /><br />**Expected values:**<br />See [CVV2 codes](#cvv2-codes). |

#### AVS codes

The following table lists possible AVS codes returned in the `avs_code` field of the `transaction_data` object with their meaning.

| Code   | Meaning                                      |
| ------ | -------------------------------------------- |
| `0000` | Address and ZIP code match                   |
| `0001` | Address matches, ZIP code does not           |
| `0100` | Address does not match, ZIP code matches     |
| `0101` | Neither address nor ZIP code match           |
| `0200` | Address not present, ZIP code matches        |
| `0201` | Address not present, ZIP code does not match |
| `0002` | Address and ZIP code not present             |
| `0102` | Address does not match, ZIP code not present |
| `null` | AVS verification participant never reached   |

#### CVV2 codes

The following is a list of possible CVV2 codes returned in the `cvv2_code` field of the `transaction_data` object with their meaning.

| Code   | Meaning                                     |
| ------ | ------------------------------------------- |
| `0000` | CVV2 match                                  |
| `N7`   | CVV2 mismatch                               |
| `null` | CVV2 verification participant never reached |

### wallet\_provider\_data

Information about the wallet provider and how the PAN was supplied.

| Attribute                                         | Description                                                                                                                                            |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| pan\_source<br /><br />string<br /><br />Required | How the PAN was provided for this provisioning request.<br /><br />**Expected values:**<br />See [PAN source values](#pan-source-values).              |
| wallet\_id<br /><br />string<br /><br />Optional  | Wallet identifier provided by the network.<br /><br />May be null, particularly for `CHECK_ELIGIBILITY` events.<br /><br />**Format:**<br />1-32 chars |

#### PAN source values

The following table lists possible PAN source values returned in the `pan_source` field of the `wallet_provider_data` object with their meaning.

| Value                | Meaning                                               |
| -------------------- | ----------------------------------------------------- |
| `KEY_ENTERED`        | Cardholder manually entered card data                 |
| `ON_FILE`            | Card was already on file in the wallet                |
| `MOBILE_BANKING_APP` | Card was provisioned via a mobile banking application |


## Related topics

- [Real-Time Decisioning for Token Provisioning](/docs/developer-guides/real-time-decisioning-for-token-provisioning.md)
- [Using Real-Time Decisioning for Token Provisioning](/docs/developer-guides/using-real-time-decisioning-for-token-provisioning.md)
- [RiskControl Schema](/docs/developer-guides/riskcontrol-schema.md)
- [3D Secure Risk Engine Schema](/docs/developer-guides/3ds-risk-engine-schema.md)
- [Provisioning Digital Wallet Tokens](/docs/developer-guides/provisioning-digital-wallet-tokens.md)
