How to Connect NMI to Twilio for Voice & IVR Payments

By Shuttle Team, June 24, 2026

NMI doesn't natively connect to Twilio for voice payments. If you want to process NMI transactions during a phone call (via IVR, agent-assisted, or AI voice agent), you need a Twilio Pay Connector that bridges the two platforms.

Shuttle's Pay Connector does exactly this. It connects NMI (and 30+ other gateways) to Twilio's <Pay> verb, so you can accept PCI-compliant card payments during any voice interaction.

This guide walks through how the integration works, how to set it up, and why it's a particularly good fit for the software platforms, ISVs, and multi-merchant operations that NMI serves.


Why NMI + Twilio Don't Connect Directly

NMI is the gateway behind the gateway. It's a white-label payment platform used by ISVs, ISOs, SaaS companies, and banks to embed payments under their own brand, with hundreds of processor and acquirer integrations underneath. If you're a software platform that resells payments, there's a good chance NMI is somewhere in your stack.

Twilio is built for voice and messaging. Its <Pay> verb captures card details during phone calls via DTMF keypad input, with tones suppressed so agents never hear them.

The problem: Twilio's <Pay> needs a Pay Connector to route captured card data to a payment gateway. NMI isn't one of Twilio's built-in connectors, so there's no native path between the two.

This is where Shuttle comes in. As Twilio's official payment partner, Shuttle provides a Pay Connector that accepts card data from Twilio's <Pay> verb and routes it to NMI's Payment API for processing. One integration connects the two platforms.


How It Works

`` Caller → Twilio (DTMF capture) → Shuttle (Pay Connector) → NMI (processing) → Result ``

  1. Caller reaches payment step. Your Twilio call flow (IVR, Studio, or custom TwiML) triggers the <Pay> verb.

  2. Card details captured via DTMF. The caller enters their card number, expiry, and CVV on the keypad. Tones are suppressed from the agent audio and call recordings.

  3. Shuttle receives card data. The data passes from Twilio's PCI-compliant environment directly to Shuttle's connector. It never touches your servers.

  4. Shuttle charges the card via NMI. The connector submits the transaction to NMI, authenticated with your security key, and handles the response.

  5. Result returned to your call flow. Your webhook receives the NMI transaction reference, last four digits, card brand, and transaction status. The call continues.

The entire flow happens in seconds. The caller stays on the line. No redirects, no "please visit our website."


Step-by-Step Setup

Prerequisites

  • A Twilio account with voice capability

  • An NMI gateway account with a security key (created in the Merchant Portal under Settings, then Security Keys)

  • A Shuttle account (free to create, you pay per transaction)

Step 1: Install Shuttle's Pay Connector

Go to the Twilio Marketplace and install the Shuttle Pay Connector. This adds Shuttle as an available connector in your Twilio account's Pay configuration.

Step 2: Add NMI Credentials to Shuttle

Log into the Shuttle dashboard. Navigate to Payment Profiles and create a new profile:

  • Gateway: NMI

  • Security key: Your NMI API security key (the private, server-side key, not a Collect.js tokenisation key)

  • Currency: Set your default (USD, GBP, EUR, etc.)

  • Environment: Live or Test

Save the profile. Shuttle now has a live connection to your NMI gateway account.

If you're a platform managing multiple merchants, create one payment profile per merchant, each with that merchant's own NMI security key. More on this below.

Step 3: Configure Your Twilio Call Flow

Add the <Pay> verb to your TwiML or Twilio Studio flow:

``xml <Response> <Say>Please enter your card number followed by the hash key.</Say> <Pay paymentConnector="shuttle-pay-connector" chargeAmount="49.99" currency="USD" description="Invoice payment" action="/payment-complete"> </Pay> </Response> ``

Key parameters:

  • paymentConnector: set to shuttle-pay-connector

  • chargeAmount: the amount to charge

  • currency: ISO currency code

  • action: your webhook endpoint for the payment result

Step 4: Handle the Payment Result

Twilio sends a POST to your action URL with the payment result:

``json { "Result": "success", "PaymentCardNumber": "xxxx-xxxx-xxxx-1234", "PaymentCardType": "visa", "PaymentConfirmationCode": "NMI-TRANSACTION-ID-123...", "ProfileId": "your-shuttle-profile-id" } ``

Use the PaymentConfirmationCode to look up the transaction in your NMI Merchant Portal if needed. Update your order, confirm to the caller, and continue the flow.

Step 5: Test

NMI supports test mode on your gateway account (Settings, then Test Mode in the Merchant Portal). While test mode is enabled, valid test cards are approved but no charges are processed. Use NMI's standard Visa test card 4111 1111 1111 1111 to verify the flow end-to-end before going live.


What You Can Do With NMI + Twilio

Charge Immediately

Standard sale transaction. The caller pays, NMI processes through your configured processor, done.

Authorise Now, Capture Later

Place a hold on the card during the call and capture later. Useful for bookings, deposits, or variable-amount transactions where the final figure isn't known at call time.

Tokenise for Future Use

Capture card details once over the phone. Shuttle tokenises the card via NMI's Customer Vault, NMI's secure storage for payment data used in recurring and repeat billing. The token is reusable across any channel: web, mobile, voice, or payment links. The card data is never stored in your systems.

Multi-Merchant Voice Payments for Platforms

This is where NMI + Twilio really fits. NMI's core market is software platforms and ISVs that embed payments for many merchants at once. Shuttle mirrors that model: each sub-merchant's NMI credentials become a separate Shuttle payment profile, and Shuttle routes each call's transaction to the right merchant's gateway account. One Twilio integration, any number of merchants, each settling through their own NMI account.

The same pattern works for BPOs and outsourced contact centres taking payments on behalf of multiple clients.


Multi-PSP: Beyond NMI

One of the key advantages of using Shuttle rather than a single-gateway connector is flexibility. Your Twilio integration stays the same even if you:

  • Add a second gateway: route some merchants through NMI and others through Stripe, Adyen, or a local acquirer

  • **Serve enterprise customers** who mandate a specific PSP (Stripe, Worldpay, Checkout.com, etc.)

  • Need failover: if one gateway has an outage, automatically route to a backup

  • Expand to new markets where a different acquirer gives better authorisation rates

You configure routing rules in Shuttle's dashboard: by merchant, region, amount, or failover. Your Twilio call flow doesn't change. The <Pay> verb always points to shuttle-pay-connector, and Shuttle handles which gateway processes the transaction.

For NMI-centric platforms this is a genuine safety valve. You keep NMI as your primary rail while staying free to onboard a merchant who arrives with a different gateway mandate.


PCI Compliance

The NMI + Twilio integration via Shuttle keeps you completely out of PCI scope:

Layer

PCI handled by

DTMF capture & suppression

Twilio

Card data processing

Shuttle (PCI DSS Level 1)

Payment processing

NMI

Your systems

No card data, SAQ-A

Card data flows from Twilio to Shuttle to NMI. Your application only receives redacted data (last 4 digits, card brand, transaction reference). You qualify for SAQ-A, the lightest PCI self-assessment.

For the full picture on PCI compliance with Twilio, see Twilio PCI Compliance: Payments Without Handling Card Data.


FAQ

Can I connect NMI to Twilio without Shuttle? Twilio doesn't have a built-in NMI Pay Connector. You'd need to build a custom connector using Twilio's Generic Pay Connector framework, which means handling PCI compliance for card data processing yourself. Shuttle provides a pre-built, PCI-certified connector that handles this.

Does this work with Twilio Studio? Yes. Twilio Studio supports the <Pay> widget. Configure it with shuttle-pay-connector as the connector and the payment flow works within your Studio flow.

I'm an ISV with many merchants on NMI. Can each merchant use their own account? Yes. Create a Shuttle payment profile per merchant, each holding that merchant's NMI security key. Shuttle routes each transaction to the correct merchant's gateway account through the same Twilio integration.

Does this work with NMI's Customer Vault? Yes. Cards captured over the phone can be tokenised into the Customer Vault for recurring or repeat billing, and reused across web, mobile, voice, and payment links.

What about testing? Fully supported. Enable test mode on your NMI account, use the standard test card (4111 1111 1111 1111), and run the full Twilio flow before going live.

What does it cost? Shuttle charges $0.20 per successful transaction. NMI's gateway and processing fees apply on top, per your NMI agreement. No Shuttle setup fees or monthly minimums.

Can I switch from NMI to another gateway later? Yes. Change the gateway in your Shuttle payment profile. Your Twilio call flow stays exactly the same, no code changes needed.


Related Reading


*Connect NMI to Twilio in minutes with Shuttle's Pay Connector: PCI DSS Level 1, $0.20/transaction, no setup fees. Install on Twilio or book a discovery call.*

Talk to us

See how Shuttle can power payments for your platform — multi-PSP, multi-channel, white-label.

Book a Demo