orb-billing
Version:
The official TypeScript library for the Orb API
33 lines • 1.73 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvoiceLineItems = void 0;
const resource_1 = require("../resource.js");
/**
* An [`Invoice`](/core-concepts#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.
*/
class InvoiceLineItems extends resource_1.APIResource {
/**
* 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_id` is provided without `name`: The item is looked up by ID, and the
* item's name is used for the line item.
* - If `name` is provided without `item_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_id` and `name` are provided: The item is looked up by ID for
* association, but the provided `name` is used for the line item (not the item's
* name).
*/
create(body, options) {
return this._client.post('/invoice_line_items', { body, ...options });
}
}
exports.InvoiceLineItems = InvoiceLineItems;
//# sourceMappingURL=invoice-line-items.js.map