Docs
This article explains how to get notified when a payment method is added or updated for a customer, and how to assign payment roles (primary or backup) when this happens.
Use webhooks to listen for payment_source_added and payment_source_updated events. When these events occur, extract the payment method ID and customer ID from the payload, then call the Assign payment role API to set the role (primary, backup, or none).
payment_source_id and customer_id.primary, backup, or noneWas this article helpful?