Assign payment roles via API
Problem Statement
You want to assign payment roles (Primary, Backup) for a customer's payment methods.
Related Scenarios
- How to assign payment roles for a customer?
- Can we assign payment roles for a subscription via API?
Solution
You can change payment roles for a customer's payment methods from the UI or via API.
Prerequisites
The customer must have at least 2 payment methods to set one as Primary and one as Backup.
Configuration Steps
From UI
- Open Chargebee and go to Customer.
- Go to Payment methods.
- Click the three ellipsis (⋮) for the payment method you want to mark as Primary.
- Click Mark Primary or Mark Secondary.
For a video tutorial, see Assign payment roles.
From API
Use the Assign payment role API to mark a payment method as Primary or Backup.
Required parameters:
- payment_source_id: The payment source ID to assign the role to
- role:
primary,backup, ornone
Was this article helpful?