22
22
"CustomerTaxID" ,
23
23
"LineItem" ,
24
24
"LineItemAdjustment" ,
25
- "LineItemAdjustmentAmountDiscountAdjustment " ,
26
- "LineItemAdjustmentPercentageDiscountAdjustment " ,
27
- "LineItemAdjustmentUsageDiscountAdjustment " ,
28
- "LineItemAdjustmentMinimumAdjustment " ,
29
- "LineItemAdjustmentMaximumAdjustment " ,
25
+ "LineItemAdjustmentMonetaryUsageDiscountAdjustment " ,
26
+ "LineItemAdjustmentMonetaryAmountDiscountAdjustment " ,
27
+ "LineItemAdjustmentMonetaryPercentageDiscountAdjustment " ,
28
+ "LineItemAdjustmentMonetaryMinimumAdjustment " ,
29
+ "LineItemAdjustmentMonetaryMaximumAdjustment " ,
30
30
"LineItemMaximum" ,
31
31
"LineItemMinimum" ,
32
32
"LineItemSubLineItem" ,
@@ -325,16 +325,13 @@ class CustomerTaxID(BaseModel):
325
325
value : str
326
326
327
327
328
- class LineItemAdjustmentAmountDiscountAdjustment (BaseModel ):
328
+ class LineItemAdjustmentMonetaryUsageDiscountAdjustment (BaseModel ):
329
329
id : str
330
330
331
- adjustment_type : Literal ["amount_discount " ]
331
+ adjustment_type : Literal ["usage_discount " ]
332
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
- """
333
+ amount : str
334
+ """The value applied by an adjustment."""
338
335
339
336
applies_to_price_ids : List [str ]
340
337
"""The price IDs that this adjustment applies to."""
@@ -345,17 +342,29 @@ class LineItemAdjustmentAmountDiscountAdjustment(BaseModel):
345
342
that apply to only one price.
346
343
"""
347
344
348
- plan_phase_order : Optional [int ] = None
349
- """The plan phase in which this adjustment is active."""
350
-
351
345
reason : Optional [str ] = None
352
346
"""The reason for the adjustment."""
353
347
348
+ usage_discount : float
349
+ """
350
+ The number of usage units by which to discount the price this adjustment applies
351
+ to in a given billing period.
352
+ """
353
+
354
354
355
- class LineItemAdjustmentPercentageDiscountAdjustment (BaseModel ):
355
+ class LineItemAdjustmentMonetaryAmountDiscountAdjustment (BaseModel ):
356
356
id : str
357
357
358
- adjustment_type : Literal ["percentage_discount" ]
358
+ adjustment_type : Literal ["amount_discount" ]
359
+
360
+ amount : str
361
+ """The value applied by an adjustment."""
362
+
363
+ amount_discount : str
364
+ """
365
+ The amount by which to discount the prices this adjustment applies to in a given
366
+ billing period.
367
+ """
359
368
360
369
applies_to_price_ids : List [str ]
361
370
"""The price IDs that this adjustment applies to."""
@@ -366,23 +375,17 @@ class LineItemAdjustmentPercentageDiscountAdjustment(BaseModel):
366
375
that apply to only one price.
367
376
"""
368
377
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
378
reason : Optional [str ] = None
379
379
"""The reason for the adjustment."""
380
380
381
381
382
- class LineItemAdjustmentUsageDiscountAdjustment (BaseModel ):
382
+ class LineItemAdjustmentMonetaryPercentageDiscountAdjustment (BaseModel ):
383
383
id : str
384
384
385
- adjustment_type : Literal ["usage_discount" ]
385
+ adjustment_type : Literal ["percentage_discount" ]
386
+
387
+ amount : str
388
+ """The value applied by an adjustment."""
386
389
387
390
applies_to_price_ids : List [str ]
388
391
"""The price IDs that this adjustment applies to."""
@@ -393,24 +396,24 @@ class LineItemAdjustmentUsageDiscountAdjustment(BaseModel):
393
396
that apply to only one price.
394
397
"""
395
398
396
- plan_phase_order : Optional [int ] = None
397
- """The plan phase in which this adjustment is active."""
399
+ percentage_discount : float
400
+ """
401
+ The percentage (as a value between 0 and 1) by which to discount the price
402
+ intervals this adjustment applies to in a given billing period.
403
+ """
398
404
399
405
reason : Optional [str ] = None
400
406
"""The reason for the adjustment."""
401
407
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
408
-
409
- class LineItemAdjustmentMinimumAdjustment (BaseModel ):
409
+ class LineItemAdjustmentMonetaryMinimumAdjustment (BaseModel ):
410
410
id : str
411
411
412
412
adjustment_type : Literal ["minimum" ]
413
413
414
+ amount : str
415
+ """The value applied by an adjustment."""
416
+
414
417
applies_to_price_ids : List [str ]
415
418
"""The price IDs that this adjustment applies to."""
416
419
@@ -429,18 +432,18 @@ class LineItemAdjustmentMinimumAdjustment(BaseModel):
429
432
adjustment applies to.
430
433
"""
431
434
432
- plan_phase_order : Optional [int ] = None
433
- """The plan phase in which this adjustment is active."""
434
-
435
435
reason : Optional [str ] = None
436
436
"""The reason for the adjustment."""
437
437
438
438
439
- class LineItemAdjustmentMaximumAdjustment (BaseModel ):
439
+ class LineItemAdjustmentMonetaryMaximumAdjustment (BaseModel ):
440
440
id : str
441
441
442
442
adjustment_type : Literal ["maximum" ]
443
443
444
+ amount : str
445
+ """The value applied by an adjustment."""
446
+
444
447
applies_to_price_ids : List [str ]
445
448
"""The price IDs that this adjustment applies to."""
446
449
@@ -456,20 +459,17 @@ class LineItemAdjustmentMaximumAdjustment(BaseModel):
456
459
adjustment applies to.
457
460
"""
458
461
459
- plan_phase_order : Optional [int ] = None
460
- """The plan phase in which this adjustment is active."""
461
-
462
462
reason : Optional [str ] = None
463
463
"""The reason for the adjustment."""
464
464
465
465
466
466
LineItemAdjustment : TypeAlias = Annotated [
467
467
Union [
468
- LineItemAdjustmentAmountDiscountAdjustment ,
469
- LineItemAdjustmentPercentageDiscountAdjustment ,
470
- LineItemAdjustmentUsageDiscountAdjustment ,
471
- LineItemAdjustmentMinimumAdjustment ,
472
- LineItemAdjustmentMaximumAdjustment ,
468
+ LineItemAdjustmentMonetaryUsageDiscountAdjustment ,
469
+ LineItemAdjustmentMonetaryAmountDiscountAdjustment ,
470
+ LineItemAdjustmentMonetaryPercentageDiscountAdjustment ,
471
+ LineItemAdjustmentMonetaryMinimumAdjustment ,
472
+ LineItemAdjustmentMonetaryMaximumAdjustment ,
473
473
],
474
474
PropertyInfo (discriminator = "adjustment_type" ),
475
475
]
@@ -599,18 +599,21 @@ class LineItem(BaseModel):
599
599
600
600
adjusted_subtotal : str
601
601
"""
602
- The line amount after any adjustments, before overage conversion, credits and
602
+ The line amount after any adjustments and before overage conversion, credits and
603
603
partial invoicing.
604
604
"""
605
605
606
606
adjustments : List [LineItemAdjustment ]
607
- """All adjustments applied to the line item."""
607
+ """All adjustments (ie. maximums, minimums, discounts) applied to the line item."""
608
608
609
609
amount : str
610
- """The final amount after any discounts or minimums."""
610
+ """
611
+ The final amount for a line item after all adjustments and pre paid credits have
612
+ been applied.
613
+ """
611
614
612
615
credits_applied : str
613
- """The number of credits used """
616
+ """The number of prepaid credits applied. """
614
617
615
618
discount : Optional [Discount ] = None
616
619
@@ -657,6 +660,7 @@ class LineItem(BaseModel):
657
660
"""
658
661
659
662
quantity : float
663
+ """Either the fixed fee quantity or the usage during the service period."""
660
664
661
665
start_date : datetime
662
666
"""The start date of the range of time applied for this line item's price."""
@@ -668,7 +672,7 @@ class LineItem(BaseModel):
668
672
"""
669
673
670
674
subtotal : str
671
- """The line amount before any line item-specific discounts or minimums ."""
675
+ """The line amount before before any adjustments ."""
672
676
673
677
tax_amounts : List [LineItemTaxAmount ]
674
678
"""An array of tax rates and their incurred tax amounts.
0 commit comments