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

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
    10  type LineItemTaxTaxabilityReason string
    11  
    12  // List of values that LineItemTaxTaxabilityReason can take
    13  const (
    14  	LineItemTaxTaxabilityReasonCustomerExempt       LineItemTaxTaxabilityReason = "customer_exempt"
    15  	LineItemTaxTaxabilityReasonNotCollecting        LineItemTaxTaxabilityReason = "not_collecting"
    16  	LineItemTaxTaxabilityReasonNotSubjectToTax      LineItemTaxTaxabilityReason = "not_subject_to_tax"
    17  	LineItemTaxTaxabilityReasonNotSupported         LineItemTaxTaxabilityReason = "not_supported"
    18  	LineItemTaxTaxabilityReasonPortionProductExempt LineItemTaxTaxabilityReason = "portion_product_exempt"
    19  	LineItemTaxTaxabilityReasonPortionReducedRated  LineItemTaxTaxabilityReason = "portion_reduced_rated"
    20  	LineItemTaxTaxabilityReasonPortionStandardRated LineItemTaxTaxabilityReason = "portion_standard_rated"
    21  	LineItemTaxTaxabilityReasonProductExempt        LineItemTaxTaxabilityReason = "product_exempt"
    22  	LineItemTaxTaxabilityReasonProductExemptHoliday LineItemTaxTaxabilityReason = "product_exempt_holiday"
    23  	LineItemTaxTaxabilityReasonProportionallyRated  LineItemTaxTaxabilityReason = "proportionally_rated"
    24  	LineItemTaxTaxabilityReasonReducedRated         LineItemTaxTaxabilityReason = "reduced_rated"
    25  	LineItemTaxTaxabilityReasonReverseCharge        LineItemTaxTaxabilityReason = "reverse_charge"
    26  	LineItemTaxTaxabilityReasonStandardRated        LineItemTaxTaxabilityReason = "standard_rated"
    27  	LineItemTaxTaxabilityReasonTaxableBasisReduced  LineItemTaxTaxabilityReason = "taxable_basis_reduced"
    28  	LineItemTaxTaxabilityReasonZeroRated            LineItemTaxTaxabilityReason = "zero_rated"
    29  )
    30  
    31  // The discounts applied to the line item.
    32  type LineItemDiscount struct {
    33  	// The amount discounted.
    34  	Amount int64 `json:"amount"`
    35  	// A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
    36  	// It contains information about when the discount began, when it will end, and what it is applied to.
    37  	//
    38  	// Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
    39  	Discount *Discount `json:"discount"`
    40  }
    41  
    42  // The taxes applied to the line item.
    43  type LineItemTax struct {
    44  	// Amount of tax applied for this rate.
    45  	Amount int64 `json:"amount"`
    46  	// Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.
    47  	//
    48  	// Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates)
    49  	Rate *TaxRate `json:"rate"`
    50  	// The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
    51  	TaxabilityReason LineItemTaxTaxabilityReason `json:"taxability_reason"`
    52  	// The amount on which tax is calculated, in cents (or local equivalent).
    53  	TaxableAmount int64 `json:"taxable_amount"`
    54  }
    55  
    56  // A line item.
    57  type LineItem struct {
    58  	// Total discount amount applied. If no discounts were applied, defaults to 0.
    59  	AmountDiscount int64 `json:"amount_discount"`
    60  	// Total before any discounts or taxes are applied.
    61  	AmountSubtotal int64 `json:"amount_subtotal"`
    62  	// Total tax amount applied. If no tax was applied, defaults to 0.
    63  	AmountTax int64 `json:"amount_tax"`
    64  	// Total after discounts and taxes.
    65  	AmountTotal int64 `json:"amount_total"`
    66  	// 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).
    67  	Currency Currency `json:"currency"`
    68  	// An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name.
    69  	Description string `json:"description"`
    70  	// The discounts applied to the line item.
    71  	Discounts []*LineItemDiscount `json:"discounts"`
    72  	// Unique identifier for the object.
    73  	ID string `json:"id"`
    74  	// String representing the object's type. Objects of the same type share the same value.
    75  	Object string `json:"object"`
    76  	// The price used to generate the line item.
    77  	Price *Price `json:"price"`
    78  	// The quantity of products being purchased.
    79  	Quantity int64 `json:"quantity"`
    80  	// The taxes applied to the line item.
    81  	Taxes []*LineItemTax `json:"taxes"`
    82  }
    83  
    84  // LineItemList is a list of LineItems as retrieved from a list endpoint.
    85  type LineItemList struct {
    86  	APIResource
    87  	ListMeta
    88  	Data []*LineItem `json:"data"`
    89  }