Overview
Telnyx’s Pay over Voice feature enables accepting payments securely over the phone. The feature guides callers through an automated IVR flow to collect payment details (credit card or ACH debit), sends them to the configured payment processor, and returns the result — keeping sensitive card data out of recordings, logs, and AI assistants.How it works
- Create a Payment Connector pointing to the payment processor’s endpoint.
- A Pay session is started on an active call (via Voice API, TeXML, or AI Assistant).
- The caller is guided through IVR prompts to enter payment details via DTMF.
- Telnyx collects, encrypts, and sends the details to the processor.
- The processor charges or tokenizes the payment and returns a result.
- Telnyx emits progress and completed events to the webhook and AI assistant.
Create a Payment Connector
A Payment Connector is the bridge between Telnyx and the payment processor. It stores the processor’s endpoint URL and authentication credentials (encrypted at rest with AES-256).Step 1 — Navigate to Payment Connectors
In the Telnyx Portal, go to Voice API → Applications → Payment Connectors. The portal displays a list of existing connectors:
Step 2 — Create a new connector
Click Create Connector. Fill in the following fields:
When Authentication type is set to
basic, Telnyx sends the credentials as HTTP Basic Auth headers with each request to the processor. The credentials are encrypted with AES-256-CTR before storage and are never exposed in logs or events.
Connectors can also be managed programmatically via the API:
Payment Modes: Test vs Live
Test mode (default)
New connectors are created in test mode. In test mode, the Pay session accepts only a predefined set of test card numbers. Any other card number is rejected with aninvalid-card-number error, and the caller is asked to re-enter the number (up to max_attempts times).
This allows testing the IVR flow, webhook handling, and processor integration end-to-end without processing real payments.
Valid test card numbers
For ACH-debit test mode, any valid-length routing and account numbers are accepted.
Live mode
When ready to accept real payments, switch the connector to live mode. Once a connector is in live mode:- It cannot be edited. The endpoint URL, authentication type, and credentials are locked. This prevents accidental changes to a production payment integration.
- All card numbers are accepted (no test card restriction).
- Real charges are processed through the payment processor.
The Payment Process
When a Pay session starts on a call, Telnyx takes over the call leg and guides the caller through a series of IVR steps. Each step plays a voice prompt, then collects the caller’s DTMF input.Security during payment
Before the first IVR prompt is played, Telnyx automatically disables all processes that could capture payment data:IVR steps
The IVR flow depends on the payment method selected:Credit card flow
ACH debit flow
Custom prompts
Prompts can be overridden by passing aprompts map. Each key is a step name, and the value is either a string or a list of prompt objects with conditional qualifiers:
attempt (1–3), error_type (e.g., invalid-card-number, timeout), card_type (e.g., visa, mastercard, amex, discover).
Error handling and retries
Each step allows up tomax_attempts (default 3) retries. If the caller enters too few digits, the wrong format, or times out, the step is repeated with an appropriate error prompt. If all attempts are exhausted, the session ends with too-many-failed-attempts.
Request sent to the payment processor
Once all digits are collected, Telnyx sends an HTTPS POST to the connector’s endpoint URL with the payment details.Credit card — charge
Credit card — tokenize
Whentransaction_type is tokenize (or amount is 0 or omitted), amount and currency_code are not sent:
ACH debit — charge
Response expected from the payment processor
The processor should return a JSON response: Charge — success:error_code is present and non-empty, the session ends with payment-connector-error.
Using Pay over Voice
Pay over Voice can be triggered from three interfaces: the Voice API, TeXML, and AI Assistant.Voice API
Start a Pay session by sending a POST request to the pay endpoint on an active call:Request parameters
TeXML
Use the<Pay> verb in a TeXML application. This is the simplest way to start a Pay session — include the verb in the TeXML response and Telnyx handles the rest:
call_payment_progress and call_payment_completed events. The application can use these to update external systems, confirm the payment, or continue the call flow.
AI Assistant
When using Telnyx’s AI Voice Assistant, a Pay tool can be added to the assistant so it can trigger a payment session during a conversation.
When the AI assistant invokes the Pay tool, it starts a Pay session on the call. The assistant receives
call.payment.progress events after each IVR step and a call.payment.completed event with the final result. This lets the assistant inform the caller of the payment status and continue the conversation naturally.
:::note
During the Pay session, the AI assistant does not receive DTMF input or audio from the caller. The assistant only receives progress and completion events with masked payment data. This ensures the assistant never has access to raw card numbers, CVVs, or bank account details.
:::
Events
Two events are emitted during a Pay session. Both are sent to the configured webhook URL and, if active, to the AI assistant.Payment Progress
Sent after each IVR step completes or fails. Event name:call.payment.progress (API v2) or call_payment_progress (TeXML).
xxx).
Payment Completed
Sent when the Pay session ends (success, failure, or cancellation). Event name:call.payment.completed (API v2) or call_payment_completed (TeXML).
Success: