# Set Default

## `$kit->paymentMethods->setDefault()`

Marks a payment method as the customer's default for future invoices and off-session charges. This is a thin, single-purpose wrapper, use it instead of [`$kit->customers->update()`](/packagist-packages/stripekit/modules/customers/update.md) when this is the only thing you want to change.

## Signature

```php
public function setDefault(string $customerId, string $paymentMethodId): void
```

This method returns nothing. Call [`list()`](/packagist-packages/stripekit/modules/payment-methods/list) afterwards if you need the updated state.

## Example request

```php
$kit->paymentMethods->setDefault('cus_R1a2B3c4D5e6F7', 'pm_2Q0l3L3fAwLZmp3D4example');
```

## Errors

| Exception | When |
| --- | --- |
| `StripeOperationError` | The customer ID or payment method ID does not exist, or the payment method is not attached to that customer. |

## Notes

- The payment method must already be attached to the customer via [`attach()`](/packagist-packages/stripekit/modules/payment-methods/attach) before it can be set as default.