Introducing OpenTelemetry for Chargebee SDKs — trace every API call in any telemetry tool.
Chargebeechargebee API

Create a card payment source

Sample Request

Sample Result[JSON]

URL Format

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

Input Parameters

customer_id
required, string, max chars=50

Identifier of the customer with whom this payment source is associated.

brand_id
optional, string, max chars=50

The unique ID of the brand this payment source should be linked to. Applicable only when multiple brands have been created for the site. This need not match the brand of the customer_id; when the two differ, the value provided here is used for the payment source. An alternative way of passing this parameter is by means of the chargebee-brand-id custom HTTP header; when both are provided, they must specify the same brand.

Default behavior

  • When not provided, the payment source is linked to the brand of the customer it is created for.
replace_primary_payment_source
optional, boolean, default=false

Indicates whether the primary payment source should be replaced with this payment source. In case of Create Subscription for Customer endpoint, the default value is True. Otherwise, the default value is False.

card
Parameters for card
pass parameters as card[<param name>]

Returns

Customer object

Resource object representing customer

Payment source object

Resource object representing payment_source