> For the complete documentation index, see [llms.txt](https://fast-track-digital.gitbook.io/paytram-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fast-track-digital.gitbook.io/paytram-documentation/initial-setup/cardknox.md).

# Cardknox

In this step you will  create one **External credentials**, and  create three Named credentials.

{% hint style="warning" %}
Important: When creating your credentials, use the exact spelling and capitalization indicated and follow the credential creation and Flow run in order.
{% endhint %}

## Retrieve or create your API keys from the Gateway

You will need 2 keys. Copy these to a separate document so you can reference them in a later step.

* An Ifields Key Key (you will use this key as is)
* An API Key

<figure><img src="/files/ZHi7SDdnYf2ZawKRbOBK" alt=""><figcaption></figcaption></figure>

### External Credentials

To create the first credential:

1. Navigate to Setup > Named Credentials.
2. Click the External Credentials tab.
3. Click New.
4. Enter the following values:
5. Label and Name: cardknoxExternal
6. Authentication Protocol: Custom
7. Click Save.&#x20;
8. In the credential record, scroll down to locate the Principals section and click New to create a new Principal record.<br>

   <figure><img src="/files/C2aF9VNg8WwamtEahv41" alt=""><figcaption></figcaption></figure>

Add the following values:

1. Parameter name: keys
2. Sequence Number: 1
3. Add New Authentication Parameter
   1. Name: ifields
   2. Value:  your ifield API key
4. Add a second New Parameter

   1. Name: key
   2. value: your API key

   <figure><img src="/files/Pa6K9MbEjz27ID3Vl6ux" alt=""><figcaption></figcaption></figure>
5. Click Save.<br>

### Named Credentials

From Setup, navigate to Named Credentials.&#x20;

In the Named Credentials tab:

1. Click New and complete the following field values:
2. 1. Label and Name: ‘cardknoxPaytram’.
   2. URL field: <https://gateway.paytram.io/>
   3. Enabled for Callouts: true.
   4. For the External Credential, select the ‘cardknoxExternal’ credential you previously created.
   5. Select all Callout Options.
   6. Allowed Namespaces for Callouts: ‘paytram’.<br>

      <figure><img src="/files/2QUDB8OT0qlLPZTbkUlP" alt=""><figcaption></figcaption></figure>
3. Click Save.&#x20;

#### Now create the second Named credential.&#x20;

1. Click New and complete the following field values:
2.

```
1. Label and Name: ‘cardknoxV2’.
```

```
2. URL field: https://api.cardknox.com/v2
3. Enabled for Callouts: true.
4. For the External Credential, select the ‘cardknoxExternal’ credential you previously created.
5. Select all Callout Options.
6. Allowed Namespaces for Callouts: ‘paytram’.

<br>

<figure><img src="/files/xvz8l2vdphCfViQwG7Oh" alt=""><figcaption></figcaption></figure>
```

3\. Click Save.&#x20;

#### Now create the third Named credential.&#x20;

1. Click New and complete the following field values:
2.

```
1. Label and Name: ‘cardknoxV1’.
```

```
2. URL field: https://x1.cardknox.com/
3. Enabled for Callouts: true.
4. For the External Credential, select the ‘cardknoxExternal’ credential you previously created.
5. Select all Callout Options.
6. Allowed Namespaces for Callouts: ‘paytram’.

<br>

<figure><img src="/files/S8cz6BsRp7G4oY1vk9RS" alt=""><figcaption></figcaption></figure>
```

3\. Click Save.&#x20;

## Adjust Session Settings

Navigate to Setup > Session Settings and ensure the the 'Use Lightning Web Security for Lighning web components and Aura components' is checked. Click Save.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfLHSYbobZZH-HkzQtARXznv6Isih6SHXp3TA-L83HcxrcZJb3lcyMuOzDA5NMDT13o0TLOAA-B6Er-dpOPxwEfs_jWT8AQkSwJFdEkjGx0Zwcsv5hd8eNGDkl-5Y6JUmKYB62bQ1-NasQ9tSfG9SRAlRqq?key=rwnBD_Kw1Bk1n8yZFuCJcQ" alt=""><figcaption></figcaption></figure>

## Permissions

Continue to set [permissions](/paytram-documentation/initial-setup/permissions-all-gateways.md)&#x20;
