Repository: stripe/stripe-node
Pull request #1124 (2021-02-19 20:03:00)

API Updates
Codegen for openapi 403fdb8.
r? @richardm-stripe
cc @stripe/api-libraries

## Changelog
* Added support for new resource `BillingPortal.Configuration`
* Added support for `configuration` and `on_behalf_of` on `BillingPortal.SessionCreateParams` and `BillingPortal.Session`
* Add support for ``billing_portal.configuration.created` and billing_portal.configuration.updated` as enum members on `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`. 
* `Terminal.LocationUpdateParams.country` is now optional.





Patch:
diff --git a/lib/resources.js b/lib/resources.js
index 3ae0948b..824f71f5 100644
--- a/lib/resources.js
+++ b/lib/resources.js
@@ -53,6 +53,7 @@ module.exports = {
   Transfers: require('./resources/Transfers'),
   WebhookEndpoints: require('./resources/WebhookEndpoints'),
   BillingPortal: resourceNamespace('billingPortal', {
+    Configurations: require('./resources/BillingPortal/Configurations'),
     Sessions: require('./resources/BillingPortal/Sessions'),
   }),
   Checkout: resourceNamespace('checkout', {
diff --git a/lib/resources/BillingPortal/Configurations.js b/lib/resources/BillingPortal/Configurations.js
new file mode 100644
index 00000000..025410c2
--- /dev/null
+++ b/lib/resources/BillingPortal/Configurations.js
@@ -0,0 +1,11 @@
+// File generated from our OpenAPI spec
+
+'use strict';
+
+const StripeResource = require('../../StripeResource');
+
+module.exports = StripeResource.extend({
+  path: 'billing_portal/configurations',
+
+  includeBasic: ['create', 'retrieve', 'update', 'list'],
+});
diff --git a/types/2020-08-27/BillingPortal/Configurations.d.ts b/types/2020-08-27/BillingPortal/Configurations.d.ts
new file mode 100644
index 00000000..347e487c
--- /dev/null
+++ b/types/2020-08-27/BillingPortal/Configurations.d.ts
@@ -0,0 +1,628 @@
+// File generated from our OpenAPI spec
+
+declare module 'stripe' {
+  namespace Stripe {
+    namespace BillingPortal {
+      /**
+       * The Configuration object.
+       */
+      interface Configuration {
+        /**
+         * Unique identifier for the object.
+         */
+        id: string;
+
+        /**
+         * String representing the object's type. Objects of the same type share the same value.
+         */
+        object: 'billing_portal.configuration';
+
+        /**
+         * Whether the configuration is active and can be used to create portal sessions.
+         */
+        active: boolean;
+
+        /**
+         * ID of the Connect Application that created the configuration.
+         */
+        application: string | null;
+
+        business_profile: Configuration.BusinessProfile;
+
+        /**
+         * Time at which the object was created. Measured in seconds since the Unix epoch.
+         */
+        created: number;
+
+        /**
+         * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
+         */
+        default_return_url: string | null;
+
+        features: Configuration.Features;
+
+        /**
+         * Whether the configuration is the default. If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session.
+         */
+        is_default: boolean;
+
+        /**
+         * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
+         */
+        livemode: boolean;
+
+        /**
+         * Time at which the object was last updated. Measured in seconds since the Unix epoch.
+         */
+        updated: number;
+      }
+
+      namespace Configuration {
+        interface BusinessProfile {
+          /**
+           * The messaging shown to customers in the portal.
+           */
+          headline: string | null;
+
+          /**
+           * A link to the business's publicly available privacy policy.
+           */
+          privacy_policy_url: string;
+
+          /**
+           * A link to the business's publicly available terms of service.
+           */
+          terms_of_service_url: string;
+        }
+
+        interface Features {
+          customer_update: Features.CustomerUpdate;
+
+          invoice_history: Features.InvoiceHistory;
+
+          payment_method_update: Features.PaymentMethodUpdate;
+
+          subscription_cancel: Features.SubscriptionCancel;
+
+          subscription_update: Features.SubscriptionUpdate;
+        }
+
+        namespace Features {
+          interface CustomerUpdate {
+            /**
+             * The types of customer updates that are supported. When empty, customers are not updateable.
+             */
+            allowed_updates: Array<CustomerUpdate.AllowedUpdate>;
+
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          namespace CustomerUpdate {
+            type AllowedUpdate =
+              | 'address'
+              | 'email'
+              | 'phone'
+              | 'shipping'
+              | 'tax_id';
+          }
+
+          interface InvoiceHistory {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          interface PaymentMethodUpdate {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          interface SubscriptionCancel {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+
+            /**
+             * Whether to cancel subscriptions immediately or at the end of the billing period.
+             */
+            mode: SubscriptionCancel.Mode;
+
+            /**
+             * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`.
+             */
+            proration_behavior: SubscriptionCancel.ProrationBehavior;
+          }
+
+          namespace SubscriptionCancel {
+            type Mode = 'at_period_end' | 'immediately';
+
+            type ProrationBehavior =
+              | 'always_invoice'
+              | 'create_prorations'
+              | 'none';
+          }
+
+          interface SubscriptionUpdate {
+            /**
+             * The types of subscription updates that are supported for items listed in the `products` attribute. When empty, subscriptions are not updateable.
+             */
+            default_allowed_updates: Array<
+              SubscriptionUpdate.DefaultAllowedUpdate
+            >;
+
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+
+            /**
+             * The list of products that support subscription updates.
+             */
+            products: Array<SubscriptionUpdate.Product> | null;
+
+            /**
+             * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
+             */
+            proration_behavior: SubscriptionUpdate.ProrationBehavior;
+          }
+
+          namespace SubscriptionUpdate {
+            type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity';
+
+            interface Product {
+              /**
+               * The list of price IDs which, when subscribed to, a subscription can be updated.
+               */
+              prices: Array<string>;
+
+              /**
+               * The product ID.
+               */
+              product: string;
+            }
+
+            type ProrationBehavior =
+              | 'always_invoice'
+              | 'create_prorations'
+              | 'none';
+          }
+        }
+      }
+
+      interface ConfigurationCreateParams {
+        /**
+         * The business information shown to customers in the portal.
+         */
+        business_profile: ConfigurationCreateParams.BusinessProfile;
+
+        /**
+         * Information about the features available in the portal.
+         */
+        features: ConfigurationCreateParams.Features;
+
+        /**
+         * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
+         */
+        default_return_url?: Stripe.Emptyable<string>;
+
+        /**
+         * Specifies which fields in the response should be expanded.
+         */
+        expand?: Array<string>;
+      }
+
+      namespace ConfigurationCreateParams {
+        interface BusinessProfile {
+          /**
+           * The messaging shown to customers in the portal.
+           */
+          headline?: string;
+
+          /**
+           * A link to the business's publicly available privacy policy.
+           */
+          privacy_policy_url: string;
+
+          /**
+           * A link to the business's publicly available terms of service.
+           */
+          terms_of_service_url: string;
+        }
+
+        interface Features {
+          /**
+           * Information about updating the customer details in the portal.
+           */
+          customer_update?: Features.CustomerUpdate;
+
+          /**
+           * Information about showing the billing history in the portal.
+           */
+          invoice_history?: Features.InvoiceHistory;
+
+          /**
+           * Information about updating payment methods in the portal.
+           */
+          payment_method_update?: Features.PaymentMethodUpdate;
+
+          /**
+           * Information about canceling subscriptions in the portal.
+           */
+          subscription_cancel?: Features.SubscriptionCancel;
+
+          /**
+           * Information about updating subscriptions in the portal.
+           */
+          subscription_update?: Features.SubscriptionUpdate;
+        }
+
+        namespace Features {
+          interface CustomerUpdate {
+            /**
+             * The types of customer updates that are supported. When empty, customers are not updateable.
+             */
+            allowed_updates: Stripe.Emptyable<
+              Array<CustomerUpdate.AllowedUpdate>
+            >;
+
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          namespace CustomerUpdate {
+            type AllowedUpdate =
+              | 'address'
+              | 'email'
+              | 'phone'
+              | 'shipping'
+              | 'tax_id';
+          }
+
+          interface InvoiceHistory {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          interface PaymentMethodUpdate {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          interface SubscriptionCancel {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+
+            /**
+             * Whether to cancel subscriptions immediately or at the end of the billing period.
+             */
+            mode?: SubscriptionCancel.Mode;
+
+            /**
+             * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period.
+             */
+            proration_behavior?: SubscriptionCancel.ProrationBehavior;
+          }
+
+          namespace SubscriptionCancel {
+            type Mode = 'at_period_end' | 'immediately';
+
+            type ProrationBehavior =
+              | 'always_invoice'
+              | 'create_prorations'
+              | 'none';
+          }
+
+          interface SubscriptionUpdate {
+            /**
+             * The types of subscription updates that are supported. When empty, subscriptions are not updateable.
+             */
+            default_allowed_updates: Stripe.Emptyable<
+              Array<SubscriptionUpdate.DefaultAllowedUpdate>
+            >;
+
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+
+            /**
+             * The list of products that support subscription updates.
+             */
+            products: Stripe.Emptyable<Array<SubscriptionUpdate.Product>>;
+
+            /**
+             * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
+             */
+            proration_behavior?: SubscriptionUpdate.ProrationBehavior;
+          }
+
+          namespace SubscriptionUpdate {
+            type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity';
+
+            interface Product {
+              /**
+               * The list of prices IDs that a subscription can be updated to.
+               */
+              prices: Array<string>;
+
+              /**
+               * The product id.
+               */
+              product: string;
+            }
+
+            type ProrationBehavior =
+              | 'always_invoice'
+              | 'create_prorations'
+              | 'none';
+          }
+        }
+      }
+
+      interface ConfigurationRetrieveParams {
+        /**
+         * Specifies which fields in the response should be expanded.
+         */
+        expand?: Array<string>;
+      }
+
+      interface ConfigurationUpdateParams {
+        /**
+         * Whether the configuration is active and can be used to create portal sessions.
+         */
+        active?: boolean;
+
+        /**
+         * The business information shown to customers in the portal.
+         */
+        business_profile?: ConfigurationUpdateParams.BusinessProfile;
+
+        /**
+         * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
+         */
+        default_return_url?: Stripe.Emptyable<string>;
+
+        /**
+         * Specifies which fields in the response should be expanded.
+         */
+        expand?: Array<string>;
+
+        /**
+         * Information about the features available in the portal.
+         */
+        features?: ConfigurationUpdateParams.Features;
+      }
+
+      namespace ConfigurationUpdateParams {
+        interface BusinessProfile {
+          /**
+           * The messaging shown to customers in the portal.
+           */
+          headline?: string;
+
+          /**
+           * A link to the business's publicly available privacy policy.
+           */
+          privacy_policy_url?: string;
+
+          /**
+           * A link to the business's publicly available terms of service.
+           */
+          terms_of_service_url?: string;
+        }
+
+        interface Features {
+          /**
+           * Information about updating the customer details in the portal.
+           */
+          customer_update?: Features.CustomerUpdate;
+
+          /**
+           * Information about showing the billing history in the portal.
+           */
+          invoice_history?: Features.InvoiceHistory;
+
+          /**
+           * Information about updating payment methods in the portal.
+           */
+          payment_method_update?: Features.PaymentMethodUpdate;
+
+          /**
+           * Information about canceling subscriptions in the portal.
+           */
+          subscription_cancel?: Features.SubscriptionCancel;
+
+          /**
+           * Information about updating subscriptions in the portal.
+           */
+          subscription_update?: Features.SubscriptionUpdate;
+        }
+
+        namespace Features {
+          interface CustomerUpdate {
+            /**
+             * The types of customer updates that are supported. When empty, customers are not updateable.
+             */
+            allowed_updates?: Stripe.Emptyable<
+              Array<CustomerUpdate.AllowedUpdate>
+            >;
+
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled?: boolean;
+          }
+
+          namespace CustomerUpdate {
+            type AllowedUpdate =
+              | 'address'
+              | 'email'
+              | 'phone'
+              | 'shipping'
+              | 'tax_id';
+          }
+
+          interface InvoiceHistory {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          interface PaymentMethodUpdate {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled: boolean;
+          }
+
+          interface SubscriptionCancel {
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled?: boolean;
+
+            /**
+             * Whether to cancel subscriptions immediately or at the end of the billing period.
+             */
+            mode?: SubscriptionCancel.Mode;
+
+            /**
+             * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period.
+             */
+            proration_behavior?: SubscriptionCancel.ProrationBehavior;
+          }
+
+          namespace SubscriptionCancel {
+            type Mode = 'at_period_end' | 'immediately';
+
+            type ProrationBehavior =
+              | 'always_invoice'
+              | 'create_prorations'
+              | 'none';
+          }
+
+          interface SubscriptionUpdate {
+            /**
+             * The types of subscription updates that are supported. When empty, subscriptions are not updateable.
+             */
+            default_allowed_updates?: Stripe.Emptyable<
+              Array<SubscriptionUpdate.DefaultAllowedUpdate>
+            >;
+
+            /**
+             * Whether the feature is enabled.
+             */
+            enabled?: boolean;
+
+            /**
+             * The list of products that support subscription updates.
+             */
+            products?: Stripe.Emptyable<Array<SubscriptionUpdate.Product>>;
+
+            /**
+             * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
+             */
+            proration_behavior?: SubscriptionUpdate.ProrationBehavior;
+          }
+
+          namespace SubscriptionUpdate {
+            type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity';
+
+            interface Product {
+              /**
+               * The list of prices IDs that a subscription can be updated to.
+               */
+              prices: Array<string>;
+
+              /**
+               * The product id.
+               */
+              product: string;
+            }
+
+            type ProrationBehavior =
+              | 'always_invoice'
+              | 'create_prorations'
+              | 'none';
+          }
+        }
+      }
+
+      interface ConfigurationListParams extends PaginationParams {
+        /**
+         * Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations).
+         */
+        active?: boolean;
+
+        /**
+         * Specifies which fields in the response should be expanded.
+         */
+        expand?: Array<string>;
+
+        /**
+         * Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration).
+         */
+        is_default?: boolean;
+      }
+
+      class ConfigurationsResource {
+        /**
+         * Creates a configuration that describes the functionality and behavior of a PortalSession
+         */
+        create(
+          params: ConfigurationCreateParams,
+          options?: RequestOptions
+        ): Promise<Stripe.Response<Stripe.BillingPortal.Configuration>>;
+
+        /**
+         * Retrieves a configuration that describes the functionality of the customer portal.
+         */
+        retrieve(
+          id: string,
+          params?: ConfigurationRetrieveParams,
+          options?: RequestOptions
+        ): Promise<Stripe.Response<Stripe.BillingPortal.Configuration>>;
+        retrieve(
+          id: string,
+          options?: RequestOptions
+        ): Promise<Stripe.Response<Stripe.BillingPortal.Configuration>>;
+
+        /**
+         * Updates a configuration that describes the functionality of the customer portal.
+         */
+        update(
+          id: string,
+          params?: ConfigurationUpdateParams,
+          options?: RequestOptions
+        ): Promise<Stripe.Response<Stripe.BillingPortal.Configuration>>;
+
+        /**
+         * Returns a list of configurations that describe the functionality of the customer portal.
+         */
+        list(
+          params?: ConfigurationListParams,
+          options?: RequestOptions
+        ): ApiListPromise<Stripe.BillingPortal.Configuration>;
+        list(
+          options?: RequestOptions
+        ): ApiListPromise<Stripe.BillingPortal.Configuration>;
+      }
+    }
+  }
+}
diff --git a/types/2020-08-27/BillingPortal/Sessions.d.ts b/types/2020-08-27/BillingPortal/Sessions.d.ts
index ca3f732c..d40d0e80 100644
--- a/types/2020-08-27/BillingPortal/Sessions.d.ts
+++ b/types/2020-08-27/BillingPortal/Sessions.d.ts
@@ -17,6 +17,11 @@ declare module 'stripe' {
          */
         object: 'billing_portal.session';
 
+        /**
+         * The configuration used by this session, describing the features available.
+         */
+        configuration: string | Stripe.BillingPortal.Configuration;
+
         /**
          * Time at which the object was created. Measured in seconds since the Unix epoch.
          */
@@ -33,12 +38,17 @@ declare module 'stripe' {
         livemode: boolean;
 
         /**
-         * The URL to which Stripe should send customers when they click on the link to return to your website.
+         * The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays.
+         */
+        on_behalf_of: string | null;
+
+        /**
+         * The URL to redirect customers to when they click on the portal's link to return to your website.
          */
         return_url: string;
 
         /**
-         * The short-lived URL of the session giving customers access to the customer portal.
+         * The short-lived URL of the session that gives customers access to the customer portal.
          */
         url: string;
       }
@@ -49,13 +59,23 @@ declare module 'stripe' {
          */
         customer: string;
 
+        /**
+         * The [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration.
+         */
+        configuration?: string;
+
         /**
          * Specifies which fields in the response should be expanded.
          */
         expand?: Array<string>;
 
         /**
-         * The URL to which Stripe should send customers when they click on the link to return to your website. This field is required if a default return URL has not been configured for the portal.
+         * The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays.
+         */
+        on_behalf_of?: string;
+
+        /**
+         * The default URL to redirect customers to when they click on the portal's link to return to your website.
          */
         return_url?: string;
       }
diff --git a/types/2020-08-27/Plans.d.ts b/types/2020-08-27/Plans.d.ts
index 87341aa1..d0a2b9f5 100644
--- a/types/2020-08-27/Plans.d.ts
+++ b/types/2020-08-27/Plans.d.ts
@@ -27,12 +27,12 @@ declare module 'stripe' {
       aggregate_usage: Plan.AggregateUsage | null;
 
       /**
-       * The unit amount in %s to be charged, represented as a whole integer if possible.
+       * The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.
        */
       amount: number | null;
 
       /**
-       * The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places.
+       * The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.
        */
       amount_decimal: string | null;
 
diff --git a/types/2020-08-27/Prices.d.ts b/types/2020-08-27/Prices.d.ts
index 52c2062a..7519009f 100644
--- a/types/2020-08-27/Prices.d.ts
+++ b/types/2020-08-27/Prices.d.ts
@@ -89,12 +89,12 @@ declare module 'stripe' {
       type: Price.Type;
 
       /**
-       * The unit amount in %s to be charged, represented as a whole integer if possible.
+       * The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.
        */
       unit_amount: number | null;
 
       /**
-       * The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places.
+       * The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.
        */
       unit_amount_decimal: string | null;
     }
diff --git a/types/2020-08-27/Terminal/Locations.d.ts b/types/2020-08-27/Terminal/Locations.d.ts
index 4d61654c..a531e99d 100644
--- a/types/2020-08-27/Terminal/Locations.d.ts
+++ b/types/2020-08-27/Terminal/Locations.d.ts
@@ -152,7 +152,7 @@ declare module 'stripe' {
           /**
            * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
            */
-          country: string;
+          country?: string;
 
           /**
            * Address line 1 (e.g., street, PO Box, or company name).
diff --git a/types/2020-08-27/WebhookEndpoints.d.ts b/types/2020-08-27/WebhookEndpoints.d.ts
index 0e4dc76d..2d664b28 100644
--- a/types/2020-08-27/WebhookEndpoints.d.ts
+++ b/types/2020-08-27/WebhookEndpoints.d.ts
@@ -237,6 +237,8 @@ declare module 'stripe' {
         | 'application_fee.refund.updated'
         | 'application_fee.refunded'
         | 'balance.available'
+        | 'billing_portal.configuration.created'
+        | 'billing_portal.configuration.updated'
         | 'capability.updated'
         | 'charge.captured'
         | 'charge.dispute.closed'
@@ -445,6 +447,8 @@ declare module 'stripe' {
         | 'application_fee.refund.updated'
         | 'application_fee.refunded'
         | 'balance.available'
+        | 'billing_portal.configuration.created'
+        | 'billing_portal.configuration.updated'
         | 'capability.updated'
         | 'charge.captured'
         | 'charge.dispute.closed'
diff --git a/types/2020-08-27/index.d.ts b/types/2020-08-27/index.d.ts
index 3db2e455..52ea3e38 100644
--- a/types/2020-08-27/index.d.ts
+++ b/types/2020-08-27/index.d.ts
@@ -14,6 +14,7 @@
 ///<reference path='./Balance.d.ts' />
 ///<reference path='./BalanceTransactions.d.ts' />
 ///<reference path='./BankAccounts.d.ts' />
+///<reference path='./BillingPortal/Configurations.d.ts' />
 ///<reference path='./BillingPortal/Sessions.d.ts' />
 ///<reference path='./BitcoinReceivers.d.ts' />
 ///<reference path='./BitcoinTransactions.d.ts' />
@@ -162,7 +163,10 @@ declare module 'stripe' {
     /**
      * Namespaced Resources
      */
-    billingPortal: {sessions: Stripe.BillingPortal.SessionsResource};
+    billingPortal: {
+      configurations: Stripe.BillingPortal.ConfigurationsResource;
+      sessions: Stripe.BillingPortal.SessionsResource;
+    };
     checkout: {sessions: Stripe.Checkout.SessionsResource};
     issuing: {
       authorizations: Stripe.Issuing.AuthorizationsResource;


Test patch:
diff --git a/test/resources/BillingPortal/Configurations.spec.js b/test/resources/BillingPortal/Configurations.spec.js
new file mode 100644
index 00000000..6bb6a474
--- /dev/null
+++ b/test/resources/BillingPortal/Configurations.spec.js
@@ -0,0 +1,73 @@
+'use strict';
+
+const stripe = require('../../../testUtils').getSpyableStripe();
+
+const expect = require('chai').expect;
+
+describe('BillingPortal', () => {
+  describe('Configurations Resource', () => {
+    describe('create', () => {
+      it('Sends the correct request', () => {
+        const params = {
+          business_profile: {
+            privacy_policy_url: 'https://example.com/privacy',
+            terms_of_service_url: 'https://example.com/tos',
+          },
+          features: {
+            customer_update: {
+              allowed_updates: ['address'],
+              enabled: true,
+            },
+          },
+        };
+        stripe.billingPortal.configurations.create(params);
+        expect(stripe.LAST_REQUEST).to.deep.equal({
+          method: 'POST',
+          url: '/v1/billing_portal/configurations',
+          headers: {},
+          data: params,
+          settings: {},
+        });
+      });
+    });
+    describe('update', () => {
+      it('Sends the correct request', () => {
+        const params = {
+          active: false,
+        };
+        stripe.billingPortal.configurations.update('bpc_123', params);
+        expect(stripe.LAST_REQUEST).to.deep.equal({
+          method: 'POST',
+          url: '/v1/billing_portal/configurations/bpc_123',
+          headers: {},
+          data: params,
+          settings: {},
+        });
+      });
+    });
+    describe('retrieve', () => {
+      it('Sends the correct request', () => {
+        stripe.billingPortal.configurations.retrieve('bpc_123');
+        expect(stripe.LAST_REQUEST).to.deep.equal({
+          method: 'GET',
+          url: '/v1/billing_portal/configurations/bpc_123',
+          headers: {},
+          data: {},
+          settings: {},
+        });
+      });
+    });
+    describe('list', () => {
+      it('Sends the correct request', () => {
+        stripe.billingPortal.configurations.list();
+        expect(stripe.LAST_REQUEST).to.deep.equal({
+          method: 'GET',
+          url: '/v1/billing_portal/configurations',
+          headers: {},
+          data: {},
+          settings: {},
+        });
+      });
+    });
+  });
+});