Deprecated
The Payment Sources API , with its additional options and improvements, obsoletes the Cards APIs . This operation is obsoleted by the following:
Adds or replaces card details of a customer. Updating card details replaces the present payment method.
Passing credit card details to this API involves PCI liability at your end as sensitive card info passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable
- If you are using Stripe gateway, you can use Stripe.js with your card update form.
- If you are using Braintree gateway, you can use Braintree.js with your card update form.
- If you are using Authorize.Net gateway, you use Accept.js with your card update form.
- In case you are using the Adyen gateway, you will have to use the Adyen's Client Side Encryption to encrypt sensitive cardholder data. Once the cardholder data is encrypted, pass the value in adyen.encrypted.data as temp token in this API.
- You can also use our Hosted Pages based integration. Use our Hosted Page - Update Card API to generate a 'Update Card' Hosted Page link.
Legacy behavior:
- For sites created before March 1st, 2014: On making this request, the
billing_addressandvat_numberof the customer are deleted and replaced by the values passed with this request. Ensure that you pass the billing address parameters and thevat_numberparameters each time you make this request, to avoid losing the same information at the customer-level. - For sites created on or after March 1st, 2014: This request does not alter the
billing_addressandvat_numberof the customer.
Sample Request
URL Format
Input Parameters
The gateway account in which this payment source is stored.
The single-use card token returned by vaults like Stripe/Braintree which act as a substitute for your card details. Before calling this API, you should have submitted your card details to the gateway and gotten this token in return. Note: Supported only for Stripe, Braintree and Authorize.Net. If this value is specified, there is no need to specify other card details (like number, cvv, etc).
The credit card number without any format. If you are using Braintree.js , you can specify the Braintree encrypted card number here.
The card verification value (CVV). If you are using Braintree.js , you can specify the Braintree encrypted CVV here.
The customer's preferred card scheme for co-branded cards.
Note: Currently, this parameter is only supported for Stripe.
A Cartes Bancaires card scheme.
A MasterCard scheme.
A Visa card scheme.
The ISO 3166-2 state/province code
without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code
as AZ
(not US-AZ
). For Tamil Nadu (India), set as TN
(not IN-TN
). For British Columbia (Canada), set as BC
(not CA-BC
).
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code
is provided.
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code .
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom - Northern Ireland) is available as an option.
.