ChargebeeAPI

Payment sources

Updates

This API obsoletes the Cards API 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. See Payment source attributes for a descriptive list of attributes and payment source types.

Sample Payment sourceJSON

API Index URL

https://[site].chargebee.com/api/v2/payment_sources

Payment sources attributes

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.

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.

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) ISO country code.

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 of this payment_source. This is always the same as the business entity of the customer.

card

Object of parameters for card

bank_account

Object of parameters for bank_account

boleto

Object of parameters for boleto

billing_address

Object of parameters for billing_address

amazon_payment

Object of parameters for amazon_payment

upi

Object of parameters for upi

paypal

Object of parameters for paypal

venmo

Object of parameters for venmo

klarna_pay_now

Object of parameters for klarna_pay_now

mandates

Array containing object of parameters for mandates