Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

call_control_id
string
required

Unique identifier and token for controlling the call

Body

application/json

Pay request

connector_name
string
default:Default

Name of the Pay connector used to process the transaction.

Example:

"Default"

amount
number

Amount to charge. Required when transaction_type is charge.

Required range: x >= 0
Example:

10.5

currency
enum<string>
default:USD

Currency used for the transaction. Pay currently supports USD only.

Available options:
USD,
usd
Example:

"USD"

payment_token
string

Existing payment token. When supplied, payment-detail collection is skipped.

Example:

"tok_abc123"

payment_method
enum<string>
default:credit-card

Payment method to collect.

Available options:
credit-card,
ach-debit
transaction_type
enum<string>

Transaction to perform. If omitted, Pay infers tokenize when amount is absent or zero and charge when amount is positive.

Available options:
charge,
tokenize
description
string

Optional description forwarded with the payment transaction.

Example:

"Order 12345"

client_state
string

Base64-encoded state included in subsequent webhooks.

Example:

"aGF2ZSBhIG5pY2UgZGF5ID1d"

metadata
object

Metadata forwarded to the Pay connector.

Example:
parameters
object

Additional parameters forwarded to the Pay connector.

Example:
prompts
Pay Prompts · object

Custom text-to-speech prompts keyed by payment collection step.

Example:
max_attempts
integer<int32>
default:3

Maximum number of attempts for each payment collection step.

Required range: 1 <= x <= 3
timeout_millis
integer<int32>
default:5000

Time in milliseconds to wait for DTMF input for each collection step.

Required range: 1 <= x <= 600000
inter_digit_timeout_millis
integer<int32>
default:5000

Time in milliseconds to wait between consecutive DTMF digits.

Required range: 1 <= x <= 600000
voice
string
default:female

Voice 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.

Example:

"female"

language
string
default:en-US

Language used for payment prompts.

Example:

"en-US"

service_level
string
default:premium

Speech synthesis service level used for payment prompts. Pay defaults to premium.

command_id
string

Idempotency key for the command. Telnyx ignores a duplicate command with the same command_id for the same call_control_id.

Example:

"891510ac-f3e4-11e8-af5b-de00688a4901"

Response

Successful response upon making a call control command.

data
Call Control Command Result · object
Example: