{
"card_type": "american_express",
"customer_id": "__test__XpbTXGTSRp3gtJDI",
"expiry_month": 12,
"expiry_year": 2022,
"gateway": "chargebee",
"iin": "378282",
"last4": "0005",
"masked_number": "***********0005",
"object": "card",
"reference_id": "tok___test__XpbTXGTSRp3gxDDL",
"status": "valid"
}
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
). 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.
curl https://{site}.chargebee.com/api/v1/cards/__test__XpbTXGTSRp3gtJDI \ -u {site_api_key}:
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
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.
curl https://{site}.chargebee.com/api/v1/customers/__test__XpbTXGTSRp3hoMDa/credit_card \ -u {site_api_key}:\ -d first_name="Richard" \ -d last_name="Fox" \ -d number="4012888888881881" \ -d expiry_month=10 \ -d expiry_year=2022 \ -d cvv="999" \ -d gateway="CHARGEBEE"
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
). 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.
curl https://{site}.chargebee.com/api/v1/customers/__test__3Nl9RLTRcPq9H44f/credit_card_using_payment_intent \ -u {site_api_key}:\ -d gateway_account_id="gw___test__3Nl9RIYRcPq9HaW" \ -d gw_token="pi_1FK04IJv9j0DyntJoJZUurla"
Switches the gateway in which customer’s card information is stored.
This is applicable only if the payment method is “card”.
This operation is not supported if the current gateway is Braintree or Stripe.
curl https://{site}.chargebee.com/api/v1/customers/__test__XpbTXGTSRp3hJ7DR/switch_gateway \ -u {site_api_key}:\ -d gateway="PIN"
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.
curl https://{site}.chargebee.com/api/v1/customers/__test__XpbTXGTSRp3gEsD8/delete_card \ -X POST \ -u {site_api_key}: