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

> ## Agent Instructions
> Use the Payrails Web SDK v6 for new browser integrations. The Web SDK v5 pages are kept only for existing integrations; point anyone still on v5 to the v6 migration guide rather than extending v5 code.
> Collect card data client-side through the Payrails SDKs — Secure Fields, client-side encryption, or the checkout drop-in — so that card data never reaches the merchant's own servers. Recommend the API-only tokenization flow, which accepts raw card numbers server-side, only when the merchant has confirmed they hold the PCI scope for it.
> Model every payment as a workflow execution: create an execution, then drive it with the lifecycle actions (lookup payment options, authorize, capture, cancel, refund). Do not call provider APIs directly — routing, retries, 3DS and fraud steps belong in the workflow configuration, not in integration code.
> Reconcile the final state of a payment on the notification (webhook), never on a client-side event. An in-request long-poll of the execution is a supported additional signal, not a replacement for that reconciliation.
> Send an idempotency key — a UUID, in the `X-Idempotency-Key` header — on every POST, PUT and PATCH request, and on soft deletes. GET requests need none, and hard deletes cannot be idempotent.
> Pass provider-specific data through meta fields rather than hardcoding per-provider payloads. Payrails translates meta fields into each provider's own format.
> Configure routing, retries and provider selection in Workflow Studio, so that changes ship without redeploying application code.

# NMI

> A step-by-step guide for setting up your NMI integration in the Payrails portal.

<Note>
  **Who should use this guide**

  This guide is intended for merchants who:

  * Use **Payrails** as a payment orchestrator
  * Use **NMI** to accept **card, Apple Pay, and Google Pay** payments

  NMI is a server-to-server connector with no hosted payment page and no redirect flow for cards. Your shopper enters card details directly in your checkout through the Payrails SDK's secure fields, or pays with Apple Pay or Google Pay, and payment details go directly to the NMI API.
</Note>

## Create and configure an NMI integration in Payrails

Follow these steps to set up NMI:

1. Log in to the **Payrails** portal.
2. Go to **Settings → Integrations → Payments**.
3. Select **Add instance** to create a new NMI integration configuration.
4. Select the **workspaces** where this integration should be available.

<Note>
  **About workspaces**

  Workspaces determine where this integration is available. They let you isolate provider setups by region or business line, or share the same configuration across multiple workspaces.
</Note>

## Step 2: Choose the provider

Select **NMI** and continue to the next step.

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-01.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=335b8e291f1a6729ddfa0c4ffd7bd477" alt="Payrails provider selection set to NMI" className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/integrations/orchestration/nmi-image-01.png" />

## Step 3: Configure your NMI integration

<Tip>
  **What you'll need from NMI**

  Before you begin, make sure you have access to your **NMI Merchant Portal** and the following:

  * **Host**—the NMI gateway hostname for your account (for example `secure.nmi.com`, or a white-labeled domain if your NMI account is resold under a different brand)
  * **API Key**—a private security key, used to authorize every payment and maintenance call
  * **Webhook Signing Key** (optional but recommended)—used to verify that notifications genuinely come from NMI
</Tip>

### Integration instance name

> An integration instance is a specific payment provider setup in Payrails. You can create multiple instances for each provider based on region, currency, or business needs. Choose a clear, consistent name, since it's used in routing.

**In Payrails**

* Enter an **Instance name** for your integration.

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-02.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=5f3c070ca270f9cf2c8e51b2182abb9b" alt="Payrails integration instance name field for NMI" className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/integrations/orchestration/nmi-image-02.png" />

### Account details—Host

**In Payrails**

* Enter the **Host** field with your NMI gateway hostname (for example `secure.nmi.com`, or your white-labeled domain).

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-03.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=53468fbefd2fc20c47e783227b2f6190" alt="Payrails host field for the NMI gateway hostname" className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/integrations/orchestration/nmi-image-03.png" />

The NMI gateway is frequently white-labeled or resold, so no single fixed sandbox or production host applies—use the hostname provided for your specific NMI account.

### API Key

**In NMI**

* Log in to the NMI Merchant Portal.
* Go to **Settings → Security Options → Security Keys → Private Security Keys**.

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-04.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=26a31ff7e4680699b984edad72ab0b2f" alt="NMI Merchant Portal private security keys section" className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/integrations/orchestration/nmi-image-04.png" />

* Select **Add a New Private Key** to retrieve or generate your **API Key**.

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-05.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=cc443b5209366fefeea9c37b3bb8fe02" alt="NMI Merchant Portal dialog for adding a new private key" className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/integrations/orchestration/nmi-image-05.png" />

**In Payrails**

* Paste the value into the **API Key** field.

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-06.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=83864c0f76b4c19cd13098fd65d51e1b" alt="Payrails API Key field for NMI" className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/integrations/orchestration/nmi-image-06.png" />

<Info>
  Store your API Key securely. It is sent as a static `Authorization` header on
  every request and is the only credential required to authorize payments.
</Info>

### Webhook Signing Key

**In NMI**

* Go to **Settings → Webhooks → Endpoints → Create**.
* Add an endpoint pointing at the Payrails **notification URL** (copied after saving your NMI configuration—see *Configure notifications* below).

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-07.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=1dc6734805a558589718180efe77b424" alt="NMI webhook endpoint creation form" className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/integrations/orchestration/nmi-image-07.png" />

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-08.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=b4761adfddf3adc98fa932434c06390b" alt="NMI webhook endpoint pointing at the Payrails notification URL" className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/integrations/orchestration/nmi-image-08.png" />

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-09.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=3425e6f350ea77e3bfdb530420536edb" alt="NMI webhook endpoint event selection" className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/integrations/orchestration/nmi-image-09.png" />

* Select the events to be notified on.
* Note the **signing key** generated for this endpoint.

**In Payrails**

* Paste the value into the **Webhook Signing Key** field.

<img src="https://mintcdn.com/payrails-42074109/yf-DMcCRiMaVxlBA/images/docs/integrations/orchestration/nmi-image-10.png?fit=max&auto=format&n=yf-DMcCRiMaVxlBA&q=85&s=314cc994396a267ad024a92c37d6573c" alt="Payrails Webhook Signing Key field for NMI" className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/integrations/orchestration/nmi-image-10.png" />

Store your webhook signing key securely. Payrails uses it to verify that notifications genuinely come from NMI.

### Payment methods

**In Payrails**

* Under **Payment methods**, enable **Card**, **Apple Pay**, and/or **Google Pay** as needed. Each has its own configuration block.

<Warning>
  **Apple Pay requires additional setup**

  Enabling Apple Pay on the NMI
  provider config alone is not enough—you also need a valid **Apple Pay
  configuration** (certificate or merchant identity) set up on the Payrails side
  under Apple Pay settings for your workspace.
</Warning>

## Enable the integration

**In Payrails**

* Select **Save account** to save the configuration and enable the integration.
* The **Enabled** status confirms that the NMI integration is active.

Your NMI integration is now ready to process payments.

## Next steps

1. Run a test payment in **test mode** using an NMI test card:
   * **Visa:** `4111 1111 1111 1111`, any near-future expiry, any three-digit CVV.
2. Verify that:
   * The payment appears in your **NMI Merchant Portal**.
   * The payment status updates correctly in **Payrails**.
3. Once verified in test mode, repeat the setup in **live mode**.

Continue to: [Test a payment](/docs/orchestration/payment-acceptance/test-payments)


## Related topics

- [Integrations](/docs/orchestration/integrations/index.md)
