Class: Orb::Resources::InvoiceLineItems

Inherits:
Object
  • Object
show all
Defined in:
lib/orb/resources/invoice_line_items.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ InvoiceLineItems

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InvoiceLineItems.

Parameters:



45
46
47
# File 'lib/orb/resources/invoice_line_items.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#create(amount: , end_date: , invoice_id: , name: , quantity: , start_date: , request_options: {}) ⇒ Orb::Models::InvoiceLineItemCreateResponse

Some parameter documentations has been truncated, see Models::InvoiceLineItemCreateParams for more details.

This creates a one-off fixed fee invoice line item on an Invoice. This can only be done for invoices that are in a ‘draft` status.

Parameters:

  • amount (String)

    The total amount in the invoice’s currency to add to the line item.

  • end_date (Date)

    A date string to specify the line item’s end date in the customer’s timezone.

  • invoice_id (String)

    The id of the Invoice to add this line item.

  • name (String)

    The item name associated with this line item. If an item with the same name exis

  • quantity (Float)

    The number of units on the line item

  • start_date (Date)

    A date string to specify the line item’s start date in the customer’s timezone.

  • request_options (Orb::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
# File 'lib/orb/resources/invoice_line_items.rb', line 31

def create(params)
  parsed, options = Orb::InvoiceLineItemCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "invoice_line_items",
    body: parsed,
    model: Orb::Models::InvoiceLineItemCreateResponse,
    options: options
  )
end