Get notified when payment method is added/updated.

Modified on: Mon, 10 Oct, 2022 at 5:17 PM

This article covers 

How to assign payment roles for a customer when a payment method is added or updated?

How can we get notified if a customer adds a payment method?




This article will help you with getting notified when a payment method is added or changed for a customer.




You need a server to receive the webhooks to be able to listen to the events sent by Chargebee.

Refer to to create webhooks in Chargebee.


If you have selected only a few events while creating a webhook, make sure to select Payment source added and payment source updated events as well.


Extract the Payment method ID and customer id from the above events.


Make an assign payment roles API call to assign the payment role as required.

You can make use of the 
Assign payment Role API call to mark a payment method as Primary or back-up using API. It is necessary to pass the below parameters

Payment_source_id : Payment source id this role will be assigned to.

Role : 
primary, backup,none.

Related articles and Documentation

Assign Payment roles via API


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.