Class: Stripe::InvoiceLineItem
- Inherits:
-
StripeObject
- Object
- StripeObject
- Stripe::InvoiceLineItem
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/invoice_line_item.rb
Overview
Invoice Line Items represent the individual lines within an [invoice](stripe.com/docs/api/invoices) and only exist within the context of an invoice.
Each line item is backed by either an [invoice item](stripe.com/docs/api/invoiceitems) or a [subscription item](stripe.com/docs/api/subscription_items).
Constant Summary collapse
- OBJECT_NAME =
"line_item"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from StripeObject
Class Method Summary collapse
- .object_name ⇒ Object
-
.update(id, params = {}, opts = {}) ⇒ Object
Updates an invoice’s line item.
Methods included from APIOperations::Save
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Class Method Details
.object_name ⇒ Object
12 13 14 |
# File 'lib/stripe/resources/invoice_line_item.rb', line 12 def self.object_name "line_item" end |
.update(id, params = {}, opts = {}) ⇒ Object
Updates an invoice’s line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.
20 21 22 23 24 25 26 27 |
# File 'lib/stripe/resources/invoice_line_item.rb', line 20 def self.update(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/invoices/%<invoice>s/lines/%<id>s", { invoice: CGI.escape(invoice), id: CGI.escape(id) }), params: params, opts: opts ) end |