# Sync

## `$kit->subscriptions->sync()`

Re-fetches a subscription from Stripe and persists it via your storage adapter's `saveSubscription()`.

## Signature

```php
public function sync(string $subscriptionId, string|int|null $userId = null): array
```

## Example request

```php
$kit->subscriptions->sync('sub_1P9k2K2eZvKYlo2Cexample', 482);
```

## Example response

Same shape as [`retrieve()`](/packagist-packages/stripekit/modules/subscriptions/retrieve), with `userId` set to whatever you passed in.

## Notes

- Called automatically by StripeKit's webhook processing for `customer.subscription.created`, `customer.subscription.updated` and `customer.subscription.deleted` when `autoSync` is not disabled. See [Webhooks](/packagist-packages/stripekit/modules/webhooks/process).