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

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice.
    10  type CreditNoteLineItemType string
    11  
    12  // List of values that CreditNoteLineItemType can take
    13  const (
    14  	CreditNoteLineItemTypeCustomLineItem  CreditNoteLineItemType = "custom_line_item"
    15  	CreditNoteLineItemTypeInvoiceLineItem CreditNoteLineItemType = "invoice_line_item"
    16  )
    17  
    18  // The integer amount in cents (or local equivalent) representing the discount being credited for this line item.
    19  type CreditNoteLineItemDiscountAmount struct {
    20  	// The amount, in cents (or local equivalent), of the discount.
    21  	Amount int64 `json:"amount"`
    22  	// The discount that was applied to get this discount amount.
    23  	Discount *Discount `json:"discount"`
    24  }
    25  
    26  // CreditNoteLineItem is the resource representing a Stripe credit note line item.
    27  // For more details see https://stripe.com/docs/api/credit_notes/line_item
    28  // The credit note line item object
    29  type CreditNoteLineItem struct {
    30  	// The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
    31  	Amount int64 `json:"amount"`
    32  	// The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts.
    33  	AmountExcludingTax int64 `json:"amount_excluding_tax"`
    34  	// Description of the item being credited.
    35  	Description string `json:"description"`
    36  	// The integer amount in cents (or local equivalent) representing the discount being credited for this line item.
    37  	DiscountAmount int64 `json:"discount_amount"`
    38  	// The amount of discount calculated per discount for this line item
    39  	DiscountAmounts []*CreditNoteLineItemDiscountAmount `json:"discount_amounts"`
    40  	// Unique identifier for the object.
    41  	ID string `json:"id"`
    42  	// ID of the invoice line item being credited
    43  	InvoiceLineItem string `json:"invoice_line_item"`
    44  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
    45  	Livemode bool `json:"livemode"`
    46  	// String representing the object's type. Objects of the same type share the same value.
    47  	Object string `json:"object"`
    48  	// The number of units of product being credited.
    49  	Quantity int64 `json:"quantity"`
    50  	// The amount of tax calculated per tax rate for this line item
    51  	TaxAmounts []*CreditNoteTaxAmount `json:"tax_amounts"`
    52  	// The tax rates which apply to the line item.
    53  	TaxRates []*TaxRate `json:"tax_rates"`
    54  	// The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice.
    55  	Type CreditNoteLineItemType `json:"type"`
    56  	// The cost of each unit of product being credited.
    57  	UnitAmount int64 `json:"unit_amount"`
    58  	// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.
    59  	UnitAmountDecimal float64 `json:"unit_amount_decimal,string"`
    60  	// The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts.
    61  	UnitAmountExcludingTax float64 `json:"unit_amount_excluding_tax,string"`
    62  }
    63  
    64  // CreditNoteLineItemList is a list of CreditNoteLineItems as retrieved from a list endpoint.
    65  type CreditNoteLineItemList struct {
    66  	APIResource
    67  	ListMeta
    68  	Data []*CreditNoteLineItem `json:"data"`
    69  }