provider Api20100401Payment POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments.json
@utdk/twilio /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments.json
create an instance of payments. This will start a new payments session
create an instance of payments. This will start a new payments session
AccountSid path required
The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource.
string
CallSid path required
The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF.
string

Try it

Authentication
Configure credentials for Twilio - Api
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

createpayments
POST/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments.json
create an instance of payments. This will start a new payments session

Parameters

required

The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource.

required

The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF.

Input

required

A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated.

required

Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback)

Type of bank account if payment source is ACH. One of `consumer-checking`, `consumer-savings`, or `commercial-checking`. The default value is `consumer-checking`.

A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize.

The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted.

The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions.

A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs.

A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits.

A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors).

This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`.

Type of payment being captured. One of `credit-card` or `ach-debit`. The default value is `credit-card`.

Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`.

Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`.

The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`.

Indicates whether the payment method should be tokenized as a `one-time`, `reusable`, or `payment-method` token. The default value is `reusable`. Do not enter a charge amount when tokenizing. If a charge amount is entered, the payment method will be charged and not tokenized.

Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex`

A comma-separated list of payment information fields that require the caller to enter the same value twice for confirmation. Supported values are `payment-card-number`, `expiration-date`, `security-code`, and `postal-code`.

Whether to prompt the caller to confirm their payment information before submitting to the payment gateway. If `true`, the caller will hear the last 4 digits of their card or account number and must press 1 to confirm or 2 to cancel. Default is `false`.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import twilio from '@utdk/twilio';

await twilio.createpayments()