Collect payment details
Collect payment details from the caller using DTMF and either charge or tokenize the payment method through a configured Pay connector. Pay pauses active call recordings while sensitive payment details are collected.
When payment_token is supplied, the DTMF collection steps are skipped and the existing token is sent to the connector.
Expected Webhooks:
call.payment.progresscall.payment.completed
Test mode card numbers: 4111111111111111 (Visa), 5555555555554444 (Mastercard), 378282246310005 (American Express), 6011111111111117 (Discover), 3065930009020004 (Diners Club), 3566002020360505 (JCB), 6200000000000005 (UnionPay), and 6771798021000008 (Maestro). Test-mode connectors reject other card numbers before contacting the configured processor. The UnionPay and Maestro numbers are accepted for processor testing, but Pay currently does not emit a card type for them.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier and token for controlling the call
Body
Pay request
Name of the Pay connector used to process the transaction.
"Default"
Amount to charge. Required when transaction_type is charge.
x >= 010.5
Currency used for the transaction. Pay currently supports USD only.
USD, usd "USD"
Existing payment token. When supplied, payment-detail collection is skipped.
"tok_abc123"
Payment method to collect.
credit-card, ach-debit Transaction to perform. If omitted, Pay infers tokenize when amount is absent or zero and charge when amount is positive.
charge, tokenize Optional description forwarded with the payment transaction.
"Order 12345"
Base64-encoded state included in subsequent webhooks.
"aGF2ZSBhIG5pY2UgZGF5ID1d"
Metadata forwarded to the Pay connector.
Additional parameters forwarded to the Pay connector.
Custom text-to-speech prompts keyed by payment collection step.
Maximum number of attempts for each payment collection step.
1 <= x <= 3Time in milliseconds to wait for DTMF input for each collection step.
1 <= x <= 600000Time in milliseconds to wait between consecutive DTMF digits.
1 <= x <= 600000Voice used for payment prompts. Accepts male, female, or a provider voice in <Provider>.<Model>.<VoiceId> format, for example AWS.Polly.Joanna or Telnyx.KokoroTTS.af.
"female"
Language used for payment prompts.
"en-US"
Speech synthesis service level used for payment prompts. Pay defaults to premium.
Idempotency key for the command. Telnyx ignores a duplicate command with the same command_id for the same call_control_id.
"891510ac-f3e4-11e8-af5b-de00688a4901"
Response
Successful response upon making a call control command.