$kit->paymentMethods->attach()| Field | Type | Required | Description |
|---|---|---|---|
paymentMethodId | string | Yes | The Stripe payment method ID to attach, for example pm_.... |
customerId | string | Yes | The customer to attach it to. |
setAsDefault | bool | No, defaults to false | If true, also sets this payment method as the customer's default via invoice_settings.default_payment_method. |
| Exception | When |
|---|---|
StripeOperationError | The payment method is already attached to a different customer, the ID does not exist, or Stripe otherwise rejects the request. |
isDefault in the response only reflects setAsDefault from this call, not the customer's actual current default in Stripe. Call list() if you need the true default status alongside every other saved method.