# Payment sources

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


**Updates**

This API obsoletes the [Cards API](/docs/api/cards) in Chargebee.

Represents the payment source for the customer. Specific types of payment source (Card, Direct Debit, Paypal Express Checkout, etc.) is defined as sub-resource in the response object. You can find the list of supported payment sources and the expected input parameters [here](/docs/api/payment_parameters). See [Payment source attributes](/docs/api/payment_sources/payment-source-object) for a descriptive list of attributes and payment source types.

## Sample Payment source

```json
{
  "card": {
    "brand": "visa",
    "expiry_month": 5,
    "expiry_year": 2022,
    "first_name": "MyCard",
    "funding_type": "credit",
    "iin": "******",
    "last4": "4242",
    "last_name": "testing",
    "masked_number": "************4242",
    "object": "card"
  },
  "created_at": 1517487233,
  "customer_id": "__test__XpbTXGTSRp4QZ1EK",
  "deleted": false,
  "gateway": "stripe",
  "gateway_account_id": "gw___test__5SK2lMpwSRp4Mx02v",
  "id": "pm___test__XpbTXGTSRp4R8ZEN",
  "issuing_country": "US",
  "object": "payment_source",
  "reference_id": "cus_J7rVykqiooX1ng/card_1IVbmWJv9j0DyntJS7Bzo5q5",
  "resource_version": 1517487233588,
  "status": "valid",
  "type": "card",
  "updated_at": 1517487233
}
```

## Payment sources attributes

## Input Parameters

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

- `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 payment source resource was last updated.

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

- `customer_id` (required, string, max chars=50)
  Identifier of the customer with whom this payment source is associated.

- `type` (required, enumerated string)
  Type of payment source
  Possible enum values:
    - `card`
      Card based payment including credit cards and debit cards. Details about the card can be obtained from the card resource.
    - `paypal_express_checkout`
      Payments made via PayPal Express Checkout.
    - `amazon_payments`
      Payments made via Amazon Payments.
    - `direct_debit`
      Represents bank account for which the direct debit or ACH agreement/mandate is created.
    - `generic`
      Payments made via Generic Payment Method.
    - `alipay`
      Payments made via Alipay.
      
      This payment source is deprecated.
    - `unionpay`
      Payments made via UnionPay.
    - `apple_pay`
      Payments made via Apple Pay.
    - `wechat_pay`
      Payments made via WeChat Pay.
      
      This payment source is deprecated.
    - `ideal`
      Payments made via iDEAL.
    - `google_pay`
      Payments made via Google Pay.
    - `sofort`
      Payments made via Sofort.
    - `bancontact`
      Payments made via Bancontact Card.
    - `giropay`
      Payments made via giropay.
    - `dotpay`
      Payments made via Dotpay.
    - `upi`
      UPI Payments.
    - `netbanking_emandates`
      Netbanking (eMandates) Payments.
    - `venmo`
      Payments made via Venmo
    - `pay_to`
      Payments made via PayTo
    - `faster_payments`
      Payments made via Faster Payments
    - `sepa_instant_transfer`
      Payments made via Sepa Instant Transfer
    - `automated_bank_transfer`
      Represents virtual bank account using which the payment will be done.
    - `klarna_pay_now`
      Payments made via Klarna Pay Now
    - `online_banking_poland`
      Payments made via Online Banking Poland
    - `payconiq_by_bancontact`
      Payments made via Payconiq by Bancontact.
    - `electronic_payment_standard`
      Electronic Payment Standard
    - `kbc_payment_button`
      KBC Payment Button
    - `pay_by_bank`
      Pay By Bank
    - `trustly`
      Trustly
    - `stablecoin`
      Payments made via Stablecoin.
    - `kakao_pay`
      Payments made via Kakao Pay.
    - `naver_pay`
      Payments made via Naver Pay.
    - `revolut_pay`
      Payments made via Revolut Pay.
    - `cash_app_pay`
      Payments made via Cash App Pay.
    - `twint`
      Payments made via Twint
    - `go_pay`
      Payments made via GoPay
    - `grab_pay`
      Payments made via GrabPay
    - `pay_co`
      Payments made via PayCo
    - `after_pay`
      Payments made via Afterpay
    - `swish`
      Payments made via Swish
    - `payme`
      Payments made via PayMe
    - `pix`
      Payments made via Pix
    - `klarna`
      Payments made via Klarna.
    - `alipay_hk`
      Payments made via Alipay HK.
    - `paypay`
      Payments made via PayPay
    - `gcash`
      Payments made via GCash.
    - `south_korean_cards`
      Payments made via South Korean Cards
    - `paynow`
    - `bizum`
    - `promptpay`
    - `dana`
      Payments made via Dana.
    - `touch_n_go`
      Payments made via Touch 'n Go.
    - `tamara`
      Payments made via Tamara.
    - `qpay`
      Payments made via Qpay.
    - `ovo`
    - `momo`
    - `mercado_pago`
    - `nequi`
    - `nupay`
    - `picpay`
    - `thai_qr`
    - `blik`
    - `fpx`
    - `wero`
    - `p24`
    - `affirm_pay`
    - `rakuten_pay`

- `reference_id` (required, string, max chars=200)
  The reference id. In the case of Amazon and PayPal this will be the 'billing agreement id'. For GoCardless direct debit this will be 'mandate id'. In the case of card payments this will be the identifier provided by the gateway/card vault for the specific payment method resource. **Note:** This is not the one time temporary token provided by gateways like Stripe.

- `status` (required, enumerated string, default=valid)
  Current status of the payment source.
  Possible enum values:
    - `valid`
      A payment source that is valid and active.
    - `expiring`
      A payment source that is expiring (like card's status based on its expiry date).
    - `expired`
      A payment source that has expired
    - `invalid`
      The billing agreement cannot be used. It might become valid again either automatically or due to customer action.
    - `pending_verification`
      The payment source needs to be verified

- `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 point-to-point 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.

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

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

- `vault_token` (optional, jsonobject)
  When present, the payment source has been vaulted. Contains `status` (`active` or `inactive`), `created_at`, and `updated_at` as Unix timestamps in seconds.

- `deleted` (required, boolean)
  Indicates that this resource has been deleted.

- `business_entity_id` (optional, string, max chars=50)
  The unique ID of the [business entity](/docs/api/advanced-features) of this `payment_source`. This is always the same as the business entity of the [customer](/docs/api/payment_sources/payment_source-object#customer_id).

- `card` (optional, card)
  Card details associated with this payment source.
  - `first_name` (optional, string, max chars=50)
    Cardholder's first name
  - `last_name` (optional, string, max chars=50)
    Cardholder's last name
  - `email` (optional, string, max chars=70)
    Email address of the cardholder
  - `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
  - `brand` (required, enumerated string)
    Card brand
    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.
      - `other`
        Card belonging to types other than those listed above.
      - `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.
      - `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.
  - `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.
  - `masked_number` (optional, string, max chars=19)
    Masked credit card number that is safe to show.

- `bank_account` (optional, bank_account)
  Bank account details the direct debit or ACH or NetBanking agreement/mandate created with this payment source.
  - `last4` (required, string, min chars=4, max chars=4)
    Last four digits of the bank account number
  - `name_on_account` (optional, string, max chars=300)
    Account holder's name as per bank account.
  - `first_name` (optional, string, max chars=150)
    Account holder's first name as per bank account.
  - `last_name` (optional, string, max chars=150)
    Account holder's last name as per bank account.
  - `direct_debit_scheme` (optional, enumerated string)
    Bank account's scheme to which the mandate and associated payments are submitted.
    Possible enum values:
      - `ach`
        US Bank Account
      - `bacs`
        Automated payments are at the very centre of the UK's financial system, providing an essential service for both consumers and organisations. Bacs is the company which runs Direct Debit in the UK.
      - `sepa_core`
        SEPA Direct Debit is a Europe-wide Direct Debit system that allows merchants to collect Euro-denominated payments.
      - `autogiro`
        Bg Autogiro is a Direct Debit scheme for collecting Krona-denominated payments from a bank account in Sweden.
      - `becs`
        The Bulk Electronic Clearing System (BECS) is a Direct Debit scheme and followed in Australia for Direct Debit system.
      - `becs_nz`
        The Bulk Electronic Clearing System (BECS) is a Direct Debit scheme and followed in New-Zealand for Direct Debit system.
      - `pad`
        Pre-Authorized Debit (PAD) is the scheme used for collecting Direct Debit payments from customers in Canada.
      - `not_applicable`
        not\_applicable
  - `bank_name` (optional, string, max chars=100)
    Name of account holder's bank.
  - `mandate_id` (optional, string, min chars=1, max chars=50)
    Mandate Id. Applicable for SEPA, BACS, Autogiro, and BECS.
  - `account_type` (optional, enumerated string)
    Represents the account type used to create a payment source. Available for [Authorize.net](https://www.authorize.net/) ACH and Razorpay NetBanking users only. If not passed, account type is taken as null.
    Possible enum values:
      - `checking`
        Checking Account
      - `savings`
        Savings Account
      - `business_checking`
        Business Checking Account
      - `current`
        Current Account
  - `echeck_type` (optional, enumerated string)
    For Authorize.net ACH users only. Indicates the type of eCheck.
    Possible enum values:
      - `web`
        Payment Authorization obtained from the customer via the internet.
      - `ppd`
        Payment Authorization is prearranged between the customer and the merchant.
      - `ccd`
        Payment Authorization agreement from the corporate customer is required. Applicable for business\_checking account\_type.
  - `account_holder_type` (optional, enumerated string)
    For Stripe ACH users only. Indicates the account holder type.
    Possible enum values:
      - `individual`
        Individual Account.
      - `company`
        Company Account.
  - `email` (optional, string, max chars=70)
    Account holder's email address. If not passed, details from customer details will be considered. All Direct Debit compliant emails will be sent to this email address.

- `boleto` (optional, cust_voucher_source)
  Boleto payment source details of the customer
  - `last4` (required, string, min chars=4, max chars=4)
    Last four digits of unique id for voucher payment source ex: tax\_id
  - `first_name` (optional, string, max chars=150)
    Customer first name as per voucher payment source.
  - `last_name` (optional, string, max chars=150)
    Customer last name as per voucher payment source.
  - `email` (optional, string, max chars=70)
    Email address associated Customer's voucher payment source.

- `billing_address` (optional, billing_address)
  Billing address for the payment source.
  - `first_name` (optional, string, max chars=150)
    The first name of the billing contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the billing contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `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 `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` ).
  - `state` (optional, string, max chars=50)
    State or Province
  - `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.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address) .
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `amazon_payment` (optional, amazon_payment)
  Amazon payments details associated with this payment source.
  - `email` (optional, string, max chars=70)
    Email address associated with Amazon payment account
  - `agreement_id` (optional, string, max chars=50)
    Billing agreement id

- `upi` (optional, upi)
  Represents the payment method that allows you to make payments directly using a bank account.
  - `vpa` (optional, string, max chars=100)
    A unique identifier mapped with an individuals bank account to help UPI track the account.

- `paypal` (optional, paypal)
  PayPal Express Checkout details associated with this payment source.
  - `email` (optional, string, max chars=70)
    Email address associated with PayPal Express Checkout
  - `agreement_id` (optional, string, max chars=50)
    Billing agreement id

- `venmo` (optional, venmo)
  Venmo details associated with this payment source.
  - `user_name` (optional, string, max chars=50)
    User name associated with customer's account in Venmo

- `klarna_pay_now` (optional, klarna_pay_now)
  Klarna Pay Now payment source details of the customer
  - `email` (optional, string, max chars=70)
    Email address associated Customer's klarna payment source.

- `mandates` (optional, list of mandate)
  Mandate details associated with the payment source.
  - `id` (required, string, max chars=250)
    A unique mandate identifier used for recurring payments.
  - `subscription_id` (required, string, max chars=50)
    Chargebee's subscription id used to find the mapping between the payment source and the Subscription.
  - `created_at` (required, timestamp(UTC) in seconds)
    Timestamp indicating when the mandate is created

