Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Payment Methods > Update payment method

Update payment method

Updates an existing credit card payment method for the specified customer account.

Request

  • Production: PUT https://api.zuora.com/rest/v1/payment-methods/credit-cards/{payment-method-id}
  • API Sandbox: PUT https://apisandbox-api.zuora.com/rest/v1/payment-methods/credit-cards/{payment-method-id}

Request parameters

payment-method-id required path Unique ID of the payment method to update

Request body

expirationMonth

optional

Two-digit expiration month (01-12)

expirationYear

optional

Four-digit expiration year

securityCode

optional

The CVV or CVV2 security code for the credit card or debit card. Only required if changing expirationMonth, expirationYear, or cardHolderNameTo ensure PCI compliance, this value isn't stored and can't be queried. For more information, see How do I control what information Zuora sends over to the Payment Gateway?

defaultPaymentMethod

 

optional

Specify "true" to make this card the default payment method; otherwise, omit this parameter to keep the current default payment method.

cardHolderName

optional

The full name as it appears on the card, e.g., "John J Smith", 50 characters or less

addressLine1

optional

First address line, 255 characters or less

addressLine2

optional

Second address line, 255 characters or less

city

optional

City, 40 characters or less

state

optional

State; must be a valid state name or 2-character abbreviation.

zipCode

optional

Zip code, 20 characters or less

country

optional

Country; must be a valid country name or abbreviation.

phone

optional

Phone number, 40 characters or less

email

optional

Card holder's email address, 80 characters or less

Response

success

Contains true if successful, otherwise false.

processId

Internal process ID to assist Zuora support. Only returned if success is false.

reasons

Information on one or more reasons for the result. Only returned if success is false.

code

Eight-digit numeric error code

message

Description of the error

Examples

HTTP/JSON request:

PUT https://api.zuora.com/rest.v1/payment-methods/credit-cards/4028e485225d1d5f0122662fd6b249c8

JSON request:

{
  "expirationMonth": 8,
  "expirationYear": 2015,
  "cardHolderName": "Leo",
  "securityCode": "111"
}
JSON response:
{
  "paymentMethodId": "2c92c8f83dcbd8b1013dcce1d6a600ce",
  "success": true
}

CURL request:

##
## Update Credit Card
##
echo
echo "=============Update Credit Card============="
echo
curl -i -k -H "apiAccessKeyId:$USER_NAME" -H "apiSecretAccessKey:$PASSWORD" -H "Content-Type:application/json" -H "Accept:application/json" -d '
{
  "expirationMonth": 8,
  "expirationYear": 2015,
  "securityCode": "111",
  "defaultPaymentMethod": true,
  "cardHolderName": "Leo",
  "phone": "12345678"
}
' -X PUT $BASE_URL/v1/payment-methods/credit-cards/ff808081298c6e5401298c76f29a006d

JSON response:

{
  "paymentMethodId": "2c92c8f83dcbd8b1013dcce1d6a600ce",
  "success": true
}
Last modified
13:33, 8 Oct 2015

Tags

Classifications

(not set)