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

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
    10  type TaxTransactionLineItemTaxBehavior string
    11  
    12  // List of values that TaxTransactionLineItemTaxBehavior can take
    13  const (
    14  	TaxTransactionLineItemTaxBehaviorExclusive TaxTransactionLineItemTaxBehavior = "exclusive"
    15  	TaxTransactionLineItemTaxBehaviorInclusive TaxTransactionLineItemTaxBehavior = "inclusive"
    16  )
    17  
    18  // If `reversal`, this line item reverses an earlier transaction.
    19  type TaxTransactionLineItemType string
    20  
    21  // List of values that TaxTransactionLineItemType can take
    22  const (
    23  	TaxTransactionLineItemTypeReversal    TaxTransactionLineItemType = "reversal"
    24  	TaxTransactionLineItemTypeTransaction TaxTransactionLineItemType = "transaction"
    25  )
    26  
    27  // If `type=reversal`, contains information about what was reversed.
    28  type TaxTransactionLineItemReversal struct {
    29  	// The `id` of the line item to reverse in the original transaction.
    30  	OriginalLineItem string `json:"original_line_item"`
    31  }
    32  type TaxTransactionLineItem struct {
    33  	// The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
    34  	Amount int64 `json:"amount"`
    35  	// The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
    36  	AmountTax int64 `json:"amount_tax"`
    37  	// Unique identifier for the object.
    38  	ID string `json:"id"`
    39  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
    40  	Livemode bool `json:"livemode"`
    41  	// 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.
    42  	Metadata map[string]string `json:"metadata"`
    43  	// String representing the object's type. Objects of the same type share the same value.
    44  	Object string `json:"object"`
    45  	// The ID of an existing [Product](https://stripe.com/docs/api/products/object).
    46  	Product string `json:"product"`
    47  	// The number of units of the item being purchased. For reversals, this is the quantity reversed.
    48  	Quantity int64 `json:"quantity"`
    49  	// A custom identifier for this line item in the transaction.
    50  	Reference string `json:"reference"`
    51  	// If `type=reversal`, contains information about what was reversed.
    52  	Reversal *TaxTransactionLineItemReversal `json:"reversal"`
    53  	// Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
    54  	TaxBehavior TaxTransactionLineItemTaxBehavior `json:"tax_behavior"`
    55  	// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource.
    56  	TaxCode string `json:"tax_code"`
    57  	// If `reversal`, this line item reverses an earlier transaction.
    58  	Type TaxTransactionLineItemType `json:"type"`
    59  }
    60  
    61  // TaxTransactionLineItemList is a list of TransactionLineItems as retrieved from a list endpoint.
    62  type TaxTransactionLineItemList struct {
    63  	APIResource
    64  	ListMeta
    65  	Data []*TaxTransactionLineItem `json:"data"`
    66  }