Class: Orb::Resources::InvoiceLineItems
- Inherits:
-
Object
- Object
- Orb::Resources::InvoiceLineItems
- Defined in:
- lib/orb/resources/invoice_line_items.rb,
sig/orb/resources/invoice_line_items.rbs
Overview
An Invoice is a fundamental billing entity,
representing the request for payment for a single subscription. This includes a
set of line items, which correspond to prices in the subscription's plan and can
represent fixed recurring fees or usage-based fees. They are generated at the
end of a billing period, or as the result of an action, such as a cancellation.
Instance Method Summary collapse
-
#create(amount:, end_date:, invoice_id:, quantity:, start_date:, item_id: nil, name: nil, request_options: {}) ⇒ Orb::Models::InvoiceLineItemCreateResponse
Some parameter documentations has been truncated, see Models::InvoiceLineItemCreateParams for more details.
-
#initialize(client:) ⇒ InvoiceLineItems
constructor
private
A new instance of InvoiceLineItems.
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.
63 64 65 |
# File 'lib/orb/resources/invoice_line_items.rb', line 63 def initialize(client:) @client = client end |
Instance Method Details
#create(amount:, end_date:, invoice_id:, quantity:, start_date:, item_id: nil, name: nil, 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.
The behavior depends on which parameters are provided:
- If
item_idis provided withoutname: The item is looked up by ID, and the item's name is used for the line item. - If
nameis provided withoutitem_id: An item with the given name is searched for in the account. If found, that item is used. If not found, a new item is created with that name. The new item's name is used for the line item. - If both
item_idandnameare provided: The item is looked up by ID for association, but the providednameis used for the line item (not the item's name).
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/orb/resources/invoice_line_items.rb', line 49 def create(params) parsed, = Orb::InvoiceLineItemCreateParams.dump_request(params) @client.request( method: :post, path: "invoice_line_items", body: parsed, model: Orb::Models::InvoiceLineItemCreateResponse, options: ) end |