# Cards

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


#### Deprecated[](#deprecated)

The [Payment Sources API](/docs/api/payment_sources) , with its additional options and improvements, obsoletes the Cards APIs. [Learn more](/docs/api/getting-started) .

The following table lists the Payment Sources API operations alongside the equivalent Card API operations:

API at Card resource

Use instead

[Retrieve card for a customer](/docs/api/cards/retrieve-card-for-a-customer)

[Retrieve a payment source](/docs/api/payment_sources/retrieve-a-payment-source)

[Update card for a customer](/docs/api/cards/update-card-for-a-customer)

-   [Create using temporary token](/docs/api/v2/pcv-1/payment_sources/create-using-gateway-temporary-token)
-   [Create using permanent token](/docs/api/payment_sources/create-using-permanent-token)
-   [Create a card payment source](/docs/api/payment_sources/create-a-card-payment-source)

[Switch gateway](/docs/api/cards/switch-gateway)

[Switch gateway account](/docs/api/payment_sources/switch-gateway-account)

[Copy card](/docs/api/cards/copy-card)

[Export payment source](/docs/api/payment_sources/export-payment-source)

[Delete card for a customer](/docs/api/cards/delete-card-for-a-customer)

[Delete a payment source](/docs/api/payment_sources/delete-a-payment-source)

## Sample Card

```json
{
  "card_type": "american_express",
  "created_at": 1517486946,
  "customer_id": "__test__XpbTXGTSRp3ELNCY",
  "expiry_month": 12,
  "expiry_year": 2022,
  "funding_type": "not_known",
  "gateway": "chargebee",
  "gateway_account_id": "gw___test__5SK2lMgOSRp3BOO1y",
  "iin": "378282",
  "last4": "0005",
  "masked_number": "***********0005",
  "object": "card",
  "payment_source_id": "pm___test__XpbTXGTSRp3ENNCc",
  "resource_version": 1517486946205,
  "status": "valid",
  "updated_at": 1517486946
}
```

## Cards attributes

## Input Parameters

- `payment_source_id` (required, string, max chars=40)
  Identifier of the payment source

- `status` (required, enumerated string)
  Current status of the card.
  Possible enum values:
    - `valid`
      A valid and active credit card
    - `expiring`
      A card which is expiring in the current month.
    - `expired`
      An expired card

- `gateway` (required, enumerated string)
  Name of the gateway this payment source is stored with.
  Possible enum values:
    - `chargebee`
      Chargebee test gateway.
    - `chargebee_payments`
      Chargebee Payments gateway
    - `adyen`
      Adyen is a payment gateway.
    - `stripe`
      Stripe is a payment gateway.
    - `wepay`
      WePay is a payment gateway.
    - `braintree`
      Braintree is a payment gateway.
    - `authorize_net`
      Authorize.net is a payment gateway
    - `paypal_pro`
      PayPal Pro Account is a payment gateway.
    - `pin`
      Pin is a payment gateway
    - `eway`
      eWAY Account is a payment gateway.
    - `eway_rapid`
      eWAY Rapid is a payment gateway.
    - `worldpay`
      WorldPay is a payment gateway
    - `balanced_payments`
      Balanced is a payment gateway
    - `beanstream`
      Bambora(formerly known as Beanstream) is a payment gateway.
    - `bluepay`
      BluePay is a payment gateway.
    - `elavon`
      Elavon Virtual Merchant is a payment solution.
    - `first_data_global`
      First Data Global Gateway Virtual Terminal Account
    - `hdfc`
      HDFC Account is a payment gateway.
    - `migs`
      MasterCard Internet Gateway Service payment gateway.
    - `nmi`
      NMI is a payment gateway.
    - `ogone`
      Ingenico ePayments (formerly known as Ogone) is a payment gateway.
    - `paymill`
      PAYMILL is a payment gateway.
    - `paypal_payflow_pro`
      PayPal Payflow Pro is a payment gateway.
    - `sage_pay`
      Sage Pay is a payment gateway.
    - `tco`
      2Checkout is a payment gateway.
    - `wirecard`
      WireCard Account is a payment service provider.
    - `amazon_payments`
      Amazon Payments is a payment service provider.
    - `paypal_express_checkout`
      PayPal Express Checkout is a payment gateway.
    - `gocardless`
      GoCardless is a payment service provider.
    - `orbital`
      Chase Paymentech(Orbital) is a payment gateway.
    - `moneris_us`
      Moneris USA is a payment gateway.
    - `moneris`
      Moneris is a payment gateway.
    - `bluesnap`
      BlueSnap is a payment gateway.
    - `cybersource`
      CyberSource is a payment gateway.
    - `vantiv`
      Vantiv is a payment gateway.
    - `checkout_com`
      Checkout.com is a payment gateway.
    - `paypal`
      PayPal Commerce is a payment gateway.
    - `ingenico_direct`
      Worldline Online Payments is a payment gateway.
    - `exact`
      Exact Payments is a payment gateway.
    - `mollie`
      Mollie is a payment gateway.
    - `quickbooks`
      Intuit QuickBooks Payments gateway
    - `razorpay`
      Razorpay is a fast growing payment service provider in India working with all leading banks and support for major local payment methods including Netbanking, UPI etc.
    - `global_payments`
      Global Payments is a payment service provider.
    - `bank_of_america`
      Bank of America Gateway
    - `ecentric`
      Ecentric provides a seamless payment processing service in South Africa specializing on omnichannel capabilities.
    - `metrics_global`
      Metrics global is a leading payment service provider providing unified payment services in the US.
    - `windcave`
      Windcave provides an end to end payment processing solution in ANZ and other leading global markets.
    - `pay_com`
      Pay.com provides payment services focused on simplicity and hassle-free operations for businesses of all sizes.
    - `ebanx`
      EBANX is a payment gateway, enabling businesses to accept diverse local payment methods from various countries for increased market reach and conversion.
    - `dlocal`
      Dlocal provides payment solutions for global commerce by accepting local payment methods.
    - `nuvei`
      Nuvei is a secure and reliable payment processing solution that allows you to accept payments from customers and suitable for various types of businesses.
      
      This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/nuvei&ref=feature) to enable Nuvei for your test and live sites.
    - `solidgate`
      Solidgate is a secure and reliable payment processing solution that allows you to accept payments from customers and suitable for various types of businesses.
      
      This feature is a **Private Beta Release**.
    - `paystack`
      Paystack is a payment gateway for businesses in Africa. It enables secure payment acceptance both online and offline.
      
      This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/paystack&ref=feature) to enable Paystack for your test and live sites.
    - `jp_morgan`
      J.P. Morgan Mobility Payment Solutions is a payment gateway that enables you to securely accept and manage digital payments across different [payment\_source\_type](/docs/api/payment_sources/payment_source-object#type).
      
      This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/jp-morgan-bacs&ref=feature) to enable the J.P. Morgan Mobility Payment Solutions gateway via payFURL for your test and live sites.
    - `deutsche_bank`
      Deutsche Bank is the leading German bank with strong European roots and a global network.
      
      This feature is a **Private Beta Release**.
    - `ezidebit`
      Ezidebit is a payment gateway integration based in Australia that supports automated direct debit, BPAY, and card payments for businesses.
      
      This feature is a **Private Beta Release**.
    - `twikey`
      Twikey is a payment service provider that specializes in processing direct debit payments across the EU.
    - `tempus`
      Tempus Technologies is a payment gateway and payments technology provider offering secure payment processing with end-to-end encryption (P2PE) and tokenization.
    - `moyasar`
      Moyasar is a fully integrated online payment service that makes accepting payments simple and secure.
    - `payway`
      Payway is a payment gateway that enables secure card and payment acceptance.
    - `payu`
    - `not_applicable`
      Indicates that payment gateway is not applicable for this resource.

- `gateway_account_id` (optional, string, max chars=50)
  The gateway account to which this payment source is stored with.

- `ref_tx_id` (optional, string, max chars=50)
  Reference transaction id which used for transactions

- `first_name` (optional, string, max chars=50)
  Cardholder's first name

- `last_name` (optional, string, max chars=50)
  Cardholder's last name

- `iin` (required, string, min chars=6, max chars=6)
  The Issuer Identification Number, i.e. the first six digits of the card number

- `last4` (required, string, min chars=4, max chars=4)
  Last four digits of the card number

- `card_type` (optional, enumerated string)
  Card type
  Possible enum values:
    - `visa`
      A Visa card.
    - `mastercard`
      A MasterCard.
    - `american_express`
      An American Express card.
    - `discover`
      A Discover card.
    - `jcb`
      A JCB card.
    - `diners_club`
      A Diner's Club card.
    - `bancontact`
      A Bancontact card.
    - `cmr_falabella`
      A CMR Falabella card.
    - `tarjeta_naranja`
      A Tarjeta Naranja card.
    - `nativa`
      A Nativa card.
    - `cencosud`
      A Cencosud card.
    - `cabal`
      A Cabal card.
    - `argencard`
      An Argencard.
    - `elo`
      A Elo card.
    - `hipercard`
      An Hipercard.
    - `carnet`
      A Carnet card.
    - `rupay`
      A Rupay card.
    - `maestro`
      A Maestro card.
    - `dankort`
      A Dankort card.
    - `cartes_bancaires`
      A Cartes Bancaires card.
    - `mada`
      A Mada card.
    - `other`
      Card belonging to types other than those listed above.
    - `not_applicable`
      Used for offline entries in transactions. Not applicable for cards

- `funding_type` (required, enumerated string)
  Card Funding type
  Possible enum values:
    - `credit`
      A credit card.
    - `debit`
      A debit card.
    - `prepaid`
      A prepaid card.
    - `not_known`
      An unknown card.
    - `not_applicable`
      Used for ACH. Not applicable for cards

- `expiry_month` (required, integer, min=1, max=12)
  Card expiry month.

- `expiry_year` (required, integer)
  Card expiry year.

- `issuing_country` (optional, string, max chars=50)
  [two-letter(alpha2)](https://www.iso.org/iso-3166-country-codes.html) ISO country code.

- `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](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `billing_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` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).

- `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](https://www.iso.org/iso-3166-country-codes.html) .
  
  **Note**: If you enter an invalid country code, the system will return an error.
  
  **Brexit**
  
  If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) 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.

- `created_at` (required, timestamp(UTC) in seconds)
  Timestamp indicating when this card resource is created.

- `resource_version` (optional, long)
  Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.

- `updated_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when this credit card resource was last updated.

- `ip_address` (optional, string, max chars=50)
  The IP address of the customer. Used primarily for referral integration and EU VAT validation.

- `powered_by` (optional, enumerated string)
  Card powered by payment method.
  Possible enum values:
    - `ideal`
      ideal
    - `sofort`
      sofort
    - `bancontact`
      bancontact
    - `giropay`
      giropay
    - `card`
      card
    - `latam_local_card`
      latam\_local\_card
    - `payconiq`
      payconiq
    - `not_applicable`
      not\_applicable

- `customer_id` (required, string, max chars=50)
  Identifier of the customer.

- `masked_number` (optional, string, max chars=19)
  Masked credit card number that is safe to show.

