Class: Stripe::InvoiceLineItemService

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

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.



7
8
9
10
11
12
13
14
15
# File 'lib/stripe/services/invoice_line_item_service.rb', line 7

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.



21
22
23
24
25
26
27
28
29
# File 'lib/stripe/services/invoice_line_item_service.rb', line 21

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