@@ -8,6 +8,17 @@ export class InvoiceLineItems extends APIResource {
88 /**
99 * This creates a one-off fixed fee invoice line item on an Invoice. This can only
1010 * be done for invoices that are in a `draft` status.
11+ *
12+ * The behavior depends on which parameters are provided:
13+ *
14+ * - If `item_id` is provided without `name`: The item is looked up by ID, and the
15+ * item's name is used for the line item.
16+ * - If `name` is provided without `item_id`: An item with the given name is
17+ * searched for in the account. If found, that item is used. If not found, a new
18+ * item is created with that name. The new item's name is used for the line item.
19+ * - If both `item_id` and `name` are provided: The item is looked up by ID for
20+ * association, but the provided `name` is used for the line item (not the item's
21+ * name).
1122 */
1223 create (
1324 body : InvoiceLineItemCreateParams ,
@@ -168,12 +179,6 @@ export interface InvoiceLineItemCreateParams {
168179 */
169180 invoice_id : string ;
170181
171- /**
172- * The item name associated with this line item. If an item with the same name
173- * exists in Orb, that item will be associated with the line item.
174- */
175- name : string ;
176-
177182 /**
178183 * The number of units on the line item
179184 */
@@ -183,6 +188,24 @@ export interface InvoiceLineItemCreateParams {
183188 * A date string to specify the line item's start date in the customer's timezone.
184189 */
185190 start_date : string ;
191+
192+ /**
193+ * The id of the item to associate with this line item. If provided without `name`,
194+ * the item's name will be used for the price/line item. If provided with `name`,
195+ * the item will be associated but `name` will be used for the line item. At least
196+ * one of `name` or `item_id` must be provided.
197+ */
198+ item_id ?: string | null ;
199+
200+ /**
201+ * The name to use for the line item. If `item_id` is not provided, Orb will search
202+ * for an item with this name. If found, that item will be associated with the line
203+ * item. If not found, a new item will be created with this name. If `item_id` is
204+ * provided, this name will be used for the line item, but the item association
205+ * will be based on `item_id`. At least one of `name` or `item_id` must be
206+ * provided.
207+ */
208+ name ?: string | null ;
186209}
187210
188211export declare namespace InvoiceLineItems {
0 commit comments