Update an instance of payments with different phases of payment flows.

POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments/{Sid}.json

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

  • AccountSid string Required

    The SID of the Account that will update the resource.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

  • CallSid string Required

    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 is 34. Format should match the following pattern: ^CA[0-9a-fA-F]{32}$.

  • Sid string Required

    The SID of Payments session that needs to be updated.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^PK[0-9a-fA-F]{32}$.

application/x-www-form-urlencoded

Body

  • IdempotencyKey string 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.

  • StatusCallback string(uri) Required

    Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the Update and Complete/Cancel POST requests.

  • Capture string

    Values are payment-card-number, expiration-date, security-code, postal-code, bank-routing-number, or bank-account-number.

  • Status string

    Values are complete or cancel.

Responses

  • 202 application/json

    Accepted

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • account_sid string | null

      The SID of the Account that created the Payments resource.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • call_sid string | null

      The SID of the Call the Payments resource is associated with. This will refer to the call sid that is producing the payment card (credit/ACH) information thru DTMF.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^CA[0-9a-fA-F]{32}$.

    • sid string | null

      The SID of the Payments resource.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^PK[0-9a-fA-F]{32}$.

    • date_created string(date-time-rfc-2822) | null

      The date and time in GMT that the resource was created specified in RFC 2822 format.

    • date_updated string(date-time-rfc-2822) | null

      The date and time in GMT that the resource was last updated specified in RFC 2822 format.

    • uri string | null

      The URI of the resource, relative to https://api.twilio.com.

POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments/{Sid}.json
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"
}