ChargebeeAPI

Update a card payment source

Idempotency Supported
Try in API Explorer

Merchants look to update card details when:

  • The billing address of a customer has changed. In such a case, modify the billing address in the Chargebee and the payment gateway.
  • The expiration date of the card has been extended by the bank. (This usually happens when the date of card expiry is in near future).

Multiple parameters such as address, expiry date, month, and so on, can be updated through this API.

Meta data can also be added additionally(supported in Stripe only). Metadata is a JSON object. It is used to store additional information about customers.

In Stripe and Braintree payment gateways, changes in card details are auto-updated. This feature can also be used for other payment gateways in which auto-update is not enabled or is not supported by Chargebee.

Note : This endpoint supports Chargebee Test Gateway, Stripe , Braintree , Authorize.net , Worldpay US eCom , and WorldPay Direct Integration . For all other gateways, your customers must re-enter the full card details to update existing card details. For example, consider a customer not using the gateways mentioned above and wants to update the card[billing_addr1] parameter. In such a case, the customer must re-enter the value of all the parameters present in the card object.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/payment_sources/{cust-payment-source-id}/update_card

Input Parameters

gateway_meta_data
optional, jsonobject

Additional data about this resource can be passed to Stripe gateway here in the JSON Format. This will be stored along with payment source at the gateway account.

reference_transaction
optional, string, max chars=50

Reference transaction is used for future purchases. This is only applicable for Vantiv.

card
optional, string

Parameters for card

Returns

customerCustomer object

Resource object representing customer

payment_sourcePayment source object

Resource object representing payment_source