diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 242021ae22..55b7a77b11 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v767 \ No newline at end of file +v793 \ No newline at end of file diff --git a/account.go b/account.go index a96c681ccd..21a0485a5c 100644 --- a/account.go +++ b/account.go @@ -11,7 +11,7 @@ import ( "github.com/stripe/stripe-go/v76/form" ) -// The business type. +// The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts. type AccountBusinessType string // List of values that AccountBusinessType can take @@ -52,6 +52,7 @@ const ( AccountCompanyStructurePublicCompany AccountCompanyStructure = "public_company" AccountCompanyStructurePublicCorporation AccountCompanyStructure = "public_corporation" AccountCompanyStructurePublicPartnership AccountCompanyStructure = "public_partnership" + AccountCompanyStructureRegisteredCharity AccountCompanyStructure = "registered_charity" AccountCompanyStructureSingleMemberLLC AccountCompanyStructure = "single_member_llc" AccountCompanyStructureSoleEstablishment AccountCompanyStructure = "sole_establishment" AccountCompanyStructureSoleProprietorship AccountCompanyStructure = "sole_proprietorship" @@ -155,11 +156,11 @@ type AccountParams struct { AccountToken *string `form:"account_token"` // Business information about the account. BusinessProfile *AccountBusinessProfileParams `form:"business_profile"` - // The business type. + // The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. BusinessType *string `form:"business_type"` // Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. Capabilities *AccountCapabilitiesParams `form:"capabilities"` - // Information about the company or business. This field is available for any `business_type`. + // Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. Company *AccountCompanyParams `form:"company"` // The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. Country *string `form:"country"` @@ -174,14 +175,16 @@ type AccountParams struct { // A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. // // By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + // + // Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. ExternalAccount *AccountExternalAccountParams `form:"external_account"` - // Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. + // Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. Individual *PersonParams `form:"individual"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata map[string]string `form:"metadata"` // Options for customizing how the account functions within Stripe. Settings *AccountSettingsParams `form:"settings"` - // Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + // Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. TOSAcceptance *AccountTOSAcceptanceParams `form:"tos_acceptance"` // The type of Stripe account to create. May be one of `custom`, `express` or `standard`. Type *string `form:"type"` @@ -201,6 +204,16 @@ func (p *AccountParams) AddMetadata(key string, value string) { p.Metadata[key] = value } +// The applicant's gross annual revenue for its preceding fiscal year. +type AccountBusinessProfileAnnualRevenueParams struct { + // A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + Amount *int64 `form:"amount"` + // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Currency *string `form:"currency"` + // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. + FiscalYearEnd *string `form:"fiscal_year_end"` +} + // An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. type AccountBusinessProfileMonthlyEstimatedRevenueParams struct { // A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). @@ -211,6 +224,10 @@ type AccountBusinessProfileMonthlyEstimatedRevenueParams struct { // Business information about the account. type AccountBusinessProfileParams struct { + // The applicant's gross annual revenue for its preceding fiscal year. + AnnualRevenue *AccountBusinessProfileAnnualRevenueParams `form:"annual_revenue"` + // An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. + EstimatedWorkerCount *int64 `form:"estimated_worker_count"` // [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. MCC *string `form:"mcc"` // An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. @@ -591,7 +608,7 @@ type AccountCompanyVerificationParams struct { Document *AccountCompanyVerificationDocumentParams `form:"document"` } -// Information about the company or business. This field is available for any `business_type`. +// Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. type AccountCompanyParams struct { // The company's primary address. Address *AddressParams `form:"address"` @@ -857,7 +874,7 @@ type AccountSettingsParams struct { Treasury *AccountSettingsTreasuryParams `form:"treasury"` } -// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). +// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. type AccountTOSAcceptanceParams struct { // The Unix timestamp marking when the account representative accepted their service agreement. Date *int64 `form:"date"` @@ -899,6 +916,15 @@ func (p *AccountRejectParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// The applicant's gross annual revenue for its preceding fiscal year. +type AccountBusinessProfileAnnualRevenue struct { + // A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + Amount int64 `json:"amount"` + // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Currency Currency `json:"currency"` + // The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. + FiscalYearEnd string `json:"fiscal_year_end"` +} type AccountBusinessProfileMonthlyEstimatedRevenue struct { // A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Amount int64 `json:"amount"` @@ -908,6 +934,10 @@ type AccountBusinessProfileMonthlyEstimatedRevenue struct { // Business information about the account. type AccountBusinessProfile struct { + // The applicant's gross annual revenue for its preceding fiscal year. + AnnualRevenue *AccountBusinessProfileAnnualRevenue `json:"annual_revenue"` + // An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. + EstimatedWorkerCount int64 `json:"estimated_worker_count"` // [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. MCC string `json:"mcc"` MonthlyEstimatedRevenue *AccountBusinessProfileMonthlyEstimatedRevenue `json:"monthly_estimated_revenue"` @@ -1299,14 +1329,13 @@ type AccountTOSAcceptance struct { // enabled to make live charges or receive payouts. // // For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that -// account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) -// for a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express** -// below. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). +// account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), +// some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). type Account struct { APIResource // Business information about the account. BusinessProfile *AccountBusinessProfile `json:"business_profile"` - // The business type. + // The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts. BusinessType AccountBusinessType `json:"business_type"` Capabilities *AccountCapabilities `json:"capabilities"` // Whether the account can create live charges. @@ -1324,7 +1353,7 @@ type Account struct { DetailsSubmitted bool `json:"details_submitted"` // An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. Email string `json:"email"` - // External accounts (bank accounts and debit cards) currently attached to this account + // External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where `controller[is_controller]` is true. ExternalAccounts *AccountExternalAccountList `json:"external_accounts"` FutureRequirements *AccountFutureRequirements `json:"future_requirements"` // Unique identifier for the object. diff --git a/accountlink.go b/accountlink.go index 0871d290e3..8db8768bce 100644 --- a/accountlink.go +++ b/accountlink.go @@ -6,6 +6,14 @@ package stripe +// Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. +type AccountLinkCollectionOptionsParams struct { + // Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`. + Fields *string `form:"fields"` + // Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. + FutureRequirements *string `form:"future_requirements"` +} + // AccountLinkType is the type of an account link. type AccountLinkType string @@ -29,8 +37,10 @@ type AccountLinkParams struct { Params `form:"*"` // The identifier of the account to create an account link for. Account *string `form:"account"` - // Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`. + // The collect parameter is deprecated. Use `collection_options` instead. Collect *string `form:"collect"` + // Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. + CollectionOptions *AccountLinkCollectionOptionsParams `form:"collection_options"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` // The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user. diff --git a/charge.go b/charge.go index 8a2796a872..2303627edd 100644 --- a/charge.go +++ b/charge.go @@ -358,9 +358,9 @@ type ChargeLevel3Params struct { ShippingFromZip *string `form:"shipping_from_zip"` } -// Use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead -// of using this method. Confirmation of the PaymentIntent creates the Charge -// object used to request payment, so this method is limited to legacy integrations. +// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) +// to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge +// object used to request payment. type ChargeParams struct { Params `form:"*"` // Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). diff --git a/checkout_session.go b/checkout_session.go index 0f5dde163a..3b9aec8dd2 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -6,6 +6,15 @@ package stripe +// Type of the account referenced. +type CheckoutSessionAutomaticTaxLiabilityType string + +// List of values that CheckoutSessionAutomaticTaxLiabilityType can take +const ( + CheckoutSessionAutomaticTaxLiabilityTypeAccount CheckoutSessionAutomaticTaxLiabilityType = "account" + CheckoutSessionAutomaticTaxLiabilityTypeSelf CheckoutSessionAutomaticTaxLiabilityType = "self" +) + // The status of the most recent automated tax calculation for this session. type CheckoutSessionAutomaticTaxStatus string @@ -185,6 +194,15 @@ const ( CheckoutSessionCustomerDetailsTaxIDTypeZAVAT CheckoutSessionCustomerDetailsTaxIDType = "za_vat" ) +// Type of the account referenced. +type CheckoutSessionInvoiceCreationInvoiceDataIssuerType string + +// List of values that CheckoutSessionInvoiceCreationInvoiceDataIssuerType can take +const ( + CheckoutSessionInvoiceCreationInvoiceDataIssuerTypeAccount CheckoutSessionInvoiceCreationInvoiceDataIssuerType = "account" + CheckoutSessionInvoiceCreationInvoiceDataIssuerTypeSelf CheckoutSessionInvoiceCreationInvoiceDataIssuerType = "self" +) + // The mode of the Checkout Session. type CheckoutSessionMode string @@ -791,10 +809,20 @@ type CheckoutSessionAfterExpirationParams struct { Recovery *CheckoutSessionAfterExpirationRecoveryParams `form:"recovery"` } +// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. +type CheckoutSessionAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. type CheckoutSessionAutomaticTaxParams struct { // Set to true to enable automatic taxes. Enabled *bool `form:"enabled"` + // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Liability *CheckoutSessionAutomaticTaxLiabilityParams `form:"liability"` } // Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. @@ -855,7 +883,7 @@ type CheckoutSessionCustomFieldTextParams struct { MinimumLength *int64 `form:"minimum_length"` } -// Collect additional information from your customer using custom fields. Up to 2 fields are supported. +// Collect additional information from your customer using custom fields. Up to 3 fields are supported. type CheckoutSessionCustomFieldParams struct { // Configuration for `type=dropdown` fields. Dropdown *CheckoutSessionCustomFieldDropdownParams `form:"dropdown"` @@ -937,6 +965,14 @@ type CheckoutSessionInvoiceCreationInvoiceDataCustomFieldParams struct { Value *string `form:"value"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type CheckoutSessionInvoiceCreationInvoiceDataIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Default options for invoice PDF rendering for this customer. type CheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsParams struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. @@ -953,6 +989,8 @@ type CheckoutSessionInvoiceCreationInvoiceDataParams struct { Description *string `form:"description"` // Default footer to be displayed on invoices for this customer. Footer *string `form:"footer"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *CheckoutSessionInvoiceCreationInvoiceDataIssuerParams `form:"issuer"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata map[string]string `form:"metadata"` // Default options for invoice PDF rendering for this customer. @@ -1013,7 +1051,7 @@ func (p *CheckoutSessionLineItemPriceDataProductDataParams) AddMetadata(key stri type CheckoutSessionLineItemPriceDataRecurringParams struct { // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` - // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). IntervalCount *int64 `form:"interval_count"` } @@ -1680,6 +1718,20 @@ type CheckoutSessionShippingOptionParams struct { ShippingRateData *CheckoutSessionShippingOptionShippingRateDataParams `form:"shipping_rate_data"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type CheckoutSessionSubscriptionDataInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + +// All invoices will be billed using the specified settings. +type CheckoutSessionSubscriptionDataInvoiceSettingsParams struct { + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *CheckoutSessionSubscriptionDataInvoiceSettingsIssuerParams `form:"issuer"` +} + // If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. type CheckoutSessionSubscriptionDataTransferDataParams struct { // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. @@ -1714,6 +1766,8 @@ type CheckoutSessionSubscriptionDataParams struct { // Use this field to optionally store an explanation of the subscription // for rendering in the [customer portal](https://stripe.com/docs/customer-management). Description *string `form:"description"` + // All invoices will be billed using the specified settings. + InvoiceSettings *CheckoutSessionSubscriptionDataInvoiceSettingsParams `form:"invoice_settings"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata map[string]string `form:"metadata"` // The account on behalf of which to charge, for each of the subscription's invoices. @@ -1799,7 +1853,7 @@ type CheckoutSessionParams struct { CustomerEmail *string `form:"customer_email"` // Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. CustomerUpdate *CheckoutSessionCustomerUpdateParams `form:"customer_update"` - // Collect additional information from your customer using custom fields. Up to 2 fields are supported. + // Collect additional information from your customer using custom fields. Up to 3 fields are supported. CustomFields []*CheckoutSessionCustomFieldParams `form:"custom_fields"` // Display additional text for your customers using custom text. CustomText *CheckoutSessionCustomTextParams `form:"custom_text"` @@ -1944,9 +1998,19 @@ type CheckoutSessionAfterExpiration struct { // When set, configuration used to recover the Checkout Session on expiry. Recovery *CheckoutSessionAfterExpirationRecovery `json:"recovery"` } + +// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. +type CheckoutSessionAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type CheckoutSessionAutomaticTaxLiabilityType `json:"type"` +} type CheckoutSessionAutomaticTax struct { // Indicates whether automatic tax is enabled for the session Enabled bool `json:"enabled"` + // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Liability *CheckoutSessionAutomaticTaxLiability `json:"liability"` // The status of the most recent automated tax calculation for this session. Status CheckoutSessionAutomaticTaxStatus `json:"status"` } @@ -2028,7 +2092,7 @@ type CheckoutSessionCustomFieldText struct { Value string `json:"value"` } -// Collect additional information from your customer using custom fields. Up to 2 fields are supported. +// Collect additional information from your customer using custom fields. Up to 3 fields are supported. type CheckoutSessionCustomField struct { Dropdown *CheckoutSessionCustomFieldDropdown `json:"dropdown"` // String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. @@ -2109,6 +2173,14 @@ type CheckoutSessionInvoiceCreationInvoiceDataCustomField struct { Value string `json:"value"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type CheckoutSessionInvoiceCreationInvoiceDataIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type CheckoutSessionInvoiceCreationInvoiceDataIssuerType `json:"type"` +} + // Options for invoice PDF rendering. type CheckoutSessionInvoiceCreationInvoiceDataRenderingOptions struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. @@ -2123,6 +2195,8 @@ type CheckoutSessionInvoiceCreationInvoiceData struct { Description string `json:"description"` // Footer displayed on the invoice. Footer string `json:"footer"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *CheckoutSessionInvoiceCreationInvoiceDataIssuer `json:"issuer"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Metadata map[string]string `json:"metadata"` // Options for invoice PDF rendering. @@ -2607,7 +2681,7 @@ type CheckoutSession struct { // on file. To access information about the customer once the payment flow is // complete, use the `customer` attribute. CustomerEmail string `json:"customer_email"` - // Collect additional information from your customer using custom fields. Up to 2 fields are supported. + // Collect additional information from your customer using custom fields. Up to 3 fields are supported. CustomFields []*CheckoutSessionCustomField `json:"custom_fields"` CustomText *CheckoutSessionCustomText `json:"custom_text"` // The timestamp at which the Checkout Session will expire. diff --git a/customersession.go b/customersession.go index a4e68ae963..08d4ebfba0 100644 --- a/customersession.go +++ b/customersession.go @@ -18,7 +18,7 @@ type CustomerSessionComponentsPricingTableParams struct { Enabled *bool `form:"enabled"` } -// Configuration for each component. 1 component must be enabled. +// Configuration for each component. Exactly 1 component must be enabled. type CustomerSessionComponentsParams struct { // Configuration for buy button. BuyButton *CustomerSessionComponentsBuyButtonParams `form:"buy_button"` @@ -29,7 +29,7 @@ type CustomerSessionComponentsParams struct { // Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. type CustomerSessionParams struct { Params `form:"*"` - // Configuration for each component. 1 component must be enabled. + // Configuration for each component. Exactly 1 component must be enabled. Components *CustomerSessionComponentsParams `form:"components"` // The ID of an existing customer for which to create the customer session. Customer *string `form:"customer"` diff --git a/financialconnections_account.go b/financialconnections_account.go index d714ac03ae..e93ed64887 100644 --- a/financialconnections_account.go +++ b/financialconnections_account.go @@ -211,7 +211,7 @@ type FinancialConnectionsAccountSubscribeParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` - // The list of account features to which you would like to subscribe.`. + // The list of account features to which you would like to subscribe. Features []*string `form:"features"` } diff --git a/invoice.go b/invoice.go index c0b3cfe209..0732e6ee75 100644 --- a/invoice.go +++ b/invoice.go @@ -98,6 +98,7 @@ type InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure string const ( InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureAny InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "any" InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureAutomatic InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "automatic" + InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureChallenge InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "challenge" ) // The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. @@ -347,6 +348,8 @@ type InvoiceDiscountParams struct { Coupon *string `form:"coupon"` // ID of an existing discount on the object (or one of its ancestors) to reuse. Discount *string `form:"discount"` + // ID of the promotion code to create a new discount for. + PromotionCode *string `form:"promotion_code"` } // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @@ -883,6 +886,8 @@ type InvoiceUpcomingLinesDiscountParams struct { Coupon *string `form:"coupon"` // ID of an existing discount on the object (or one of its ancestors) to reuse. Discount *string `form:"discount"` + // ID of the promotion code to create a new discount for. + PromotionCode *string `form:"promotion_code"` } // The coupons to redeem into discounts for the invoice item in the preview. @@ -891,6 +896,8 @@ type InvoiceUpcomingLinesInvoiceItemDiscountParams struct { Coupon *string `form:"coupon"` // ID of an existing discount on the object (or one of its ancestors) to reuse. Discount *string `form:"discount"` + // ID of the promotion code to create a new discount for. + PromotionCode *string `form:"promotion_code"` } // The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. @@ -978,7 +985,7 @@ type InvoiceUpcomingLinesSubscriptionItemBillingThresholdsParams struct { type InvoiceUpcomingLinesSubscriptionItemPriceDataRecurringParams struct { // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` - // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). IntervalCount *int64 `form:"interval_count"` } diff --git a/paymentintent.go b/paymentintent.go index 6b8ba7432c..02f26b54e9 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -345,7 +345,7 @@ const ( PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorizationNever PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization = "never" ) -// Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. type PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization string // List of values that PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization can take @@ -1295,7 +1295,7 @@ type PaymentIntentPaymentMethodOptionsCardParams struct { Network *string `form:"network"` // Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. RequestExtendedAuthorization *string `form:"request_extended_authorization"` - // Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + // Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. RequestIncrementalAuthorization *string `form:"request_incremental_authorization"` // Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. RequestMulticapture *string `form:"request_multicapture"` @@ -1593,7 +1593,7 @@ type PaymentIntentPaymentMethodOptionsPromptPayParams struct { SetupFutureUsage *string `form:"setup_future_usage"` } -// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. +// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. type PaymentIntentPaymentMethodOptionsRevolutPayParams struct { // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -1764,7 +1764,7 @@ type PaymentIntentPaymentMethodOptionsParams struct { Pix *PaymentIntentPaymentMethodOptionsPixParams `form:"pix"` // If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. PromptPay *PaymentIntentPaymentMethodOptionsPromptPayParams `form:"promptpay"` - // If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. + // If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. RevolutPay *PaymentIntentPaymentMethodOptionsRevolutPayParams `form:"revolut_pay"` // If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. SEPADebit *PaymentIntentPaymentMethodOptionsSEPADebitParams `form:"sepa_debit"` @@ -2643,7 +2643,7 @@ type PaymentIntentPaymentMethodOptionsCard struct { Network PaymentIntentPaymentMethodOptionsCardNetwork `json:"network"` // Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. RequestExtendedAuthorization PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization `json:"request_extended_authorization"` - // Request ability to [increment](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + // Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. RequestIncrementalAuthorization PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization `json:"request_incremental_authorization"` // Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. RequestMulticapture PaymentIntentPaymentMethodOptionsCardRequestMulticapture `json:"request_multicapture"` diff --git a/paymentlink.go b/paymentlink.go index 49cb8b7fee..dbfe1bf784 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -17,6 +17,15 @@ const ( PaymentLinkAfterCompletionTypeRedirect PaymentLinkAfterCompletionType = "redirect" ) +// Type of the account referenced. +type PaymentLinkAutomaticTaxLiabilityType string + +// List of values that PaymentLinkAutomaticTaxLiabilityType can take +const ( + PaymentLinkAutomaticTaxLiabilityTypeAccount PaymentLinkAutomaticTaxLiabilityType = "account" + PaymentLinkAutomaticTaxLiabilityTypeSelf PaymentLinkAutomaticTaxLiabilityType = "self" +) + // Configuration for collecting the customer's billing address. type PaymentLinkBillingAddressCollection string @@ -82,6 +91,15 @@ const ( PaymentLinkCustomerCreationIfRequired PaymentLinkCustomerCreation = "if_required" ) +// Type of the account referenced. +type PaymentLinkInvoiceCreationInvoiceDataIssuerType string + +// List of values that PaymentLinkInvoiceCreationInvoiceDataIssuerType can take +const ( + PaymentLinkInvoiceCreationInvoiceDataIssuerTypeAccount PaymentLinkInvoiceCreationInvoiceDataIssuerType = "account" + PaymentLinkInvoiceCreationInvoiceDataIssuerTypeSelf PaymentLinkInvoiceCreationInvoiceDataIssuerType = "self" +) + // Indicates when the funds will be captured from the customer's account. type PaymentLinkPaymentIntentDataCaptureMethod string @@ -156,6 +174,15 @@ const ( PaymentLinkSubmitTypePay PaymentLinkSubmitType = "pay" ) +// Type of the account referenced. +type PaymentLinkSubscriptionDataInvoiceSettingsIssuerType string + +// List of values that PaymentLinkSubscriptionDataInvoiceSettingsIssuerType can take +const ( + PaymentLinkSubscriptionDataInvoiceSettingsIssuerTypeAccount PaymentLinkSubscriptionDataInvoiceSettingsIssuerType = "account" + PaymentLinkSubscriptionDataInvoiceSettingsIssuerTypeSelf PaymentLinkSubscriptionDataInvoiceSettingsIssuerType = "self" +) + // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod string @@ -202,10 +229,20 @@ type PaymentLinkAfterCompletionParams struct { Type *string `form:"type"` } +// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. +type PaymentLinkAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Configuration for automatic tax collection. type PaymentLinkAutomaticTaxParams struct { // If `true`, tax will be calculated automatically using the customer's location. Enabled *bool `form:"enabled"` + // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Liability *PaymentLinkAutomaticTaxLiabilityParams `form:"liability"` } // Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. @@ -266,7 +303,7 @@ type PaymentLinkCustomFieldTextParams struct { MinimumLength *int64 `form:"minimum_length"` } -// Collect additional information from your customer using custom fields. Up to 2 fields are supported. +// Collect additional information from your customer using custom fields. Up to 3 fields are supported. type PaymentLinkCustomFieldParams struct { // Configuration for `type=dropdown` fields. Dropdown *PaymentLinkCustomFieldDropdownParams `form:"dropdown"` @@ -328,6 +365,14 @@ type PaymentLinkInvoiceCreationInvoiceDataCustomFieldParams struct { Value *string `form:"value"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type PaymentLinkInvoiceCreationInvoiceDataIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Default options for invoice PDF rendering for this customer. type PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsParams struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. @@ -344,6 +389,8 @@ type PaymentLinkInvoiceCreationInvoiceDataParams struct { Description *string `form:"description"` // Default footer to be displayed on invoices for this customer. Footer *string `form:"footer"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *PaymentLinkInvoiceCreationInvoiceDataIssuerParams `form:"issuer"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata map[string]string `form:"metadata"` // Default options for invoice PDF rendering for this customer. @@ -459,6 +506,20 @@ type PaymentLinkShippingOptionParams struct { ShippingRate *string `form:"shipping_rate"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type PaymentLinkSubscriptionDataInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + +// All invoices will be billed using the specified settings. +type PaymentLinkSubscriptionDataInvoiceSettingsParams struct { + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *PaymentLinkSubscriptionDataInvoiceSettingsIssuerParams `form:"issuer"` +} + // Defines how the subscription should behave when the user's free trial ends. type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams struct { // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. @@ -475,6 +536,8 @@ type PaymentLinkSubscriptionDataTrialSettingsParams struct { type PaymentLinkSubscriptionDataParams struct { // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. Description *string `form:"description"` + // All invoices will be billed using the specified settings. + InvoiceSettings *PaymentLinkSubscriptionDataInvoiceSettingsParams `form:"invoice_settings"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. Metadata map[string]string `form:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. @@ -532,7 +595,7 @@ type PaymentLinkParams struct { Currency *string `form:"currency"` // Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). CustomerCreation *string `form:"customer_creation"` - // Collect additional information from your customer using custom fields. Up to 2 fields are supported. + // Collect additional information from your customer using custom fields. Up to 3 fields are supported. CustomFields []*PaymentLinkCustomFieldParams `form:"custom_fields"` // Display additional text for your customers using custom text. CustomText *PaymentLinkCustomTextParams `form:"custom_text"` @@ -619,9 +682,19 @@ type PaymentLinkAfterCompletion struct { // The specified behavior after the purchase is complete. Type PaymentLinkAfterCompletionType `json:"type"` } + +// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. +type PaymentLinkAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type PaymentLinkAutomaticTaxLiabilityType `json:"type"` +} type PaymentLinkAutomaticTax struct { // If `true`, tax will be calculated automatically using the customer's location. Enabled bool `json:"enabled"` + // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Liability *PaymentLinkAutomaticTaxLiability `json:"liability"` } // Settings related to the payment method reuse text shown in the Checkout UI. @@ -672,7 +745,7 @@ type PaymentLinkCustomFieldText struct { MinimumLength int64 `json:"minimum_length"` } -// Collect additional information from your customer using custom fields. Up to 2 fields are supported. +// Collect additional information from your customer using custom fields. Up to 3 fields are supported. type PaymentLinkCustomField struct { Dropdown *PaymentLinkCustomFieldDropdown `json:"dropdown"` // String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. @@ -728,6 +801,14 @@ type PaymentLinkInvoiceCreationInvoiceDataCustomField struct { Value string `json:"value"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type PaymentLinkInvoiceCreationInvoiceDataIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type PaymentLinkInvoiceCreationInvoiceDataIssuerType `json:"type"` +} + // Options for invoice PDF rendering. type PaymentLinkInvoiceCreationInvoiceDataRenderingOptions struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. @@ -744,6 +825,8 @@ type PaymentLinkInvoiceCreationInvoiceData struct { Description string `json:"description"` // Footer to be displayed on the invoice. Footer string `json:"footer"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *PaymentLinkInvoiceCreationInvoiceDataIssuer `json:"issuer"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Metadata map[string]string `json:"metadata"` // Options for invoice PDF rendering. @@ -804,6 +887,15 @@ type PaymentLinkShippingOption struct { // The ID of the Shipping Rate to use for this shipping option. ShippingRate *ShippingRate `json:"shipping_rate"` } +type PaymentLinkSubscriptionDataInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type PaymentLinkSubscriptionDataInvoiceSettingsIssuerType `json:"type"` +} +type PaymentLinkSubscriptionDataInvoiceSettings struct { + Issuer *PaymentLinkSubscriptionDataInvoiceSettingsIssuer `json:"issuer"` +} // Defines how a subscription behaves when a free trial ends. type PaymentLinkSubscriptionDataTrialSettingsEndBehavior struct { @@ -820,7 +912,8 @@ type PaymentLinkSubscriptionDataTrialSettings struct { // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. type PaymentLinkSubscriptionData struct { // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - Description string `json:"description"` + Description string `json:"description"` + InvoiceSettings *PaymentLinkSubscriptionDataInvoiceSettings `json:"invoice_settings"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Metadata map[string]string `json:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. @@ -868,7 +961,7 @@ type PaymentLink struct { Currency Currency `json:"currency"` // Configuration for Customer creation during checkout. CustomerCreation PaymentLinkCustomerCreation `json:"customer_creation"` - // Collect additional information from your customer using custom fields. Up to 2 fields are supported. + // Collect additional information from your customer using custom fields. Up to 3 fields are supported. CustomFields []*PaymentLinkCustomField `json:"custom_fields"` CustomText *PaymentLinkCustomText `json:"custom_text"` // Unique identifier for the object. diff --git a/payout.go b/payout.go index 6af56859cc..ed1a58eba4 100644 --- a/payout.go +++ b/payout.go @@ -149,7 +149,7 @@ func (p *PayoutParams) AddMetadata(key string, value string) { p.Metadata[key] = value } -// Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. +// Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. // // By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. type PayoutReverseParams struct { diff --git a/plan.go b/plan.go index 588eadc7ed..a1959fadac 100644 --- a/plan.go +++ b/plan.go @@ -91,7 +91,7 @@ type PlanParams struct { ID *string `form:"id"` // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` - // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). IntervalCount *int64 `form:"interval_count"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata map[string]string `form:"metadata"` diff --git a/price.go b/price.go index f2c60918e2..f7c392cabc 100644 --- a/price.go +++ b/price.go @@ -229,7 +229,7 @@ type PriceRecurringParams struct { AggregateUsage *string `form:"aggregate_usage"` // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` - // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). IntervalCount *int64 `form:"interval_count"` // Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). TrialPeriodDays *int64 `form:"trial_period_days"` diff --git a/product.go b/product.go index 2dc5eabfb2..cb497edea8 100644 --- a/product.go +++ b/product.go @@ -172,7 +172,7 @@ type ProductDefaultPriceDataCurrencyOptionsParams struct { type ProductDefaultPriceDataRecurringParams struct { // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` - // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). IntervalCount *int64 `form:"interval_count"` } diff --git a/quote.go b/quote.go index 7f8af63a3d..f1f629a17f 100644 --- a/quote.go +++ b/quote.go @@ -11,6 +11,15 @@ import ( "github.com/stripe/stripe-go/v76/form" ) +// Type of the account referenced. +type QuoteAutomaticTaxLiabilityType string + +// List of values that QuoteAutomaticTaxLiabilityType can take +const ( + QuoteAutomaticTaxLiabilityTypeAccount QuoteAutomaticTaxLiabilityType = "account" + QuoteAutomaticTaxLiabilityTypeSelf QuoteAutomaticTaxLiabilityType = "self" +) + // The status of the most recent automated tax calculation for this quote. type QuoteAutomaticTaxStatus string @@ -85,6 +94,15 @@ const ( QuoteComputedUpfrontTotalDetailsBreakdownTaxTaxabilityReasonZeroRated QuoteComputedUpfrontTotalDetailsBreakdownTaxTaxabilityReason = "zero_rated" ) +// Type of the account referenced. +type QuoteInvoiceSettingsIssuerType string + +// List of values that QuoteInvoiceSettingsIssuerType can take +const ( + QuoteInvoiceSettingsIssuerTypeAccount QuoteInvoiceSettingsIssuerType = "account" + QuoteInvoiceSettingsIssuerTypeSelf QuoteInvoiceSettingsIssuerType = "self" +) + // The status of the quote. type QuoteStatus string @@ -136,10 +154,20 @@ func (p *QuoteListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. +type QuoteAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. type QuoteAutomaticTaxParams struct { // Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. Enabled *bool `form:"enabled"` + // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Liability *QuoteAutomaticTaxLiabilityParams `form:"liability"` } // The discounts applied to the quote. You can only set up to one discount. @@ -158,17 +186,27 @@ type QuoteFromQuoteParams struct { Quote *string `form:"quote"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type QuoteInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // All invoices will be billed using the specified settings. type QuoteInvoiceSettingsParams struct { // Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *QuoteInvoiceSettingsIssuerParams `form:"issuer"` } // The recurring components of a price such as `interval` and `interval_count`. type QuoteLineItemPriceDataRecurringParams struct { // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` - // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). IntervalCount *int64 `form:"interval_count"` } @@ -376,9 +414,18 @@ func (p *QuotePDFParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. +type QuoteAutomaticTaxLiability struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuoteAutomaticTaxLiabilityType `json:"type"` +} type QuoteAutomaticTax struct { // Automatically calculate taxes Enabled bool `json:"enabled"` + // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Liability *QuoteAutomaticTaxLiability `json:"liability"` // The status of the most recent automated tax calculation for this quote. Status QuoteAutomaticTaxStatus `json:"status"` } @@ -497,9 +544,16 @@ type QuoteFromQuote struct { // The quote that was cloned. Quote *Quote `json:"quote"` } +type QuoteInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type QuoteInvoiceSettingsIssuerType `json:"type"` +} type QuoteInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. - DaysUntilDue int64 `json:"days_until_due"` + DaysUntilDue int64 `json:"days_until_due"` + Issuer *QuoteInvoiceSettingsIssuer `json:"issuer"` } type QuoteStatusTransitions struct { // The time that the quote was accepted. Measured in seconds since Unix epoch. diff --git a/subscription.go b/subscription.go index cd6851642f..c059a40e11 100644 --- a/subscription.go +++ b/subscription.go @@ -117,6 +117,7 @@ type SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure stri const ( SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureAny SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "any" SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureAutomatic SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "automatic" + SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureChallenge SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "challenge" ) // The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. diff --git a/subscriptionitem.go b/subscriptionitem.go index 2807f53e5e..2b86241ea5 100644 --- a/subscriptionitem.go +++ b/subscriptionitem.go @@ -72,7 +72,7 @@ type SubscriptionItemBillingThresholdsParams struct { type SubscriptionItemPriceDataRecurringParams struct { // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` - // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + // The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). IntervalCount *int64 `form:"interval_count"` } diff --git a/subscriptionschedule.go b/subscriptionschedule.go index 17a33e35ac..f08ba4cc78 100644 --- a/subscriptionschedule.go +++ b/subscriptionschedule.go @@ -20,6 +20,15 @@ const ( SubscriptionScheduleDefaultSettingsBillingCycleAnchorPhaseStart SubscriptionScheduleDefaultSettingsBillingCycleAnchor = "phase_start" ) +// Type of the account referenced. +type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType string + +// List of values that SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType can take +const ( + SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerTypeAccount SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType = "account" + SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerTypeSelf SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType = "self" +) + // Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. type SubscriptionScheduleEndBehavior string @@ -40,6 +49,15 @@ const ( SubscriptionSchedulePhaseBillingCycleAnchorPhaseStart SubscriptionSchedulePhaseBillingCycleAnchor = "phase_start" ) +// Type of the account referenced. +type SubscriptionSchedulePhaseInvoiceSettingsIssuerType string + +// List of values that SubscriptionSchedulePhaseInvoiceSettingsIssuerType can take +const ( + SubscriptionSchedulePhaseInvoiceSettingsIssuerTypeAccount SubscriptionSchedulePhaseInvoiceSettingsIssuerType = "account" + SubscriptionSchedulePhaseInvoiceSettingsIssuerTypeSelf SubscriptionSchedulePhaseInvoiceSettingsIssuerType = "self" +) + // If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. type SubscriptionSchedulePhaseProrationBehavior string @@ -94,10 +112,20 @@ func (p *SubscriptionScheduleListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // All invoices will be billed using the specified settings. type SubscriptionScheduleDefaultSettingsInvoiceSettingsParams struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerParams `form:"issuer"` } // Object representing the subscription schedule's default settings. @@ -137,16 +165,36 @@ type SubscriptionSchedulePhaseAddInvoiceItemParams struct { TaxRates []*string `form:"tax_rates"` } +// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. +type SubscriptionSchedulePhaseAutomaticTaxLiabilityParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` +} + // Automatic tax settings for this phase. type SubscriptionSchedulePhaseAutomaticTaxParams struct { // Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. Enabled *bool `form:"enabled"` + // The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Liability *SubscriptionSchedulePhaseAutomaticTaxLiabilityParams `form:"liability"` +} + +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionSchedulePhaseInvoiceSettingsIssuerParams struct { + // The connected account being referenced when `type` is `account`. + Account *string `form:"account"` + // Type of the account referenced in the request. + Type *string `form:"type"` } // All invoices will be billed using the specified settings. type SubscriptionSchedulePhaseInvoiceSettingsParams struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionSchedulePhaseInvoiceSettingsIssuerParams `form:"issuer"` } // List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. @@ -331,9 +379,16 @@ type SubscriptionScheduleCurrentPhase struct { // The start of this phase of the subscription schedule. StartDate int64 `json:"start_date"` } +type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType `json:"type"` +} type SubscriptionScheduleDefaultSettingsInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - DaysUntilDue int64 `json:"days_until_due"` + DaysUntilDue int64 `json:"days_until_due"` + Issuer *SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer `json:"issuer"` } type SubscriptionScheduleDefaultSettings struct { // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. @@ -366,10 +421,20 @@ type SubscriptionSchedulePhaseAddInvoiceItem struct { TaxRates []*TaxRate `json:"tax_rates"` } +// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. +type SubscriptionSchedulePhaseInvoiceSettingsIssuer struct { + // The connected account being referenced when `type` is `account`. + Account *Account `json:"account"` + // Type of the account referenced. + Type SubscriptionSchedulePhaseInvoiceSettingsIssuerType `json:"type"` +} + // The invoice settings applicable during this phase. type SubscriptionSchedulePhaseInvoiceSettings struct { // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` + // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Issuer *SubscriptionSchedulePhaseInvoiceSettingsIssuer `json:"issuer"` } // Subscription items to configure the subscription to during this phase of the subscription schedule.