Skip to content

Charge your default card for all your subscriptions

The portal.payment_methods.use_for_subscriptions operation: POST /api/v1/portal/me/payment_methods/{paymentMethodId}/use_for_subscriptions in the REST API and the portal_payment_methods_use_for_subscriptions tool in the MCP server.

POST/api/v1/portal/me/payment_methods/{paymentMethodId}/use_for_subscriptions

Switches every running, card-charged subscription of the signed-in customer that charges another card to their default card (paymentMethodId, the default card they saw): from then on each charges the default card, also after the default changes again. A past-due invoice is retried with it at once. Subscriptions paid by bank transfer, ended ones and those the brand's portal settings don't let you change are left as they are. Returns the subscriptions it switched (none when every subscription already charges the default card). Customer portal only (portal:write).

At a glance

  • REST: POST /api/v1/portal/me/payment_methods/{paymentMethodId}/use_for_subscriptions
  • MCP tool: portal_payment_methods_use_for_subscriptions
  • Operation ID: portal.payment_methods.use_for_subscriptions
  • Scope: Brand
  • Permission: portal:write
  • Risk tier: write
  • Dry run: Not supported
  • Idempotency: Idempotency-Key required
  • Modes: Test and live
  • Authentication: A customer signed in to the customer portal (API keys can't call it)
  • Since: M13

Request

Path parameters

FieldTypeDescription
paymentMethodIdpm_… IDYour default card (pm_…), as you saw it.

Body

This operation takes no body.

Response

200 OK with a JSON object:

FieldTypeDescription
object"list"
dataarray of object
data[].idsub_… ID
data[].object"portal_subscription"
data[].statusone of incomplete, incomplete_expired, trialing, active, past_due, unpaid, paused, canceled
data[].currencystring
data[].itemsarray of object
data[].items[].priceIdprice_… ID
data[].items[].productIdprod_… ID
data[].items[].productNamestring
data[].items[].priceNamestring or nullThe price's nickname, e.g. “Pro, monthly”.
data[].items[].intervalobject
data[].items[].interval.intervalone of day, week, month, year
data[].items[].interval.intervalCountinteger
data[].items[].usageTypeone of licensed, metered
data[].items[].unitAmountmoney or nullA per-unit price's amount per unit and period (null for tiered and metered prices).
data[].items[].taxBehaviorone of inclusive, exclusiveexclusive: tax is added on the invoice.
data[].items[].idsi_… ID
data[].items[].quantityinteger
data[].items[].amountmoney or nullThe item's full-period amount at its quantity, before discounts (null for metered items).
data[].collectionMethodone of charge_automatically, send_invoicecharge_automatically (your card is charged) or send_invoice (paid by bank transfer).
data[].paymentMethodIdpm_… ID or nullThe card this subscription charges (null: your default card).
data[].currentPeriodStartdate-time
data[].currentPeriodEnddate-time
data[].trialEnddate-time or null
data[].cancelAtPeriodEndboolean
data[].cancelAtdate-time or null
data[].canceledAtdate-time or null
data[].endedAtdate-time or null
data[].cancellationobject or null
data[].discountsarray of object
data[].discounts[].iddisc_… ID
data[].discounts[].namestringThe coupon's name.
data[].discounts[].percentOffPpmstring or nullParts per million as a string (20% = "200000").
data[].discounts[].amountOffmoney or null
data[].discounts[].startdate-time
data[].discounts[].enddate-time or nullWhen it stops applying (null: for as long as the subscription runs).
data[].scheduledChangeobject or nullA change that applies at effectiveAt (a downgrade waits for the period end).
data[].actionsobjectWhat you can do with this subscription now, as the brand's portal settings allow.
data[].actions.switch_planboolean
data[].actions.change_quantityboolean
data[].actions.apply_promotion_codeboolean
data[].actions.cancelboolean
data[].actions.reactivateboolean
data[].actions.change_payment_methodboolean
data[].cancelBehaviorone of period_end, immediateHow cancelling here ends the subscription.
data[].collectCancelReasonbooleanCancelling asks why (optional answers).
data[].versionintegerSend it back as expectedVersion to change what you saw.
data[].createdAtdate-time

Examples

Use the card you just added for your subscriptions

HTTP
POST /api/v1/portal/me/payment_methods/pm_01m4tx5nj8emwbyf7y9vcf48cb/use_for_subscriptions
Authorization: Bearer or_test_…
Idempotency-Key: 3f1c9a52-7d0e-4b8f-9a61-0c2d5e8b7f14

Response (200):

JSON
{
  "object": "list",
  "data": [
    {
      "id": "sub_01m4tx5nj8emwbyf7y9vcf48c0",
      "object": "portal_subscription",
      "status": "active",
      "currency": "EUR",
      "items": [
        {
          "priceId": "price_01m4tx5nj8emwbyf7y9vcf48c2",
          "productId": "prod_01m4tx5nj8emwbyf7y9vcf48c4",
          "productName": "Genno Plus",
          "priceName": "Plus, monthly",
          "interval": {
            "interval": "month",
            "intervalCount": 1
          },
          "usageType": "licensed",
          "unitAmount": {
            "amount": "9000000",
            "currency": "EUR"
          },
          "taxBehavior": "inclusive",
          "id": "si_01m4tx5nj8emwbyf7y9vcf48c1",
          "quantity": 1,
          "amount": {
            "amount": "9000000",
            "currency": "EUR"
          }
        }
      ],
      "collectionMethod": "charge_automatically",
      "paymentMethodId": null,
      "currentPeriodStart": "2026-10-20T09:00:00.000Z",
      "currentPeriodEnd": "2026-11-20T10:00:00.000Z",
      "trialEnd": null,
      "cancelAtPeriodEnd": false,
      "cancelAt": null,
      "canceledAt": null,
      "endedAt": null,
      "cancellation": null,
      "discounts": [],
      "scheduledChange": null,
      "actions": {
        "switch_plan": true,
        "change_quantity": false,
        "apply_promotion_code": true,
        "cancel": true,
        "reactivate": false,
        "change_payment_method": true
      },
      "cancelBehavior": "period_end",
      "collectCancelReason": true,
      "version": 5,
      "createdAt": "2026-09-20T09:00:00.000Z"
    }
  ]
}

Errors

CodeHTTP statusWhenWhat to do
validation_failed400The payment method's ID is malformed.Fix the fields listed in details.issues and send the request again.
subscription_payment_method_invalid400The card isn't your default card (any more), or it was removed: reload your payment methods.Use a saved payment method (pm_…) of the subscription's customer that isn't detached, or leave it out to use the customer's default.
version_conflict409One of your subscriptions changed at the same moment; retry.Fetch the object again and retry the change.
livemode_not_allowed403The portal session is in the other mode than the request.Use test mode, or credentials for the target's mode. Developers need live access granted by an organization owner or admin.
permission_denied403The caller isn't a customer signed in to this brand's portal (operators and API keys use the subscription and wallet operations).Ask an organization owner or admin for a role or scope that allows this action.

It can also return these common errors: api_version_unsupported, invalid_json, unsupported_media_type, authentication_required, api_key_invalid, scope_required, resource_not_found, idempotency_key_required, idempotency_key_reused, idempotency_in_progress, dry_run_not_supported, rate_limited, internal_error.