github.com/stripe/stripe-go/v76@v76.25.0/tax_settings.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior.
    10  type TaxSettingsDefaultsTaxBehavior string
    11  
    12  // List of values that TaxSettingsDefaultsTaxBehavior can take
    13  const (
    14  	TaxSettingsDefaultsTaxBehaviorExclusive          TaxSettingsDefaultsTaxBehavior = "exclusive"
    15  	TaxSettingsDefaultsTaxBehaviorInclusive          TaxSettingsDefaultsTaxBehavior = "inclusive"
    16  	TaxSettingsDefaultsTaxBehaviorInferredByCurrency TaxSettingsDefaultsTaxBehavior = "inferred_by_currency"
    17  )
    18  
    19  // The `active` status indicates you have all required settings to calculate tax. A status can transition out of `active` when new required settings are introduced.
    20  type TaxSettingsStatus string
    21  
    22  // List of values that TaxSettingsStatus can take
    23  const (
    24  	TaxSettingsStatusActive  TaxSettingsStatus = "active"
    25  	TaxSettingsStatusPending TaxSettingsStatus = "pending"
    26  )
    27  
    28  // Retrieves Tax Settings for a merchant.
    29  type TaxSettingsParams struct {
    30  	Params `form:"*"`
    31  	// Default configuration to be used on Stripe Tax calculations.
    32  	Defaults *TaxSettingsDefaultsParams `form:"defaults"`
    33  	// Specifies which fields in the response should be expanded.
    34  	Expand []*string `form:"expand"`
    35  	// The place where your business is located.
    36  	HeadOffice *TaxSettingsHeadOfficeParams `form:"head_office"`
    37  }
    38  
    39  // AddExpand appends a new field to expand.
    40  func (p *TaxSettingsParams) AddExpand(f string) {
    41  	p.Expand = append(p.Expand, &f)
    42  }
    43  
    44  // Default configuration to be used on Stripe Tax calculations.
    45  type TaxSettingsDefaultsParams struct {
    46  	// Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. One of inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null.
    47  	TaxBehavior *string `form:"tax_behavior"`
    48  	// A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
    49  	TaxCode *string `form:"tax_code"`
    50  }
    51  
    52  // The place where your business is located.
    53  type TaxSettingsHeadOfficeParams struct {
    54  	// The location of the business for tax purposes.
    55  	Address *AddressParams `form:"address"`
    56  }
    57  type TaxSettingsDefaults struct {
    58  	// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior.
    59  	TaxBehavior TaxSettingsDefaultsTaxBehavior `json:"tax_behavior"`
    60  	// Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices.
    61  	TaxCode string `json:"tax_code"`
    62  }
    63  
    64  // The place where your business is located.
    65  type TaxSettingsHeadOffice struct {
    66  	Address *Address `json:"address"`
    67  }
    68  type TaxSettingsStatusDetailsActive struct{}
    69  type TaxSettingsStatusDetailsPending struct {
    70  	// The list of missing fields that are required to perform calculations. It includes the entry `head_office` when the status is `pending`. It is recommended to set the optional values even if they aren't listed as required for calculating taxes. Calculations can fail if missing fields aren't explicitly provided on every call.
    71  	MissingFields []string `json:"missing_fields"`
    72  }
    73  type TaxSettingsStatusDetails struct {
    74  	Active  *TaxSettingsStatusDetailsActive  `json:"active"`
    75  	Pending *TaxSettingsStatusDetailsPending `json:"pending"`
    76  }
    77  
    78  // You can use Tax `Settings` to manage configurations used by Stripe Tax calculations.
    79  //
    80  // Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api)
    81  type TaxSettings struct {
    82  	APIResource
    83  	Defaults *TaxSettingsDefaults `json:"defaults"`
    84  	// The place where your business is located.
    85  	HeadOffice *TaxSettingsHeadOffice `json:"head_office"`
    86  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
    87  	Livemode bool `json:"livemode"`
    88  	// String representing the object's type. Objects of the same type share the same value.
    89  	Object string `json:"object"`
    90  	// The `active` status indicates you have all required settings to calculate tax. A status can transition out of `active` when new required settings are introduced.
    91  	Status        TaxSettingsStatus         `json:"status"`
    92  	StatusDetails *TaxSettingsStatusDetails `json:"status_details"`
    93  }