Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.Try now
ChargebeeAPI

Create using Chargebee token

Idempotency Supported

Sample Request

Sample Result[JSON]

URL Format

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

Input Parameters

customer_id
required, string, max chars=50

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

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.

token_id
required, string, max chars=40

Token generated by Chargebee JS representing payment method details.

Returns

Customer object
Resource object representing customer
Payment source object
Resource object representing payment_source