Docs

Log into read the version of docs relevant to your site.

Assign payment roles via API

Problem Statement

You want to assign payment roles (Primary, Backup) for a customer's payment methods.

  • 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

  1. Open Chargebee and go to Customer.
  2. Go to Payment methods.
  3. Click the three ellipsis (⋮) for the payment method you want to mark as Primary.
  4. 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, or none

Was this article helpful?