@leaflow/sdk 0.101.0 → 0.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -171,7 +171,7 @@ export interface paths {
171
171
  * - 409 `BILLING_CANCELLATION_SCHEDULES_DIFFER` when, for `period_end`, the paid terms end at
172
172
  * different times;
173
173
  * - 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being canceled
174
- * (`meta.cancellation_id`) or reclaimed (`meta.job_id`);
174
+ * (`meta.cancellation_id`) or reclaimed (`meta.action_id`);
175
175
  * - 409 `BILLING_ORDER_PAYMENT_IN_FLIGHT` while an online payment for a renewal of one of them
176
176
  * is in progress;
177
177
  * - 409 `BILLING_CANCELLATION_REFUND_CHANGED` when the refund is no longer
@@ -247,8 +247,8 @@ export interface paths {
247
247
  };
248
248
  /**
249
249
  * List project orders
250
- * @description An order awaiting payment shows what is outstanding. Paying it is done from the billing
251
- * centre by the account owner.
250
+ * @description A draft order invoice shows base amounts awaiting checkout. A confirmed invoice shows what
251
+ * is outstanding. Checkout and payment are performed in the billing centre by the account owner.
252
252
  */
253
253
  get: operations["list-project-orders"];
254
254
  put?: never;
@@ -314,15 +314,27 @@ export interface paths {
314
314
  put?: never;
315
315
  /**
316
316
  * Quote for a project
317
- * @description Priced in the project billing account's currency, and at any rate negotiated for that account.
318
- * Nothing is reserved and nothing is recorded, so this may be called as often as required.
317
+ * @description Computes a price preview without creating a resource or saving a quote. Nothing is charged,
318
+ * reserved or applied to an order, and no discount redemption is consumed. The response has no
319
+ * quote ID and does not guarantee a price or reserve a promotion code.
319
320
  *
320
- * Prices may change between quoting and ordering. An order is charged at the price in
321
- * effect when it is placed, so a quote should be refreshed before a final confirmation is
322
- * shown.
321
+ * New purchases use the project's current billing account and currency. With order_id, the order
322
+ * must belong to this project; its recorded purchase terms, billing account and currency are used.
323
+ * An optional promotion_code previews one code for the purchase or order. Without it, Billing
324
+ * selects an applicable account discount. An invalid or inapplicable explicit code is refused
325
+ * rather than silently replaced. Give total as expected_amount when confirming checkout through
326
+ * Billing; eligibility and availability are checked again. An order already checked out returns
327
+ * its confirmed amounts without reapplying its discount; a different code is refused with
328
+ * BILLING_ORDER_CHECKOUT_CONFLICT.
329
+ *
330
+ * Prices may change before an order is created; confirmed purchase terms are not repriced from
331
+ * today's catalog. Usage estimates describe future usage and are not checkout amounts. They do
332
+ * not accept a promotion code, including when mixed with fixed purchase lines.
323
333
  *
324
334
  * A renewal is priced exactly as renewing would charge it: at the agreed amount or the price
325
- * named, with the discounts the account holds, and with tax.
335
+ * named, with the discounts the account holds, and with tax. A renewal list does not accept a
336
+ * promotion code because its entries create separate orders. To use a new code on a renewal,
337
+ * first create a renewal order and quote its checkout by order_id.
326
338
  *
327
339
  * A cancellation is quoted as creating it would compute the refund, as of now and under the refund
328
340
  * terms agreed when each subscription was bought. It is quoted on its own: combined with lines or
@@ -331,8 +343,8 @@ export interface paths {
331
343
  * amount is not checked. Give the returned `cancellation.proration_date` and
332
344
  * `cancellation.refundable_amount` when creating it.
333
345
  *
334
- * Returns 404 when the project has no billing account, or when a subscription to be renewed or
335
- * canceled does not belong to this project.
346
+ * Returns 404 when the project has no billing account for a new purchase quote, or when the order
347
+ * or a subscription to be renewed or canceled does not belong to this project.
336
348
  */
337
349
  post: operations["create-project-quote"];
338
350
  delete?: never;
@@ -421,7 +433,16 @@ export interface components {
421
433
  */
422
434
  TerminationPolicy: "immediate" | "period_end";
423
435
  /**
424
- * @description Prorated returns the unused value of paid service periods using integer-second duration ratios. Setup fees are excluded. Tax and funds follow the original invoice and payment sources.
436
+ * @description none refunds nothing. prorated refunds the amount paid for the current period minus the value of
437
+ * the time used, never below zero and never more than what remains unrefunded. The time used runs
438
+ * from the period start to the effective cancellation time and is valued at the plan's
439
+ * shorter-period prices in the same currency, frozen at purchase as the order item's
440
+ * refund_monthly_amount and refund_hourly_amount: each full calendar month at the one-month prepaid
441
+ * price, the remainder at the postpaid hourly price or, without one, at the one-month price by the
442
+ * second. When the plan has no prepaid period shorter than the one bought, the time used is valued
443
+ * at the price paid, pro rata by the second. Discounts are not refunded, as they were never paid,
444
+ * and setup fees are excluded. The refunded part returns to the payment sources it came from. Tax
445
+ * paid is refunded in the same proportion as the amount it was paid on.
425
446
  * @enum {string}
426
447
  */
427
448
  RefundPolicy: "none" | "prorated";
@@ -438,8 +459,8 @@ export interface components {
438
459
  * @description What the cancellation would return, subscription by subscription and in total, as of now. Give
439
460
  * `proration_date` and `refundable_amount` when creating the cancellation.
440
461
  *
441
- * - `unused_amount`: before tax, the value of the paid service still unused, whatever the refund
442
- * terms say.
462
+ * - `unused_amount`: before tax, the amount paid for the current periods minus the value of the
463
+ * time used, valued as refund policy `prorated` describes, whatever the refund terms say.
443
464
  * - `refundable_amount`: what is returned the way it was paid, including the tax paid on it;
444
465
  * `refund_amount` plus `credit_amount`.
445
466
  * - `refund_amount`: the part returned to the balance or to the payment method.
@@ -653,37 +674,17 @@ export interface components {
653
674
  /**
654
675
  * @description Identify a price directly, or select a price for a plan. For each resource give its ID or lookup key, never both. Lookup keys require product_id.
655
676
  *
656
- * A line that gives a meter, `dimensions` or `duration_seconds` estimates usage and is
657
- * priced only at a postpaid price. Such a line is refused with HTTP 400
658
- * `BILLING_PURCHASE_INVALID` when `price_type` is `prepaid` or `one_time`, or when the price
659
- * it names is not postpaid; `meta.field` is `price_type`, `price_id` or `price_lookup_key`
660
- * accordingly. When the plan has no postpaid price, the line is returned unpriced with
661
- * `no_price`.
677
+ * Charges for future usage are not estimated here; the service that sells the product quotes
678
+ * them with its purchase.
662
679
  */
663
680
  QuoteLine: {
664
681
  price_lookup_key?: string;
665
682
  plan_lookup_key?: string;
666
- meter_lookup_key?: string;
667
683
  /** Format: uuid */
668
684
  price_id?: string;
669
685
  product_id?: components["schemas"]["ProductID"];
670
686
  /** Format: uuid */
671
687
  plan_id?: string;
672
- /** Format: uuid */
673
- meter_id?: string;
674
- /**
675
- * @description The attributes the price depends on — region, instance type, token class.
676
- *
677
- * Required when the price draws its rates from a price list, which is how anything
678
- * sold by region or by machine type is priced. A price that carries a single unit
679
- * amount, or a ladder, has no attributes to give and takes none.
680
- *
681
- * Every attribute the meter declares must be present. A combination with no rate
682
- * covering it is refused rather than priced at zero.
683
- */
684
- dimensions?: {
685
- [key: string]: string;
686
- };
687
688
  /**
688
689
  * @description Narrows the selection when a plan offers more than one billing type.
689
690
  * @enum {string}
@@ -693,18 +694,13 @@ export interface components {
693
694
  interval?: "none" | "day" | "month" | "year";
694
695
  interval_count?: number;
695
696
  quantity: string;
696
- /**
697
- * Format: int64
698
- * @description For metered items, how long to price for. This allows an estimate such as "about
699
- * this much per month" to be shown before anything exists. The priced quantity is
700
- * `quantity` multiplied by this duration.
701
- */
702
- duration_seconds?: number;
703
697
  };
704
698
  /**
705
699
  * @description Price renewing a prepaid subscription. Give `price_id`, or `interval` with
706
700
  * `interval_count`, to renew for another term at the price currently sold for it. Naming
707
- * the current term, or giving neither, renews at the agreed amount.
701
+ * the current term, or giving neither, renews at the agreed amount. A term sold at several
702
+ * prices that differ in termination policy is refused with 409
703
+ * `BILLING_RENEWAL_OPTION_AMBIGUOUS` unless `termination_policy` or `price_id` is given.
708
704
  */
709
705
  QuoteRenewal: {
710
706
  /** Format: uuid */
@@ -714,6 +710,8 @@ export interface components {
714
710
  /** @enum {string} */
715
711
  interval?: "day" | "month" | "year";
716
712
  interval_count?: number;
713
+ /** @description With `interval` and `interval_count`, chooses among prices of that term that differ in termination policy. */
714
+ termination_policy?: components["schemas"]["TerminationPolicy"];
717
715
  /**
718
716
  * @description How many consecutive periods to renew for.
719
717
  * @default 1
@@ -721,21 +719,49 @@ export interface components {
721
719
  periods?: number;
722
720
  };
723
721
  /**
724
- * @description Specify lines for new purchases and renewals for existing subscriptions, or one cancellation on
725
- * its own. The total includes all requested lines and renewals.
722
+ * @description Quote exactly one target: purchase `lines`, an existing `order_id`, `renewals` or a `cancellation`. Giving none or
723
+ * more than one, or a `promotion_code` with `renewals` or a `cancellation`, fails with HTTP 400
724
+ * `BILLING_PURCHASE_INVALID` and `meta.field` naming the offending field. Without a code, an
725
+ * applicable account discount is selected. An explicit code is evaluated without reserving or
726
+ * consuming a redemption and must be supplied again when confirming checkout through Billing.
726
727
  */
727
728
  QuoteRequest: {
729
+ /**
730
+ * @description A proposed purchase, priced with the project's current billing account. Future usage
731
+ * estimates cannot be combined with a promotion code or used as a checkout amount.
732
+ */
728
733
  lines?: components["schemas"]["QuoteLine"][];
734
+ /**
735
+ * Format: uuid
736
+ * @description Preview checkout of this existing order. Its recorded purchase terms supply every line, and a
737
+ * confirmed order returns its recorded amounts. A preview does not change the order.
738
+ */
739
+ order_id?: string;
740
+ /**
741
+ * @description Preview renewing these subscriptions, each at most once. Each entry represents a separate
742
+ * renewal order. To preview a new promotion code, create a renewal order and quote it by order_id.
743
+ */
729
744
  renewals?: components["schemas"]["QuoteRenewal"][];
730
745
  cancellation?: components["schemas"]["QuoteCancellation"];
746
+ promotion_code?: string;
731
747
  };
732
- QuoteLineResult: {
733
- /** @description Tax included in the account quote. Absent in public catalogue estimates. */
748
+ /**
749
+ * @description A purchase quote line or one recorded order item. Monetary fields use the account currency.
750
+ * Fixed purchase amounts are rounded as checkout rounds them. Usage estimates are not amounts
751
+ * collectible at checkout. When priced is false, monetary fields and price_id are absent.
752
+ */
753
+ QuotedLine: {
754
+ /** @description Tax on the discounted amount, including any tax already contained in that amount. */
734
755
  tax_amount?: components["schemas"]["Money"];
735
- /** @description Tax already included in the displayed price. */
756
+ /** @description The part of tax_amount already contained in amount minus discount_amount. */
736
757
  tax_included_amount?: components["schemas"]["Money"];
737
- /** @description Which line of the request this answers. */
758
+ /** @description Zero-based request line index, or the recorded order item's position for an order quote. */
738
759
  index: number;
760
+ /**
761
+ * Format: uuid
762
+ * @description Present for an existing order quote; identifies the recorded item being priced.
763
+ */
764
+ order_item_id?: string;
739
765
  /**
740
766
  * @description Whether a price was found for this line. Read this before anything else.
741
767
  *
@@ -749,14 +775,9 @@ export interface components {
749
775
  priced: boolean;
750
776
  /**
751
777
  * @description Why no price was found; `none` while `priced` is true.
752
- *
753
- * The last four are told apart because their remedies differ: the price points
754
- * at no price list, the list holds no rate for that meter, that exact combination
755
- * of attributes is not configured, or it is configured but nothing is in effect
756
- * at the moment asked about.
757
778
  * @enum {string}
758
779
  */
759
- unpriced_reason?: "none" | "no_price" | "no_rate_card" | "no_meter" | "no_dimensions" | "no_effective_rule";
780
+ unpriced_reason?: "none" | "no_price";
760
781
  /**
761
782
  * Format: uuid
762
783
  * @description The price selected. Returned whenever `priced` is true, including when the
@@ -764,14 +785,19 @@ export interface components {
764
785
  */
765
786
  price_id?: string;
766
787
  plan_name?: string;
788
+ /** @description Unit price before discounts, with tax included only where the price includes it. */
767
789
  unit_amount?: components["schemas"]["Money"];
790
+ /** @description The quantity priced. */
791
+ quantity?: string;
768
792
  /**
769
- * @description The quantity actually priced. When `duration_seconds` is given, it is the requested
770
- * `quantity` multiplied by that duration.
793
+ * @description Before discounts, including any setup charges. Contains tax only where the price includes it.
794
+ * Zero for a priced order item with no immediate charge.
771
795
  */
772
- quantity?: string;
773
- /** @description Not rounded. Round only for display. */
774
796
  amount?: components["schemas"]["Money"];
797
+ /** @description Total reduction on this line, including any committed recurring discount. */
798
+ discount_amount?: components["schemas"]["Money"];
799
+ /** @description amount minus discount_amount plus tax_amount minus tax_included_amount. */
800
+ total?: components["schemas"]["Money"];
775
801
  currency: string;
776
802
  };
777
803
  /**
@@ -811,23 +837,55 @@ export interface components {
811
837
  */
812
838
  total: components["schemas"]["Money"];
813
839
  };
840
+ /**
841
+ * @description A computed price preview, without a saved quote or a price guarantee. No funds or discount
842
+ * redemptions are reserved. Amounts use currency and exclude payment from credit grants or balance.
843
+ */
814
844
  Quote: {
815
- lines?: components["schemas"]["QuoteLineResult"][];
845
+ /**
846
+ * @description Sum before discounts, less tax already included in the discounted line amounts, as on an
847
+ * invoice. Null when any line cannot be priced. Zero for a cancellation-only quote.
848
+ */
849
+ subtotal: components["schemas"]["Money"] | null;
850
+ /** @description Total line discounts. Null when any line cannot be priced; zero for a cancellation-only quote. */
851
+ discount_amount: components["schemas"]["Money"] | null;
852
+ /** @description Total tax on the discounted amounts. Null when any line cannot be priced; zero for a cancellation-only quote. */
853
+ tax_amount: components["schemas"]["Money"] | null;
854
+ /**
855
+ * @description The one new discount evaluated for a purchase or order, without applying it. Null when
856
+ * none is selected, pricing is incomplete, or the quote targets a renewal list or cancellation.
857
+ * A confirmed order instead reports its recorded discount.
858
+ */
859
+ discount: components["schemas"]["QuotedDiscount"] | null;
860
+ lines?: components["schemas"]["QuotedLine"][];
816
861
  renewals?: components["schemas"]["QuoteRenewalResult"][];
817
862
  /** @description What the cancellation requested would return. Present only when one was requested. */
818
863
  cancellation?: components["schemas"]["CancellationRefundPreview"];
819
864
  /**
820
- * @description What would be owed in total, renewals included. Amounts to be returned are not netted
821
- * off it: a quote of a cancellation alone has a total of zero, and what it would return is
822
- * in `cancellation`.
865
+ * @description subtotal minus discount_amount plus tax_amount, before applying credit grants or balance.
866
+ * For a purchase or order with no usage estimates, pass this as expected_amount at checkout.
867
+ * A renewal list sums separate orders; use each renewal's total when confirming that order.
868
+ * Refunds are not netted off: a cancellation-only quote has zero totals and its refund is in
869
+ * cancellation. Usage estimates are projections, not checkout amounts.
823
870
  *
824
871
  * Null when any line could not be priced. What would be owed is not knowable then, and a
825
872
  * total that silently left the unpriced lines out would read as a smaller bill rather than
826
873
  * an incomplete one — the per-line `priced` flag is easy to skip, a missing total is not.
827
874
  */
828
- total?: components["schemas"]["Money"] | null;
875
+ total: components["schemas"]["Money"] | null;
829
876
  currency: string;
830
877
  };
878
+ /**
879
+ * @description The discount selected for this calculation. Its presence in a quote does not apply it or
880
+ * reserve a redemption. Discount amounts are reported on the quote and its lines.
881
+ */
882
+ QuotedDiscount: {
883
+ /** @enum {string} */
884
+ type: "promotion_code" | "account_discount";
885
+ name: string;
886
+ /** @description Code text for a promotion_code discount; null for an account_discount. */
887
+ promotion_code: string | null;
888
+ };
831
889
  /**
832
890
  * @description A narrow view of the project's billing account, restricted to what a project member needs in order
833
891
  * to know whether the project's resources will keep running.
@@ -870,7 +928,11 @@ export interface components {
870
928
  currency: string;
871
929
  };
872
930
  /**
873
- * @description `refunded` means the invoice was paid and has since been refunded in full; a partial refund
931
+ * @description An order invoice stays `draft` until checkout confirms its discount and final amounts. It
932
+ * cannot be collected while draft. Confirmation makes it `open`, or `paid` when its total is zero
933
+ * without creating a payment transaction. A quote never changes this status.
934
+ *
935
+ * `refunded` means the invoice was paid and has since been refunded in full; a partial refund
874
936
  * leaves it `paid`, with the refunded part in `amount_refunded`.
875
937
  *
876
938
  * `void` means the invoice will not be paid and holds no money: nothing was paid, or its order
@@ -946,7 +1008,30 @@ export interface components {
946
1008
  items: components["schemas"]["Subscription"][];
947
1009
  pagination: components["schemas"]["OffsetPagination"];
948
1010
  };
949
- /** @description An independently billed purchase. Fixed renewals use the agreed recurring_amount and interval; already paid periods retain their original value. Technical state belongs to the owning service. */
1011
+ /**
1012
+ * @description An independently billed purchase relationship, separate from the owning service's resource.
1013
+ * Placing a new prepaid or postpaid service order creates a pending subscription for each line
1014
+ * in the same purchase transaction. Its ID is returned on the order item and remains stable
1015
+ * through checkout and delivery. One order may create several subscriptions, such as an instance,
1016
+ * its system disk and its address; it has no single subscription ID.
1017
+ *
1018
+ * Pending and provisioning do not grant service or accrue usage. A service-owned subscription
1019
+ * becomes provisioning when the owning service accepts the order, and active when the service
1020
+ * confirms delivery, with started_at set to the confirmed effective time; payment changes neither. Prepaid service periods start
1021
+ * then; postpaid usage starts only when the service reports actual delivery and metering.
1022
+ *
1023
+ * One-time delivery may omit a subscription. Renewals reference and extend existing subscriptions
1024
+ * rather than creating another; a change keeps the subscription ID and switches its terms when it
1025
+ * takes effect. Canceling or failing an
1026
+ * unfulfilled purchase closes its pending or provisioning subscriptions without starting a service period.
1027
+ * Fixed renewals use the agreed recurring_amount and interval; already paid periods retain their
1028
+ * original value. Technical state belongs to the owning service.
1029
+ *
1030
+ * A purchased shared capacity limit, such as a regional snapshot count quota, can have its own
1031
+ * subscription. Activating that capacity confirms delivery of the quota, not individual snapshots.
1032
+ * Creating or deleting snapshots within it does not create, activate or terminate more subscriptions;
1033
+ * the owning service enforces current holdings against the purchased count.
1034
+ */
950
1035
  Subscription: {
951
1036
  currency: string;
952
1037
  /** @enum {string} */
@@ -954,13 +1039,20 @@ export interface components {
954
1039
  /** @enum {string} */
955
1040
  interval: "none" | "day" | "month" | "year";
956
1041
  interval_count?: number;
957
- /** @description Whole-subscription prepaid renewal amount, after continuing discounts and before tax. Absent for other billing types. */
1042
+ /**
1043
+ * @description Whole-subscription prepaid renewal amount, after continuing discounts and before tax.
1044
+ * Pending subscriptions show base terms until checkout confirms any new continuing discount.
1045
+ * Absent for other billing types.
1046
+ */
958
1047
  recurring_amount?: string;
959
1048
  termination_policy?: components["schemas"]["TerminationPolicy"];
960
1049
  refund_policy?: components["schemas"]["RefundPolicy"];
961
1050
  /** Format: uuid */
962
1051
  order_item_id?: string;
963
- /** Format: uuid */
1052
+ /**
1053
+ * Format: uuid
1054
+ * @description Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID.
1055
+ */
964
1056
  replaces_subscription_id?: string;
965
1057
  /** Format: uuid */
966
1058
  coupon_id?: string;
@@ -1008,13 +1100,22 @@ export interface components {
1008
1100
  quantity: string;
1009
1101
  /**
1010
1102
  * Format: date-time
1011
- * @description Present for prepaid items. Absent for metered ones, which have no end date.
1103
+ * @description End of the prepaid service already activated. Null until a new subscription becomes active,
1104
+ * even when its purchase has been paid, and for postpaid subscriptions with no prepaid end date.
1012
1105
  */
1013
1106
  paid_until?: string | null;
1014
1107
  auto_renew: boolean;
1015
- /** @enum {string} */
1016
- status: "pending" | "active" | "suspended" | "canceled" | "terminated";
1017
- /** Format: date-time */
1108
+ /**
1109
+ * @description pending means the purchase relationship exists but its order has not been accepted.
1110
+ * provisioning means the service accepted the order and is delivering. For a service-owned
1111
+ * purchase, only confirmed delivery moves it to active; paying alone does not.
1112
+ * @enum {string}
1113
+ */
1114
+ status: "pending" | "provisioning" | "active" | "suspended" | "canceled" | "terminated";
1115
+ /**
1116
+ * Format: date-time
1117
+ * @description Confirmed start of service. Null until a new subscription becomes active, including after payment.
1118
+ */
1018
1119
  started_at?: string | null;
1019
1120
  /** Format: date-time */
1020
1121
  ended_at?: string | null;
@@ -1063,7 +1164,12 @@ export interface components {
1063
1164
  pagination: components["schemas"]["OffsetPagination"];
1064
1165
  };
1065
1166
  /**
1066
- * @description Follows the items. `pending` is not yet accepted and may be paid or unpaid. `active` is
1167
+ * @description pending_checkout has recorded purchase terms but no confirmed checkout; only a deferred order
1168
+ * with an amount due reaches it, since a zero-total order completes checkout at placement.
1169
+ * Confirmation moves it to pending. Both pending_checkout
1170
+ * and pending can expire or be canceled; neither establishes service delivery.
1171
+ *
1172
+ * Follows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `active` is
1067
1173
  * accepted with items still being set up. `completed` means every item was set up.
1068
1174
  * `partially_completed` means some items were set up and the others failed and were
1069
1175
  * refunded to their original payment sources. `failed` means every item failed and the
@@ -1071,7 +1177,7 @@ export interface components {
1071
1177
  * nothing was charged.
1072
1178
  * @enum {string}
1073
1179
  */
1074
- OrderStatus: "pending" | "active" | "completed" | "partially_completed" | "failed" | "canceled";
1180
+ OrderStatus: "pending_checkout" | "pending" | "active" | "completed" | "partially_completed" | "failed" | "canceled";
1075
1181
  /**
1076
1182
  * @description `pending` is waiting to be set up. `completed` was confirmed by the service.
1077
1183
  * `failed` was not set up and its amount was refunded to the original payment sources.
@@ -1080,13 +1186,19 @@ export interface components {
1080
1186
  * @enum {string}
1081
1187
  */
1082
1188
  OrderItemStatus: "pending" | "completed" | "failed" | "canceled";
1189
+ /**
1190
+ * @description A recorded purchase. pending_checkout requires explicit Billing confirmation before collection
1191
+ * or acceptance, even without an invoice. Coupon fields describe a discount confirmed at checkout and are absent
1192
+ * before confirmation; a quote never populates them. A draft invoice contains base purchase
1193
+ * amounts awaiting checkout. Payment and acceptance remain separate from resource delivery.
1194
+ */
1083
1195
  Order: {
1084
1196
  /** Format: uuid */
1085
1197
  coupon_id?: string;
1086
1198
  coupon?: components["schemas"]["ObjectIdentity"];
1087
1199
  /** Format: uuid */
1088
1200
  promotion_code_id?: string;
1089
- /** @description Code text frozen when this order applied the coupon. */
1201
+ /** @description Code text frozen when checkout applied the coupon. Absent for an account discount. */
1090
1202
  promotion_code?: string;
1091
1203
  invoice?: components["schemas"]["InvoiceSummary"];
1092
1204
  /** @description How the order was paid. Absent until it is paid. */
@@ -1137,7 +1249,7 @@ export interface components {
1137
1249
  change_effective?: "none" | "immediate" | "period_end";
1138
1250
  /**
1139
1251
  * Format: date-time
1140
- * @description Acceptance deadline. Only pending orders expire automatically.
1252
+ * @description Acceptance deadline. pending_checkout and pending orders can expire automatically.
1141
1253
  */
1142
1254
  expires_at?: string | null;
1143
1255
  /** Format: date-time */
@@ -1172,19 +1284,39 @@ export interface components {
1172
1284
  brand?: string;
1173
1285
  last4?: string;
1174
1286
  };
1175
- /** @description Frozen purchase terms. Monetary fields come from related invoice-line snapshots and are absent when there is no immediate invoice. Later catalog changes do not reprice this line. */
1287
+ /**
1288
+ * @description Frozen purchase terms. Monetary fields come from related invoice-line snapshots and are absent
1289
+ * when there is no immediate invoice. Later catalog changes do not reprice this line. A new service
1290
+ * purchase creates its pending subscription when this item is recorded, not when payment succeeds.
1291
+ */
1176
1292
  OrderItem: {
1177
1293
  position?: number;
1178
1294
  configuration?: {
1179
1295
  [key: string]: unknown;
1180
1296
  };
1181
- /** Format: uuid */
1297
+ /**
1298
+ * Format: uuid
1299
+ * @description Stable Billing subscription ID. A new prepaid or postpaid service purchase returns the
1300
+ * pending subscription here; renewals and changes reference the existing subscription, which
1301
+ * keeps its ID. Absent for delivery without a subscription. This is not a business resource ID.
1302
+ */
1182
1303
  subscription_id?: string;
1183
1304
  /** @enum {string} */
1184
1305
  interval: "none" | "day" | "month" | "year";
1185
1306
  interval_count?: number;
1186
1307
  termination_policy?: components["schemas"]["TerminationPolicy"];
1187
1308
  refund_policy?: components["schemas"]["RefundPolicy"];
1309
+ /**
1310
+ * @description Prepaid items only: the plan's one-month prepaid price for this item's quantity before tax, frozen
1311
+ * at purchase, used to value time used under a prorated refund or a downgrade. Null when the plan has
1312
+ * no prepaid period shorter than the one bought.
1313
+ */
1314
+ refund_monthly_amount?: string | null;
1315
+ /**
1316
+ * @description Prepaid items only: the plan's postpaid hourly price for this item's quantity before tax, frozen at
1317
+ * purchase, used for time used short of a full month. Null when the plan has no postpaid price.
1318
+ */
1319
+ refund_hourly_amount?: string | null;
1188
1320
  completes_on_payment: boolean;
1189
1321
  recurring_amount?: string;
1190
1322
  setup_amount?: string;
@@ -1219,14 +1351,16 @@ export interface components {
1219
1351
  quantity: string;
1220
1352
  /**
1221
1353
  * @description The unit amount of the price this line is charged under. Absent for a tiered price, which has no
1222
- * single unit amount, and for a change that takes effect at once, which is charged the prorated
1223
- * difference.
1354
+ * single unit amount, and for a change that takes effect at once, which is charged as `gross_amount`
1355
+ * describes.
1224
1356
  */
1225
1357
  unit_amount?: components["schemas"]["Money"];
1226
1358
  /**
1227
1359
  * @description Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`
1228
- * times `quantity`; a minimum charge can make it higher. For a change that takes effect at once it is
1229
- * the prorated difference. The setup fee is not part of it; see `setup_amount`.
1360
+ * times `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is
1361
+ * the new price minus the old price for the time left in the paid period, both at the subscription's
1362
+ * own period price, and the period end does not move; a downgrade charges nothing and may refund the
1363
+ * difference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.
1230
1364
  *
1231
1365
  * Under an inclusive tax rate it includes tax, as the price does, and the included part is
1232
1366
  * `tax_included_amount`. A renewal at the agreed terms is the exception: the agreed amount excludes
@@ -1316,7 +1450,11 @@ export interface components {
1316
1450
  items: components["schemas"]["Entitlement"][];
1317
1451
  pagination: components["schemas"]["OffsetPagination"];
1318
1452
  };
1319
- /** @description Purchase-related invoice amounts, without account contact details or payment methods. Absent on an order with no immediate invoice. */
1453
+ /**
1454
+ * @description Purchase-related invoice amounts, without account contact details or payment methods. A draft
1455
+ * order invoice shows base amounts awaiting checkout, not a confirmed discount or collectible total.
1456
+ * Absent when no invoice has been created; absence does not establish acceptance or delivery.
1457
+ */
1320
1458
  InvoiceSummary: {
1321
1459
  /** Format: uuid */
1322
1460
  id: string;
@@ -1334,6 +1472,8 @@ export interface components {
1334
1472
  tax_amount: string;
1335
1473
  total: string;
1336
1474
  amount_paid: string;
1475
+ /** @description What is still collectible after applied credits and successful payments; never below zero. */
1476
+ amount_due: string;
1337
1477
  amount_refunded: string;
1338
1478
  /** Format: date-time */
1339
1479
  due_at?: string;