validA valid and active credit card.expiringA card which is expiring in the current month.expiredAn expired card.
gateway
enumerated string Name of the gateway this payment source is stored with.
Possible values are
chargebeeChargebee test gateway.stripeStripe is a payment gateway.
braintreeBraintree is a payment gateway.authorize_netAuthorize.net is a payment gateway.paypal_proPayPal Pro Account is a payment gateway.pinPin is a payment gateway.ewayeWAY Account is a payment gateway.eway_rapideWAY Rapid is a payment gateway.worldpayWorldPay is a payment gateway.balanced_paymentsBalanced is a payment gateway.beanstreamBambora(formerly known as Beanstream) is a payment gateway.bluepayBluePay is a payment gateway.elavonElavon Virtual Merchant is a payment solution.first_data_globalFirst Data Global Gateway Virtual Terminal Account.hdfcHDFC Account is a payment gateway.migsMasterCard Internet Gateway Service payment gateway.nmiNMI is a payment gateway.ogoneIngenico ePayments (formerly known as Ogone) is a payment gateway.paymillPAYMILL is a payment gateway.paypal_payflow_proPayPal Payflow Pro is a payment gateway.sage_paySage Pay is a payment gateway.tco2Checkout is a payment gateway.wirecardWireCard Account is a payment service provider.not_applicableIndicates that payment gateway is not applicable for this resource.
optional, string, max chars=200 The identifier provided by the gateway/card vault for the specific payment method resource.
first_name
optional, string, max chars=50 Cardholder's first name
last_name
optional, string, max chars=50 Cardholder's last name
iin
string, min chars=6, max chars=6 The Issuer Identification Number, i.e. the first six digits of the card number
last4
string, min chars=4, max chars=4 Last four digits of the card number
card_type
optional, enumerated string Card type
Possible values are
visaA Visa card.mastercardA MasterCard.american_expressAn American Express card.discoverA Discover card.
jcbA JCB card.diners_clubA Diner's Club card.bancontactA Bancontact card.otherCard belonging to types other than those listed above.not_applicableUsed for offline entries in transactions. Not applicable for cards.
optional, string, max chars=150 Address line 1, as available in card billing address.
billing_addr2
optional, string, max chars=150 Address line 2, as available in card billing address.
billing_city
optional, string, max chars=50 City, as available in card billing address.
billing_state_code
optional, string, max chars=50 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).
billing_state
optional, string, max chars=50 The state/province name.
billing_country
optional, string, max chars=50 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.
billing_zip
optional, string, max chars=20 Postal or Zip code, as available in card billing address.
ip_address
optional, string, max chars=50 The IP address of the customer. Used primarily for referral integration and EU VAT validation.
customer_id
string, max chars=50 Identifier of the customer.
masked_number
optional, string, max chars=19 Masked credit card number that is safe to show.
Storing card after successful 3DS flow not supported in this API. Use create using Payment Intent API under Payemnt source to store the card after successful 3DS flow completion.
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.
Note:For customers signed up before 1st March 2014, if the card's billing information is specified in the input, the customer's Billing Info (i.e Billing Address and vat_number) will also be replaced with the new values automatically.
optional, enumerated string Name of the gateway this card should be stored with.
Possible values are
chargebeeChargebee test gateway.stripeStripe is a payment gateway.
braintreeBraintree is a payment gateway.authorize_netAuthorize.net is a payment gatewaypaypal_proPayPal Pro Account is a payment gateway.pinPin is a payment gatewayewayeWAY Account is a payment gateway.eway_rapideWAY Rapid is a payment gateway.worldpayWorldPay is a payment gatewaybalanced_paymentsBalanced is a payment gatewaybeanstreamBambora(formerly known as Beanstream) is a payment gateway.bluepayBluePay is a payment gateway.elavonElavon Virtual Merchant is a payment solution.first_data_globalFirst Data Global Gateway Virtual Terminal AccounthdfcHDFC Account is a payment gateway.migsMasterCard Internet Gateway Service payment gateway.nmiNMI is a payment gateway.ogoneIngenico ePayments (formerly known as Ogone) is a payment gateway.paymillPAYMILL is a payment gateway.paypal_payflow_proPayPal Payflow Pro is a payment gateway.sage_paySage Pay is a payment gateway.tco2Checkout is a payment gateway.wirecardWireCard Account is a payment service provider.
optional, string, max chars=300 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).
first_name
optional, string, max chars=50 Cardholder's first name.
last_name
optional, string, max chars=50 Cardholder's last name.
number
required, string, max chars=1500 The credit card number without any format. If you are using Braintree.js, you can specify the Braintree encrypted card number here.
optional, string, max chars=520 The card verification value (CVV). If you are using Braintree.js, you can specify the Braintree encrypted CVV here.
billing_addr1
optional, string, max chars=150 Address line 1, as available in card billing address.
billing_addr2
optional, string, max chars=150 Address line 2, as available in card billing address.
billing_city
optional, string, max chars=50 City, as available in card billing address.
billing_state_code
optional, string, max chars=50 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).
billing_state
optional, string, max chars=50 The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.
billing_zip
optional, string, max chars=20 Postal or Zip code, as available in card billing address.
billing_country
optional, string, max chars=50 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.
.
ip_address
optional, string, max chars=50 The IP address of the customer. Used primarily for referral integration and EU VAT validation.
optional, string, max chars=150 Identifier for PaymentIntent generated by Chargebee.js. Applicable only when you are using Chargebee.js for completing the 3DS flow. The PaymentIntent should be in ‘authorized’ state while passing it here. You need not pass other PaymentIntent parameters if this is passed.
gateway_account_id
optional, string, max chars=50 The gateway account used for performing the 3DS flow. Applicable when you are using gateway APIs directly for completing the 3DS flow.
gw_token
optional, string, max chars=65k Identifier for 3DS transaction/verification object at the gateway. Can be passed only after successfully completing the 3DS flow. Refer 3DS implementation in Chargebee to find out the gateway-specific gw_token format. Applicable when you are using gateway APIs directly for completing the 3DS flow.
reference_id
optional, string, max chars=65k Identifier for Braintree permanent token. Applicable when you are using Braintree APIs for completing the 3DS flow.
required, enumerated string Name of the gateway you want to switch to.
Possible values are
stripeStripe is a payment gateway.
braintreeBraintree is a payment gateway.authorize_netAuthorize.net is a payment gatewaypaypal_proPayPal Pro Account is a payment gateway.pinPin is a payment gatewayewayeWAY Account is a payment gateway.eway_rapideWAY Rapid is a payment gateway.worldpayWorldPay is a payment gatewaybalanced_paymentsBalanced is a payment gatewaybeanstreamBambora(formerly known as Beanstream) is a payment gateway.bluepayBluePay is a payment gateway.elavonElavon Virtual Merchant is a payment solution.first_data_globalFirst Data Global Gateway Virtual Terminal AccounthdfcHDFC Account is a payment gateway.migsMasterCard Internet Gateway Service payment gateway.nmiNMI is a payment gateway.ogoneIngenico ePayments (formerly known as Ogone) is a payment gateway.paymillPAYMILL is a payment gateway.paypal_payflow_proPayPal Payflow Pro is a payment gateway.sage_paySage Pay is a payment gateway.wirecardWireCard Account is a payment service provider.
Deletes the existing card for a customer. Upon successful deletion of card the auto_collection attribute for this customer will be set to off and card_deleted event will be triggered.
If there is no card present in the gateway for the customer, this API will return successfully without throwing any error.
Sample Request
curl https://{site}.chargebee.com/api/v1/customers/__test__XpbTXGTSRp3gEsD8/delete_card \
-X POST \
-u {site_api_key}:
copy
curl https://{site}.chargebee.com/api/v1/customers/__test__XpbTXGTSRp3gEsD8/delete_card \
-X POST \
-u {site_api_key}: