21
21
"CustomerBalanceTransactionInvoice" ,
22
22
"CustomerTaxID" ,
23
23
"LineItem" ,
24
+ "LineItemAdjustment" ,
25
+ "LineItemAdjustmentAmountDiscountAdjustment" ,
26
+ "LineItemAdjustmentPercentageDiscountAdjustment" ,
27
+ "LineItemAdjustmentUsageDiscountAdjustment" ,
28
+ "LineItemAdjustmentMinimumAdjustment" ,
29
+ "LineItemAdjustmentMaximumAdjustment" ,
24
30
"LineItemMaximum" ,
25
31
"LineItemMinimum" ,
26
32
"LineItemSubLineItem" ,
@@ -319,6 +325,156 @@ class CustomerTaxID(BaseModel):
319
325
value : str
320
326
321
327
328
+ class LineItemAdjustmentAmountDiscountAdjustment (BaseModel ):
329
+ id : str
330
+
331
+ adjustment_type : Literal ["amount_discount" ]
332
+
333
+ amount_discount : str
334
+ """
335
+ The amount by which to discount the prices this adjustment applies to in a given
336
+ billing period.
337
+ """
338
+
339
+ applies_to_price_ids : List [str ]
340
+ """The price IDs that this adjustment applies to."""
341
+
342
+ is_invoice_level : bool
343
+ """
344
+ True for adjustments that apply to an entire invocice, false for adjustments
345
+ that apply to only one price.
346
+ """
347
+
348
+ plan_phase_order : Optional [int ] = None
349
+ """The plan phase in which this adjustment is active."""
350
+
351
+ reason : Optional [str ] = None
352
+ """The reason for the adjustment."""
353
+
354
+
355
+ class LineItemAdjustmentPercentageDiscountAdjustment (BaseModel ):
356
+ id : str
357
+
358
+ adjustment_type : Literal ["percentage_discount" ]
359
+
360
+ applies_to_price_ids : List [str ]
361
+ """The price IDs that this adjustment applies to."""
362
+
363
+ is_invoice_level : bool
364
+ """
365
+ True for adjustments that apply to an entire invocice, false for adjustments
366
+ that apply to only one price.
367
+ """
368
+
369
+ percentage_discount : float
370
+ """
371
+ The percentage (as a value between 0 and 1) by which to discount the price
372
+ intervals this adjustment applies to in a given billing period.
373
+ """
374
+
375
+ plan_phase_order : Optional [int ] = None
376
+ """The plan phase in which this adjustment is active."""
377
+
378
+ reason : Optional [str ] = None
379
+ """The reason for the adjustment."""
380
+
381
+
382
+ class LineItemAdjustmentUsageDiscountAdjustment (BaseModel ):
383
+ id : str
384
+
385
+ adjustment_type : Literal ["usage_discount" ]
386
+
387
+ applies_to_price_ids : List [str ]
388
+ """The price IDs that this adjustment applies to."""
389
+
390
+ is_invoice_level : bool
391
+ """
392
+ True for adjustments that apply to an entire invocice, false for adjustments
393
+ that apply to only one price.
394
+ """
395
+
396
+ plan_phase_order : Optional [int ] = None
397
+ """The plan phase in which this adjustment is active."""
398
+
399
+ reason : Optional [str ] = None
400
+ """The reason for the adjustment."""
401
+
402
+ usage_discount : float
403
+ """
404
+ The number of usage units by which to discount the price this adjustment applies
405
+ to in a given billing period.
406
+ """
407
+
408
+
409
+ class LineItemAdjustmentMinimumAdjustment (BaseModel ):
410
+ id : str
411
+
412
+ adjustment_type : Literal ["minimum" ]
413
+
414
+ applies_to_price_ids : List [str ]
415
+ """The price IDs that this adjustment applies to."""
416
+
417
+ is_invoice_level : bool
418
+ """
419
+ True for adjustments that apply to an entire invocice, false for adjustments
420
+ that apply to only one price.
421
+ """
422
+
423
+ item_id : str
424
+ """The item ID that revenue from this minimum will be attributed to."""
425
+
426
+ minimum_amount : str
427
+ """
428
+ The minimum amount to charge in a given billing period for the prices this
429
+ adjustment applies to.
430
+ """
431
+
432
+ plan_phase_order : Optional [int ] = None
433
+ """The plan phase in which this adjustment is active."""
434
+
435
+ reason : Optional [str ] = None
436
+ """The reason for the adjustment."""
437
+
438
+
439
+ class LineItemAdjustmentMaximumAdjustment (BaseModel ):
440
+ id : str
441
+
442
+ adjustment_type : Literal ["maximum" ]
443
+
444
+ applies_to_price_ids : List [str ]
445
+ """The price IDs that this adjustment applies to."""
446
+
447
+ is_invoice_level : bool
448
+ """
449
+ True for adjustments that apply to an entire invocice, false for adjustments
450
+ that apply to only one price.
451
+ """
452
+
453
+ maximum_amount : str
454
+ """
455
+ The maximum amount to charge in a given billing period for the prices this
456
+ adjustment applies to.
457
+ """
458
+
459
+ plan_phase_order : Optional [int ] = None
460
+ """The plan phase in which this adjustment is active."""
461
+
462
+ reason : Optional [str ] = None
463
+ """The reason for the adjustment."""
464
+
465
+
466
+ LineItemAdjustment : TypeAlias = Annotated [
467
+ Union [
468
+ LineItemAdjustmentAmountDiscountAdjustment ,
469
+ LineItemAdjustmentPercentageDiscountAdjustment ,
470
+ LineItemAdjustmentUsageDiscountAdjustment ,
471
+ LineItemAdjustmentMinimumAdjustment ,
472
+ LineItemAdjustmentMaximumAdjustment ,
473
+ ],
474
+ PropertyInfo (discriminator = "adjustment_type" ),
475
+ ]
476
+
477
+
322
478
class LineItemMaximum (BaseModel ):
323
479
applies_to_price_ids : List [str ]
324
480
"""List of price_ids that this maximum amount applies to.
@@ -441,9 +597,21 @@ class LineItem(BaseModel):
441
597
id : str
442
598
"""A unique ID for this line item."""
443
599
600
+ adjusted_subtotal : str
601
+ """
602
+ The line amount after any adjustments, before overage conversion, credits and
603
+ partial invoicing.
604
+ """
605
+
606
+ adjustments : List [LineItemAdjustment ]
607
+ """All adjustments applied to the line item."""
608
+
444
609
amount : str
445
610
"""The final amount after any discounts or minimums."""
446
611
612
+ credits_applied : str
613
+ """The number of credits used"""
614
+
447
615
discount : Optional [Discount ] = None
448
616
449
617
end_date : datetime
@@ -457,16 +625,23 @@ class LineItem(BaseModel):
457
625
"""
458
626
459
627
maximum : Optional [LineItemMaximum ] = None
628
+ """This field is deprecated in favor of `adjustments`."""
460
629
461
630
maximum_amount : Optional [str ] = None
631
+ """This field is deprecated in favor of `adjustments`."""
462
632
463
633
minimum : Optional [LineItemMinimum ] = None
634
+ """This field is deprecated in favor of `adjustments`."""
464
635
465
636
minimum_amount : Optional [str ] = None
637
+ """This field is deprecated in favor of `adjustments`."""
466
638
467
639
name : str
468
640
"""The name of the price associated with this line item."""
469
641
642
+ partially_invoiced_amount : str
643
+ """Any amount applied from a partial invoice"""
644
+
470
645
price : Optional [Price ] = None
471
646
"""
472
647
The Price resource represents a price that can be billed on a subscription,
0 commit comments