Resolve which provider a payment would use
Answers “which provider would this use?” without creating anything. The provider is chosen in this order: the customer’s own payment_provider, then the first matching routing rule, then the account default. reason says which step decided, and matched_rule names the rule. Needs providers:read.
Authentication
A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.
Request
The plan (ID or key).
top_up buys credits, subscription starts a plan, payment_method saves a card for postpaid invoices.
Response
customer_override: the customer has a payment_provider. routing_rule: the first matching rule chose it. account_default: nothing else matched.
The routing rule that decided. Only when reason is routing_rule.