Class: Stripe::InvoiceLineItemService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::InvoiceLineItemService
- Defined in:
- lib/stripe/services/invoice_line_item_service.rb
Defined Under Namespace
Classes: ListParams, UpdateParams
Instance Method Summary collapse
-
#list(invoice, params = {}, opts = {}) ⇒ Object
When retrieving an invoice, you’ll get a lines property containing the total count of line items and the first handful of those items.
-
#update(invoice, line_item_id, params = {}, opts = {}) ⇒ Object
Updates an invoice’s line item.
Methods inherited from StripeService
#initialize, #request, #request_stream
Constructor Details
This class inherits a constructor from Stripe::StripeService
Instance Method Details
#list(invoice, params = {}, opts = {}) ⇒ Object
When retrieving an invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
244 245 246 247 248 249 250 251 252 |
# File 'lib/stripe/services/invoice_line_item_service.rb', line 244 def list(invoice, params = {}, opts = {}) request( method: :get, path: format("/v1/invoices/%<invoice>s/lines", { invoice: CGI.escape(invoice) }), params: params, opts: opts, base_address: :api ) end |
#update(invoice, line_item_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.
258 259 260 261 262 263 264 265 266 |
# File 'lib/stripe/services/invoice_line_item_service.rb', line 258 def update(invoice, line_item_id, params = {}, opts = {}) request( method: :post, path: format("/v1/invoices/%<invoice>s/lines/%<line_item_id>s", { invoice: CGI.escape(invoice), line_item_id: CGI.escape(line_item_id) }), params: params, opts: opts, base_address: :api ) end |