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

# Network Tokenization API Testing

Ensure your integration with the Network Tokenization API works correctly by simulating network tokenization in Test Mode.

## Step 1: Create a Pagos Account or Sign In

If you’re interested in Network Tokenization, you can try it out in [Test Mode](/getting-started/managing-your-pagos-account#test-mode). [Sign up](https://secure.pagos.ai/sign-up) for a Pagos account or log into your existing account, then click the environment toggle in the top-right corner; a yellow bar will appear across the top of the Pagos Service Panel to confirm you're in Test Mode.

## Step 2: Generate Your Test Mode API Key

In Test Mode, generate an API Key for the Network Tokenization API.

<Note>
  These API Keys are universal across Test Mode and will be used for testing all Pagos API products. If you've already created an API key in Test Mode, you don't need to create a new one.
</Note>

To generate your API key:

<Steps>
  <Step>
    Click your **settings** icon in the top-right corner of your Pagos Service Panel.
  </Step>

  <Step>
    Under **Developers**, click **API Keys**.
  </Step>

  <Step>
    In the **API Keys** tab, click **Create API Key** to add a new key to your account.
  </Step>

  <Step>
    In the side panel that opens, set your **Key Name**, then click **Create API Key**.
  </Step>

  <Step>
    Copy your new API Key and store it somewhere secure.

    <Warning>
      This is the only time you can view this key!
    </Warning>
  </Step>

  <Step>
    Click **I've Copied My Keys** to confirm and exit the side panel.
  </Step>
</Steps>

## Step 3: Test Provisioning a Network Token

Use our [test PANs](#test-pans) to test [provisioning a network token](/network-tokenization/overview#provisioning-a-network-token) in Test Mode.

## Step 4: Test Transacting With a Token

You can test [fetching a cryptogram](/network-tokenization/overview#transacting-with-a-network-token) on the `tokenRefId` returned for a card you successfully [tokenized](#step-3-test-provisioning-a-network-token).

<CodeGroup>
  ```json Visa theme={null}
  {
      "cryptogram": "eY1KRnm18Uawh78qUjzWeQ==",
      "token": "4552981839633026",
      "eci": "07",
      "metadata": null,
      "expirationDate": {
          "year": "2026",
          "month": "06"
      }
  }
  ```

  ```json Mastercard theme={null}
  {
      "cryptogram": "1e3d2cb6a1c0764e626c8d6b2064d8be",
      "token": "5417386472048957",
      "eci": null,
      "metadata": null,
      "expirationDate": {
          "year": "2026",
          "month": "06"
      }
  }
  ```
</CodeGroup>

## Step 5: Test Requesting Account Data

You can test [requesting account data](/network-tokenization/overview#requesting-account-data) on the `tokenRefId` returned for a card you successfully [tokenized](#step-3-test-provisioning-a-network-token). The response for your /account call will include a `cardArt` array containing URLs to the card image file(s).

<Warning>
  Discover cards don't support card art at this time.
</Warning>

<CodeGroup>
  ```json Visa theme={null}
  {
      "cardNetworkName": "visa",
      "tokenAccount": {
          "last4": "0002",
          "expirationDate": {
              "month": "06",
              "year": "2026"
          },
          "par": "V2831416512995186306443704057"
      },
      "backgroundColor": "0xffffff",
      "foregroundColor": "0x000000",
      "labelColor": null,
      "contactName": null,
      "contactWebsite": null,
      "contactEmail": null,
      "contactNumber": null,
      "termsAndConditionsUrl": null,
      "privacyPolicyUrl": null,
      "shortDescription": "Test Visa Dark Card",
      "longDescription": null,
      "cardArt": [
          {
              "url": "https://assets.sandbox.pagos.ai/card-art/visa/522e753f-3873-4cb7-90ae-18a458dcfc6f.png",
              "description": null,
              "height": 100,
              "width": 100,
              "type": "icon"
          },
          {
              "url": "https://assets.sandbox.pagos.ai/card-art/visa/b58c78b7-32a6-4e87-80e2-b3a3b0c12a91.png",
              "description": null,
              "height": 969,
              "width": 1536,
              "type": "card_art"
          }
      ],
      "metadata": null,
      "assetStatus": "available"
  }
  ```

  ```json Mastercard theme={null}
  {
      "cardNetworkName": "mastercard",
      "tokenAccount": {
          "last4": "0008",
          "expirationDate": {
              "month": "06",
              "year": "2026"
          },
          "par": "77021d971bb3a13f8e806b8907d71232"
      },
      "backgroundColor": null,
      "foregroundColor": "0x000000",
      "labelColor": null,
      "contactName": null,
      "contactWebsite": null,
      "contactEmail": null,
      "contactNumber": null,
      "termsAndConditionsUrl": null,
      "privacyPolicyUrl": null,
      "shortDescription": "Test Mastercard Dark Card",
      "longDescription": "Test Mastercard Dark Card For Simulation",
      "cardArt": [
          {
              "url": "https://sbx.assets.mastercard.com/card-art/combined-image-asset/5f21f08e-0490-4603-bcd1-ac0be7ea0ecd.png",
              "description": null,
              "height": null,
              "width": null,
              "type": "card_art"
          }
      ],
      "metadata": null,
      "assetStatus": "available"
  }
  ```
</CodeGroup>

## Step 6: Test Requesting the Status of a Token

You can test [requesting a token’s status](/network-tokenization/overview#getting-the-status-of-a-network-token) using the `tokenRefId` returned for a card you successfully [tokenized](#step-3-test-provisioning-a-network-token). The response for your /status call will include random `year` and `month` values, following the examples below:

```json theme={null}
{
    "tokenRefId": "visa-8e9c3493ce9a2e299b7242b43254b625",
    "expirationDate": {
        "year": "2024",
        "month": "09"
    },
    "status": "active",
    "cardNetworkName": "visa",
    "panLast4": "1100"
}
```

## Step 7: Test Token Status Changes

<Note>
  Network Tokenization Test Mode is stateful, meaning all token status actions will persist for the life of a token.
</Note>

Use the `tokenRefId` returned for a card you successfully [tokenized](#step-3-test-provisioning-a-network-token) to test the following status changes:

* [Suspending a token](/network-tokenization/overview#suspending-a-token)
* [Resuming a suspended token](/network-tokenization/overview#resuming-a-suspended-token)
* [Deleting a token](/network-tokenization/overview#deleting-a-token)

## Test PANs

All test PANs will pass Luhn verification checks.

| VISA TEST PAN      | PROVISIONING RESPONSE  |
| :----------------- | :--------------------- |
| `4000000000000002` | Success                |
| `4000000000000010` | ProvisionDataExpired   |
| `4000000000000028` | CardVerificationFailed |
| `4000000000000036` | CardNotEligible        |
| `4000000000000044` | CardNotAllowed         |
| `4000000000000051` | CardDeclined           |
| `4000000000000069` | ProvisionNotAllowed    |
| `4000000000000077` | InvalidTokenStatus     |
| `4000000000000085` | Success                |
| `4000000000000093` | Success                |

| MASTERCARD TEST PAN | PROVISIONING RESPONSE |
| :------------------ | :-------------------- |
| `5100000000000008`  | Success               |
| `5100000000000024`  | CardNotEligible       |
| `5100000000000032`  | IssuerDeclined        |
| `5100000000000040`  | InvalidInput          |
| `5100000000000057`  | InvalidInput          |
| `5100000000000065`  | Success               |
| `5100000000000073`  | Success               |

| DISCOVER TEST PAN  | PROVISIONING RESPONSE  |
| :----------------- | :--------------------- |
| `6011000000000004` | Success                |
| `6011000000000012` | ProvisionDataExpired   |
| `6011000000000020` | CardVerificationFailed |
| `6011000000000038` | CardNotEligible        |
| `6011000000000046` | CardNotAllowed         |
| `6011000000000053` | CardDeclined           |
| `6011000000000061` | ProvisionNotAllowed    |

| AMEX TEST PAN     | PROVISIONING RESPONSE  |
| :---------------- | :--------------------- |
| `370000000000002` | Success                |
| `370000000000010` | CardMarketNotSupported |
| `370000000000028` | CardNotEligible        |
| `370000000000036` | CardCannotBeTokenized  |
| `370000000000044` | IssuerNotSupported     |
| `370000000000051` | CardCancelled          |
| `370000000000069` | Success                |
| `370000000000077` | Success                |
