Class: Stripe::InvoiceLineItemService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/invoice_line_item_service.rb

Defined Under Namespace

Classes: ListParams, UpdateParams

Instance Method Summary collapse

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.



260
261
262
263
264
265
266
267
268
# File 'lib/stripe/services/invoice_line_item_service.rb', line 260

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.



274
275
276
277
278
279
280
281
282
# File 'lib/stripe/services/invoice_line_item_service.rb', line 274

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