> 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/nmi.md).

# NMI

In this step you will first use a special Paytram **Flow** to convert your API key and PIN into a special encoded format for use with Paytram, create an **External credentials**,  and  create a **Named credential.**

{% 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&#x20;

• an API&#x20;

• a separate tokenization key \
\
copy these these to a separate document so you can reference them in a later step.

### External Credentials

**Navigate  to the External Credential tab.**

1. Click **New**.
2. Enter the following values:
3. 1. Label and Name: **nmiExternal**
   2. sequence number = **1**&#x20;
   3. Authentication Protocol: **Custom**
4. Create a new **Principal** for this external credential
   1. Parameter name = **keys**
   2. Add 2 parameters
      1. &#x20;**apiKey** = your NMI api key
      2. **tokenizationKey** = your NMI tokenization key
5. Click Save.&#x20;

### Named Credentials<br>

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: ‘**usaepay**’.
   2. URL field:
      1. Depends on whether you are accessing the Production Enviroment of the Gateway, or the Sandbox enviroment:
         1. Production: <https://secure.nmi.com/api/v5/>
         2. Sandbox: <https://sandbox.nmi.com/api/v5/>
   3. Enabled for Callouts: true.
   4. For the External Credential, select the ‘nmiExternal’ credential you previously created.
   5. Select all Callout Options.
   6. Allowed Namespaces for Callouts: ‘**paytram**’.<br>

      <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeV8D1qw10SCltHdptHLZ1mbB398zPtqrKBOxoFv8KqKMTppIRP-QuJJIu7DrLLAqdubpsBgQzaoZCLEwh9jOFcqF_N97iSSYafk5zV6gKEjFXO1ECc69gX8S0K4bHjeXr3r-2Ys158eLVepvblv6c?key=esorVVMR3D62PAiYn8TVv7VL" alt=""><figcaption></figcaption></figure>
3. Click Save.&#x20;
4. In the newly created Named credential record, scroll down to the Custom Headers section and click New.<br>
5. Complete the following field values:
6. 1. Name: <sup>**Authorization**</sup>
   2. Value: Paste the following **{!$Credential.nmiExternal.apiKey}**
   3. Sequence Number: 1
7. Click Save.

Create a 2nd named credential

In the Named Credentials tab:

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

      <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeV8D1qw10SCltHdptHLZ1mbB398zPtqrKBOxoFv8KqKMTppIRP-QuJJIu7DrLLAqdubpsBgQzaoZCLEwh9jOFcqF_N97iSSYafk5zV6gKEjFXO1ECc69gX8S0K4bHjeXr3r-2Ys158eLVepvblv6c?key=esorVVMR3D62PAiYn8TVv7VL" alt=""><figcaption></figcaption></figure>
3. Click Save.&#x20;

## Permissions

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