# StripeResource.WithListenExternalService

- Module: [CommunityToolkit.Aspire.Hosting.Stripe](/reference/api/go/communitytoolkit.aspire.hosting.stripe.md)
- Defined on: [StripeResource](/reference/api/go/communitytoolkit.aspire.hosting.stripe/striperesource.md)
- Version: `13.6.1`
- Kind: `method`

Configures the Stripe CLI to listen for webhooks and forward them to the specified URL expression.

## Definition

```go
type StripeResource interface {
    // ... omitted for brevity
    WithListenExternalService(
        forwardTo ExternalServiceResource,
        options ...*WithListenExternalServiceOptions,
    ) StripeResource
}
```

## Signature

```go
WithListenExternalService(
    forwardTo ExternalServiceResource,
    options ...*WithListenExternalServiceOptions,
) StripeResource
```

## Parameters

- `forwardTo` (`ExternalServiceResource`) -- The resource to forward webhooks to.
- `options` (`...*WithListenExternalServiceOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithListenExternalServiceOptions` argument.

- `WebhookPath` (`*string`) -- The path to the webhook endpoint.
- `Events` (`[]string`) -- Optional collection of specific webhook events to listen for (e.g., ["payment_intent.created", "charge.succeeded"]). If not specified, all events are forwarded.

## Returns

[`StripeResource`](/reference/api/go/communitytoolkit.aspire.hosting.stripe/striperesource.md) -- A reference to the `IResourceBuilder`.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [StripeResource](/reference/api/go/communitytoolkit.aspire.hosting.stripe/striperesource.md) -- `handle`
