Update an instance of payments with different phases of payment flows.
Twilio enabled secure payments solution for accepting credit and ACH payments over the phone.
update an instance of payments with different phases of payment flows.
Path parameters
-
The SID of the Account that will update the resource.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^AC[0-9a-fA-F]{32}$
. -
The SID of the call that will update the resource. This should be the same call sid that was used to create payments resource.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^CA[0-9a-fA-F]{32}$
. -
The SID of Payments session that needs to be updated.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^PK[0-9a-fA-F]{32}$
.
Body
-
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.
-
Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the Update and Complete/Cancel POST requests.
-
Values are
payment-card-number
,expiration-date
,security-code
,postal-code
,bank-routing-number
, orbank-account-number
. -
Values are
complete
orcancel
.
curl \
--request POST 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments/{Sid}.json' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Capture=payment-card-number&IdempotencyKey=abcd&StatusCallback=https%3A%2F%2Fmyapp.com%2Fpayments'
{"Capture"=>"payment-card-number", "IdempotencyKey"=>"abcd", "StatusCallback"=>"https://myapp.com/payments"}
{"Capture"=>"expiration-date", "IdempotencyKey"=>"abcd", "StatusCallback"=>"https://myapp.com/payments"}
{"Status"=>"complete", "IdempotencyKey"=>"abcd", "StatusCallback"=>"https://myapp.com/payments"}
{
"sid": "PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments/PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "Wed, 18 Dec 2019 20:02:01 +0000",
"date_updated": "Wed, 18 Dec 2019 20:02:01 +0000"
}
{
"sid": "PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments/PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "Wed, 18 Dec 2019 20:02:01 +0000",
"date_updated": "Wed, 18 Dec 2019 20:02:01 +0000"
}
{
"sid": "PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments/PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "Wed, 18 Dec 2019 20:02:01 +0000",
"date_updated": "Wed, 18 Dec 2019 20:02:01 +0000"
}