> ## Documentation Index
> Fetch the complete documentation index at: https://docs.secapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# PUT /v1/billing/payment-methods/{id}

> Set a saved payment method as primary and/or change its auto-top-up fallback priority

Set a saved payment method as primary and/or change its auto-top-up fallback priority

<Info>
  Audience: application and coding agent.
</Info>

## Request body

Send `isPrimary`, `priority`, or both. Unknown fields return `400 validation_error`, so typos such as `isPrimarry` fail before any payment-method side effect.

## Canonical metadata

* `requestId`
* `traceparent`

## Example request

<RequestExample>
  ```bash theme={null}
  curl -X PUT \
    -H "Authorization: Bearer $SECAPI_BEARER_TOKEN" \
    -H "secapi-version: 2026-03-19" \
    -H "content-type: application/json" \
    -d '{"isPrimary":true}' \
    "https://api.secapi.ai/v1/billing/payment-methods/pm_example_123"
  ```
</RequestExample>

<Info>
  Payment-method management requires a WorkOS bearer session with `billing:manage`. API keys are rejected so saved payment methods stay limited to interactive billing administrators.
</Info>

## Example response

<ResponseExample>
  ```json theme={null}
  {
    "requestId": "req_2ZK8Q1W9F4M6P7R3"
  }
  ```
</ResponseExample>

## Give this prompt to your agent

<Prompt>
  Use SEC API PUT /v1/billing/payment-methods/{id} to set a saved payment method as primary and/or change its auto-top-up fallback priority. Preserve `requestId`, `traceparent` in the output. Return a concise markdown summary plus the exact structured payload fields that a downstream engineer or agent should keep using this result.
</Prompt>

## Failure posture

* treat non-2xx responses as contract-aware failures, not free-form errors
* preserve `requestId` and `traceparent` in logs and downstream reports
* if provenance or freshness metadata is present, return it unchanged so trust is not lost in the handoff
