***

title: "StripePluginOptions"
generated: true
---------------

<GenerationInfo sourceFile="packages/stripe-plugin/src/types.ts" sourceLine="28" packageName="@vendure-community/stripe-plugin" />

Configuration options for the Stripe payments plugin.

```ts title="Signature"
interface StripePluginOptions {
    storeCustomersInStripe?: boolean;
    metadata?: (
        injector: Injector,
        ctx: RequestContext,
        order: Order,
    ) => Stripe.MetadataParam | Promise<Stripe.MetadataParam>;
    paymentIntentCreateParams?: (
        injector: Injector,
        ctx: RequestContext,
        order: Order,
    ) => AdditionalPaymentIntentCreateParams | Promise<AdditionalPaymentIntentCreateParams>;
    requestOptions?: (
        injector: Injector,
        ctx: RequestContext,
        order: Order,
    ) => AdditionalRequestOptions | Promise<AdditionalRequestOptions>;
    customerCreateParams?: (
        injector: Injector,
        ctx: RequestContext,
        order: Order,
    ) => AdditionalCustomerCreateParams | Promise<AdditionalCustomerCreateParams>;
    skipPaymentIntentsWithoutExpectedMetadata?: boolean;
}
```

<div className="members-wrapper">

### storeCustomersInStripe

\<MemberInfo kind="property" type={`boolean`} default={`false`}   />

If set to `true`, a [Customer](https://stripe.com/docs/api/customers) object will be created in Stripe - if
it doesn't already exist - for authenticated users, which prevents payment methods attached to other Customers
to be used with the same PaymentIntent. This is done by adding a custom field to the Customer entity to store
the Stripe customer ID, so switching this on will require a database migration / synchronization.

### metadata

\<MemberInfo kind="property" type={`(         injector: Injector,         ctx: RequestContext,         order: Order,     ) => Stripe.MetadataParam | Promise<Stripe.MetadataParam>`}  since="1.9.7"  />

Attach extra metadata to Stripe payment intent creation call.

*Example*

```ts
import { EntityHydrator, VendureConfig } from '@vendure/core';
import { StripePlugin } from '@vendure-community/stripe-plugin';

export const config: VendureConfig = {
  // ...
  plugins: [
    StripePlugin.init({
      metadata: async (injector, ctx, order) => {
        const hydrator = injector.get(EntityHydrator);
        await hydrator.hydrate(ctx, order, { relations: ['customer'] });
        return {
          description: `Order #${order.code} for ${order.customer!.emailAddress}`
        },
      }
    }),
  ],
};
```

Note: If the `paymentIntentCreateParams` is also used and returns a `metadata` key, then the values
returned by both functions will be merged.

### paymentIntentCreateParams

\<MemberInfo kind="property" type={`(         injector: Injector,         ctx: RequestContext,         order: Order,     ) => AdditionalPaymentIntentCreateParams | Promise<AdditionalPaymentIntentCreateParams>`}  since="2.1.0"  />

Provide additional parameters to the Stripe payment intent creation. By default,
the plugin will already pass the `amount`, `currency`, `customer` and `automatic_payment_methods: { enabled: true }` parameters.

For example, if you want to provide a `description` for the payment intent, you can do so like this:

*Example*

```ts
import { VendureConfig } from '@vendure/core';
import { StripePlugin } from '@vendure-community/stripe-plugin';

export const config: VendureConfig = {
  // ...
  plugins: [
    StripePlugin.init({
      paymentIntentCreateParams: (injector, ctx, order) => {
        return {
          description: `Order #${order.code} for ${order.customer?.emailAddress}`
        },
      }
    }),
  ],
};
```

### requestOptions

\<MemberInfo kind="property" type={`(         injector: Injector,         ctx: RequestContext,         order: Order,     ) => AdditionalRequestOptions | Promise<AdditionalRequestOptions>`}  since="3.1.0"  />

Provide additional options to the Stripe payment intent creation. By default,
the plugin will already pass the `idempotencyKey` parameter.

For example, if you want to provide a `stripeAccount` for the payment intent, you can do so like this:

*Example*

```ts
import { VendureConfig } from '@vendure/core';
import { StripePlugin } from '@vendure-community/stripe-plugin';

export const config: VendureConfig = {
  // ...
  plugins: [
    StripePlugin.init({
      requestOptions: (injector, ctx, order) => {
        return {
          stripeAccount: ctx.channel.seller?.customFields.connectedAccountId
        },
      }
    }),
  ],
};
```

### customerCreateParams

\<MemberInfo kind="property" type={`(         injector: Injector,         ctx: RequestContext,         order: Order,     ) => AdditionalCustomerCreateParams | Promise<AdditionalCustomerCreateParams>`}  since="2.1.0"  />

Provide additional parameters to the Stripe customer creation. By default,
the plugin will already pass the `email` and `name` parameters.

For example, if you want to provide an address for the customer:

*Example*

```ts
import { EntityHydrator, VendureConfig } from '@vendure/core';
import { StripePlugin } from '@vendure-community/stripe-plugin';

export const config: VendureConfig = {
  // ...
  plugins: [
    StripePlugin.init({
      storeCustomersInStripe: true,
      customerCreateParams: async (injector, ctx, order) => {
        const entityHydrator = injector.get(EntityHydrator);
        const customer = order.customer;
        await entityHydrator.hydrate(ctx, customer, { relations: ['addresses'] });
        const defaultBillingAddress = customer.addresses.find(a => a.defaultBillingAddress) ?? customer.addresses[0];
        return {
          address: {
              line1: defaultBillingAddress.streetLine1 || order.shippingAddress?.streetLine1,
              postal_code: defaultBillingAddress.postalCode || order.shippingAddress?.postalCode,
              city: defaultBillingAddress.city || order.shippingAddress?.city,
              state: defaultBillingAddress.province || order.shippingAddress?.province,
              country: defaultBillingAddress.country.code || order.shippingAddress?.countryCode,
          },
        },
      }
    }),
  ],
};
```

### skipPaymentIntentsWithoutExpectedMetadata

\<MemberInfo kind="property" type={`boolean`}   />

If your Stripe account also generates payment intents which are independent of Vendure orders, you can set this
to `true` to skip processing those payment intents.

</div>
