@leaflow/sdk 0.100.1 → 0.102.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.
@@ -376,7 +376,7 @@ export interface paths {
376
376
  patch?: never;
377
377
  trace?: never;
378
378
  };
379
- "/account/v1/invoices/{invoiceId}/pay": {
379
+ "/account/v1/invoices/{invoiceId}/collect-payment": {
380
380
  parameters: {
381
381
  query?: never;
382
382
  header?: never;
@@ -388,19 +388,23 @@ export interface paths {
388
388
  get?: never;
389
389
  put?: never;
390
390
  /**
391
- * Pay invoice
392
- * @description Applies the account balance first, then charges the remainder to a payment method. Give
393
- * `payment_method_id` to choose one, or omit it to use the default.
391
+ * Collect payment for an invoice
392
+ * @description Applies eligible credit grants and available balance as requested, then collects the remainder
393
+ * through the selected payment gateway and method. With no gateway selection, insufficient
394
+ * account funds fail without starting an online payment. Card and non-card methods use this same
395
+ * operation. Promotion codes are confirmed by checkout, before collecting payment.
394
396
  *
395
- * Returns a checkout address when the gateway requires the cardholder to confirm the
396
- * payment; the invoice is marked paid once the gateway confirms it.
397
+ * Returns a payment action when customer interaction is required. requires_action and processing
398
+ * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved payment
399
+ * attempt is reused, and retries do not apply credit grants or balance twice.
397
400
  *
398
- * Calling this on an invoice that is already paid returns the invoice unchanged. A void invoice
399
- * is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an order that has failed or was
401
+ * Calling this on an invoice that is already paid returns the existing payment result without
402
+ * another charge. A draft order invoice must first be confirmed through checkout. It and a void
403
+ * invoice are refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an order that has failed or was
400
404
  * canceled, with `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`; and that of an order whose
401
405
  * payment deadline has passed, with `BILLING_ORDER_EXPIRED`.
402
406
  */
403
- post: operations["pay-invoice"];
407
+ post: operations["collect-invoice-payment"];
404
408
  delete?: never;
405
409
  options?: never;
406
410
  head?: never;
@@ -453,7 +457,7 @@ export interface paths {
453
457
  * Either every invoice is paid or none is. When the credit grants and balance cannot cover
454
458
  * them all, the request fails with `BILLING_INSUFFICIENT_FUNDS` and nothing is charged.
455
459
  * Invoices that are already paid are not charged again. An invoice with an online payment
456
- * still in progress is refused with `BILLING_PAYMENT_PENDING`, a void invoice with
460
+ * still in progress is refused with `BILLING_PAYMENT_PENDING`, a draft order invoice or void invoice with
457
461
  * `BILLING_INVOICE_NOT_PAYABLE`, an order that has failed or was canceled with
458
462
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
459
463
  * passed with `BILLING_ORDER_EXPIRED`.
@@ -693,23 +697,33 @@ export interface paths {
693
697
  get?: never;
694
698
  put?: never;
695
699
  /**
696
- * Quote renewals or a cancellation
697
- * @description Priced in the currency of the billing account that pays for the subscriptions, and at any rate
698
- * negotiated for that account. Nothing is reserved and nothing is recorded, so this may be called
699
- * as often as required. Prices may change between quoting and renewing, so a quote should be
700
- * refreshed before a final confirmation is shown.
700
+ * Quote order checkout, renewals or a cancellation
701
+ * @description Computes a price preview without creating a resource or saving a quote. Nothing is charged,
702
+ * reserved or applied to an order, and no discount redemption is consumed. The response has no
703
+ * quote ID and does not guarantee a price or reserve a promotion code.
704
+ *
705
+ * With order_id, uses that order's recorded purchase terms and billing account. An optional
706
+ * promotion_code previews one code; without it, Billing selects an applicable account discount.
707
+ * An invalid or inapplicable explicit code is refused rather than silently replaced. Give total
708
+ * as expected_amount when confirming checkout; eligibility and availability are checked again.
709
+ * An order already checked out returns its confirmed amounts, without reapplying its discount;
710
+ * a different code is refused with BILLING_ORDER_CHECKOUT_CONFLICT.
701
711
  *
702
712
  * A renewal is priced exactly as renewing would charge it: at the agreed amount or the price
703
- * named, with the discounts the account holds, and with tax.
713
+ * named, with the discounts the account holds, and with tax. A renewal list does not accept a
714
+ * promotion code because its entries create separate orders. To use a new code on a renewal,
715
+ * first create a renewal order and quote its checkout by order_id. Prices and discount eligibility
716
+ * may change between preview and confirmation.
704
717
  *
705
718
  * A cancellation is quoted as creating it would compute the refund, as of now and under the refund
706
- * terms agreed when each subscription was bought. It is quoted on its own: combined with renewals
719
+ * terms agreed when each subscription was bought. It is quoted on its own: combined with another target
707
720
  * the request is refused with HTTP 400 `BILLING_PURCHASE_INVALID` and `meta.field`
708
721
  * `cancellation`. It is refused with the same errors as creating the cancellation, except that the
709
722
  * amount is not checked. Give the returned `cancellation.proration_date` and
710
723
  * `cancellation.refundable_amount` when creating it.
711
724
  *
712
- * Every subscription must be paid for by the same one of your billing accounts; otherwise the
725
+ * Orders must belong to one of your billing accounts. Every subscription in a renewal or cancellation
726
+ * quote must be paid for by the same one of your billing accounts; otherwise the
713
727
  * request is refused with HTTP 400 `BILLING_PURCHASE_INVALID`. Returns 404 when a subscription does
714
728
  * not exist, and 403 `BILLING_ACCOUNT_FORBIDDEN` when it is paid for by an account you do not own.
715
729
  */
@@ -894,11 +908,13 @@ export interface paths {
894
908
  put?: never;
895
909
  /**
896
910
  * Create renewal order
897
- * @description Places a renewal order and issues its invoice without charging anything; pay the invoice to
898
- * renew. The periods and price are chosen as for renewing. The order can be paid until the
899
- * current paid period ends, and never after the end of the first period it renews; unpaid by
911
+ * @description Places a renewal order with a draft invoice, without applying a new discount or charging anything.
912
+ * Quote and confirm its checkout before collecting payment to renew. Existing subscription
913
+ * discount commitments are retained. The periods and price are chosen as for renewing. The order
914
+ * can be paid until the current paid period ends, and never after the end of the first period it renews; unpaid by
900
915
  * then, it is canceled. While auto-renew is on, the renewal due at the end of the period pays
901
- * this order instead of placing another.
916
+ * this order instead of placing another, confirming checkout with an applicable account discount
917
+ * first if it has not already been confirmed.
902
918
  *
903
919
  * Save `order_id` before submitting and read the order after an unknown outcome; creating it a
904
920
  * second time conflicts.
@@ -993,7 +1009,7 @@ export interface paths {
993
1009
  };
994
1010
  /**
995
1011
  * List orders
996
- * @description Lists acceptance status and associated invoice amounts. Pending may be unpaid or paid; active means accepted, not delivered. Only pending orders expire at expires_at.
1012
+ * @description Lists acceptance status and associated invoice amounts. pending_checkout awaits confirmation; pending has confirmed checkout and may be unpaid or paid. active means accepted, not delivered. pending_checkout and pending orders can expire at expires_at.
997
1013
  */
998
1014
  get: operations["list-orders"];
999
1015
  put?: never;
@@ -1023,6 +1039,55 @@ export interface paths {
1023
1039
  patch?: never;
1024
1040
  trace?: never;
1025
1041
  };
1042
+ "/account/v1/orders/{orderId}/checkout": {
1043
+ parameters: {
1044
+ query?: never;
1045
+ header?: never;
1046
+ path: {
1047
+ orderId: components["parameters"]["OrderId"];
1048
+ };
1049
+ cookie?: never;
1050
+ };
1051
+ get?: never;
1052
+ put?: never;
1053
+ /**
1054
+ * Confirm order checkout
1055
+ * @description Confirms the purchase's final amount and discount. Supply the same promotion_code used for the
1056
+ * preview, or omit it to select an applicable account discount. At most one new coupon is applied
1057
+ * to an order; existing subscription discount commitments are not stacked with a new coupon on
1058
+ * the same line. Promotion codes are evaluated against the order, not client-supplied line amounts.
1059
+ *
1060
+ * Rechecks eligibility and redemption availability. A different total fails with
1061
+ * BILLING_AMOUNT_CHANGED. An invalid or inapplicable code fails rather than collecting full price.
1062
+ * A failed confirmation leaves the invoice draft and reserves no discount redemption.
1063
+ *
1064
+ * A successful confirmation records the discount, including any recurring discount terms,
1065
+ * reserves its redemption, moves pending_checkout to pending and finalizes the invoice when one
1066
+ * is required. The reservation counts toward the code's limits and is consumed when the invoice
1067
+ * is paid, or at confirmation when nothing is due. Use collect-invoice-payment to collect
1068
+ * its outstanding amount from account funds or a payment gateway. No payment attempt or checkout
1069
+ * session is created by this operation. A purchase with nothing to collect can proceed to Billing
1070
+ * admission without a payment transaction. An absent invoice or zero immediate amount still
1071
+ * requires checkout confirmation; checkout alone does not confirm resource delivery.
1072
+ *
1073
+ * Retrying with the same code and expected amount returns the existing order without another
1074
+ * redemption. Omitting the code on a confirmed checkout retains its recorded discount. Changing
1075
+ * that code is refused with BILLING_ORDER_CHECKOUT_CONFLICT. Payment retries reuse the confirmed
1076
+ * terms. Cancellation, expiry or complete fulfillment failure releases the reservation or returns
1077
+ * the consumed redemption; a refund alone does not.
1078
+ *
1079
+ * The order must belong to one of your billing accounts. A canceled, failed or expired order
1080
+ * cannot be checked out. A period-end change cannot be checked out before its renewal invoice is
1081
+ * available. Orders retain their billing account and currency after a project is linked elsewhere;
1082
+ * discounts from another account cannot be used for them.
1083
+ */
1084
+ post: operations["checkout-order"];
1085
+ delete?: never;
1086
+ options?: never;
1087
+ head?: never;
1088
+ patch?: never;
1089
+ trace?: never;
1090
+ };
1026
1091
  "/account/v1/orders/{orderId}/cancel": {
1027
1092
  parameters: {
1028
1093
  query?: never;
@@ -1117,10 +1182,41 @@ export interface components {
1117
1182
  * @enum {string}
1118
1183
  */
1119
1184
  RefundPolicy: "none" | "prorated";
1120
- /** @description Specify renewals for existing subscriptions, or one cancellation on its own. */
1121
- QuoteRequest: {
1122
- renewals?: components["schemas"]["QuoteRenewal"][];
1123
- cancellation?: components["schemas"]["QuoteCancellation"];
1185
+ /** @description Quote exactly one target. An existing order, a renewal list and a cancellation are mutually exclusive. */
1186
+ QuoteRequest: components["schemas"]["OrderQuoteRequest"] | components["schemas"]["RenewalQuoteRequest"] | components["schemas"]["CancellationQuoteRequest"];
1187
+ /**
1188
+ * @description Preview checkout of one existing order. Its recorded purchase terms supply every line.
1189
+ * Without a code, an applicable account discount is selected. A preview neither changes the
1190
+ * order nor reserves or consumes a redemption. A confirmed order returns its recorded amounts.
1191
+ */
1192
+ OrderQuoteRequest: {
1193
+ /** Format: uuid */
1194
+ order_id: string;
1195
+ /** @description Code to evaluate for this order. Must be supplied again when confirming checkout. */
1196
+ promotion_code?: string;
1197
+ };
1198
+ /**
1199
+ * @description Preview renewing subscriptions, each at most once. Each entry represents a separate renewal
1200
+ * order. To preview a new promotion code, create a renewal order and quote it by order_id.
1201
+ */
1202
+ RenewalQuoteRequest: {
1203
+ renewals: components["schemas"]["QuoteRenewal"][];
1204
+ };
1205
+ /** @description Preview one cancellation without combining it with a purchase, renewal or promotion code. */
1206
+ CancellationQuoteRequest: {
1207
+ cancellation: components["schemas"]["QuoteCancellation"];
1208
+ };
1209
+ CheckoutOrderRequest: {
1210
+ /**
1211
+ * @description The code to apply, evaluated again at confirmation. Omit to select an applicable account
1212
+ * discount. On an already confirmed checkout, omission retains the recorded discount.
1213
+ */
1214
+ promotion_code?: string;
1215
+ /**
1216
+ * @description Quote.total in the order's currency, after discounts and tax but before applying credit
1217
+ * grants or balance. A different total fails with BILLING_AMOUNT_CHANGED.
1218
+ */
1219
+ expected_amount: components["schemas"]["Money"];
1124
1220
  };
1125
1221
  /**
1126
1222
  * @description Price renewing a prepaid subscription. Give `price_id`, or `interval` with
@@ -1178,18 +1274,110 @@ export interface components {
1178
1274
  */
1179
1275
  total: components["schemas"]["Money"];
1180
1276
  };
1277
+ /**
1278
+ * @description A purchase quote line or one recorded order item. Monetary fields use the account currency.
1279
+ * Fixed purchase amounts are rounded as checkout rounds them. Usage estimates are not amounts
1280
+ * collectible at checkout. When priced is false, monetary fields and price_id are absent.
1281
+ */
1282
+ QuotedLine: {
1283
+ /** @description Tax on the discounted amount, including any tax already contained in that amount. */
1284
+ tax_amount?: components["schemas"]["Money"];
1285
+ /** @description The part of tax_amount already contained in amount minus discount_amount. */
1286
+ tax_included_amount?: components["schemas"]["Money"];
1287
+ /** @description Zero-based request line index, or the recorded order item's position for an order quote. */
1288
+ index: number;
1289
+ /**
1290
+ * Format: uuid
1291
+ * @description Present for an existing order quote; identifies the recorded item being priced.
1292
+ */
1293
+ order_item_id?: string;
1294
+ /**
1295
+ * @description Whether a price was found for this line. Read this before anything else.
1296
+ *
1297
+ * A single item with no price no longer fails the whole request. A catalogue
1298
+ * almost always has something not yet priced, and refusing the request would
1299
+ * leave no way to render a list in which a few entries are simply not on sale.
1300
+ *
1301
+ * When false, `price_id`, `unit_amount` and `amount` are absent and
1302
+ * `unpriced_reason` states what is missing.
1303
+ */
1304
+ priced: boolean;
1305
+ /**
1306
+ * @description Why no price was found; `none` while `priced` is true.
1307
+ * @enum {string}
1308
+ */
1309
+ unpriced_reason?: "none" | "no_price";
1310
+ /**
1311
+ * Format: uuid
1312
+ * @description The price selected. Returned whenever `priced` is true, including when the
1313
+ * request identified the item indirectly, so that the choice can be confirmed.
1314
+ */
1315
+ price_id?: string;
1316
+ plan_name?: string;
1317
+ /** @description Unit price before discounts, with tax included only where the price includes it. */
1318
+ unit_amount?: components["schemas"]["Money"];
1319
+ /** @description The quantity priced. */
1320
+ quantity?: string;
1321
+ /**
1322
+ * @description Before discounts, including any setup charges. Contains tax only where the price includes it.
1323
+ * Zero for a priced order item with no immediate charge.
1324
+ */
1325
+ amount?: components["schemas"]["Money"];
1326
+ /** @description Total reduction on this line, including any committed recurring discount. */
1327
+ discount_amount?: components["schemas"]["Money"];
1328
+ /** @description amount minus discount_amount plus tax_amount minus tax_included_amount. */
1329
+ total?: components["schemas"]["Money"];
1330
+ currency: string;
1331
+ };
1332
+ /**
1333
+ * @description A computed price preview, without a saved quote or a price guarantee. No funds or discount
1334
+ * redemptions are reserved. Amounts use currency and exclude payment from credit grants or balance.
1335
+ */
1181
1336
  Quote: {
1337
+ /**
1338
+ * @description Sum before discounts, less tax already included in the discounted line amounts, as on an
1339
+ * invoice. Null when any line cannot be priced. Zero for a cancellation-only quote.
1340
+ */
1341
+ subtotal: components["schemas"]["Money"] | null;
1342
+ /** @description Total line discounts. Null when any line cannot be priced; zero for a cancellation-only quote. */
1343
+ discount_amount: components["schemas"]["Money"] | null;
1344
+ /** @description Total tax on the discounted amounts. Null when any line cannot be priced; zero for a cancellation-only quote. */
1345
+ tax_amount: components["schemas"]["Money"] | null;
1346
+ /**
1347
+ * @description The one new discount evaluated for a purchase or order, without applying it. Null when
1348
+ * none is selected, pricing is incomplete, or the quote targets a renewal list or cancellation.
1349
+ * A confirmed order instead reports its recorded discount.
1350
+ */
1351
+ discount: components["schemas"]["QuotedDiscount"] | null;
1352
+ lines?: components["schemas"]["QuotedLine"][];
1182
1353
  renewals?: components["schemas"]["QuoteRenewalResult"][];
1183
1354
  /** @description What the cancellation requested would return. Present only when one was requested. */
1184
1355
  cancellation?: components["schemas"]["CancellationRefundPreview"];
1185
1356
  /**
1186
- * @description What the renewals would charge in total. Amounts to be returned are not netted off it: a
1187
- * quote of a cancellation alone has a total of zero, and what it would return is in
1188
- * `cancellation`.
1357
+ * @description subtotal minus discount_amount plus tax_amount, before applying credit grants or balance.
1358
+ * For a purchase or order with no usage estimates, pass this as expected_amount at checkout.
1359
+ * A renewal list sums separate orders; use each renewal's total when confirming that order.
1360
+ * Refunds are not netted off: a cancellation-only quote has zero totals and its refund is in
1361
+ * cancellation. Usage estimates are projections, not checkout amounts.
1362
+ *
1363
+ * Null when any line could not be priced. What would be owed is not knowable then, and a
1364
+ * total that silently left the unpriced lines out would read as a smaller bill rather than
1365
+ * an incomplete one — the per-line `priced` flag is easy to skip, a missing total is not.
1189
1366
  */
1190
- total: components["schemas"]["Money"];
1367
+ total: components["schemas"]["Money"] | null;
1191
1368
  currency: string;
1192
1369
  };
1370
+ /**
1371
+ * @description The discount selected for this calculation. Its presence in a quote does not apply it or
1372
+ * reserve a redemption. Discount amounts are reported on the quote and its lines.
1373
+ */
1374
+ QuotedDiscount: {
1375
+ /** @enum {string} */
1376
+ type: "promotion_code" | "account_discount";
1377
+ name: string;
1378
+ /** @description Code text for a promotion_code discount; null for an account_discount. */
1379
+ promotion_code: string | null;
1380
+ };
1193
1381
  /**
1194
1382
  * @description A cancellation to quote: what ending these subscriptions together would return. One mode per
1195
1383
  * request; to compare, quote `immediate` and `period_end` separately.
@@ -1418,37 +1606,17 @@ export interface components {
1418
1606
  /**
1419
1607
  * @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.
1420
1608
  *
1421
- * A line that gives a meter, `dimensions` or `duration_seconds` estimates usage and is
1422
- * priced only at a postpaid price. Such a line is refused with HTTP 400
1423
- * `BILLING_PURCHASE_INVALID` when `price_type` is `prepaid` or `one_time`, or when the price
1424
- * it names is not postpaid; `meta.field` is `price_type`, `price_id` or `price_lookup_key`
1425
- * accordingly. When the plan has no postpaid price, the line is returned unpriced with
1426
- * `no_price`.
1609
+ * Charges for future usage are not estimated here; the service that sells the product quotes
1610
+ * them with its purchase.
1427
1611
  */
1428
1612
  QuoteLine: {
1429
1613
  price_lookup_key?: string;
1430
1614
  plan_lookup_key?: string;
1431
- meter_lookup_key?: string;
1432
1615
  /** Format: uuid */
1433
1616
  price_id?: string;
1434
1617
  product_id?: components["schemas"]["ProductID"];
1435
1618
  /** Format: uuid */
1436
1619
  plan_id?: string;
1437
- /** Format: uuid */
1438
- meter_id?: string;
1439
- /**
1440
- * @description The attributes the price depends on — region, instance type, token class.
1441
- *
1442
- * Required when the price draws its rates from a price list, which is how anything
1443
- * sold by region or by machine type is priced. A price that carries a single unit
1444
- * amount, or a ladder, has no attributes to give and takes none.
1445
- *
1446
- * Every attribute the meter declares must be present. A combination with no rate
1447
- * covering it is refused rather than priced at zero.
1448
- */
1449
- dimensions?: {
1450
- [key: string]: string;
1451
- };
1452
1620
  /**
1453
1621
  * @description Narrows the selection when a plan offers more than one billing type.
1454
1622
  * @enum {string}
@@ -1458,13 +1626,6 @@ export interface components {
1458
1626
  interval?: "none" | "day" | "month" | "year";
1459
1627
  interval_count?: number;
1460
1628
  quantity: string;
1461
- /**
1462
- * Format: int64
1463
- * @description For metered items, how long to price for. This allows an estimate such as "about
1464
- * this much per month" to be shown before anything exists. The priced quantity is
1465
- * `quantity` multiplied by this duration.
1466
- */
1467
- duration_seconds?: number;
1468
1629
  };
1469
1630
  BillingAccount: {
1470
1631
  /** Format: int64 */
@@ -1817,7 +1978,7 @@ export interface components {
1817
1978
  * An unresolved channel payment is reused; retries do not apply the grant or balance portions twice.
1818
1979
  * Without a gateway selection, insufficient account funds fail without starting an online payment.
1819
1980
  */
1820
- PayRequest: {
1981
+ CollectInvoicePaymentRequest: {
1821
1982
  /** @description Required to collect an online remainder. An existing attempt keeps its original gateway. */
1822
1983
  payment_gateway?: string;
1823
1984
  /** @description Required with payment_gateway; for example card, wechat_pay or alipay. */
@@ -1954,7 +2115,11 @@ export interface components {
1954
2115
  failure_reason?: string;
1955
2116
  };
1956
2117
  /**
1957
- * @description A usage invoice stays `draft` through its month: each charge is added to it as it is priced
2118
+ * @description An order invoice stays `draft` until checkout confirms its discount and final amounts. It
2119
+ * cannot be collected while draft. Confirmation makes it `open`, or `paid` when its total is zero
2120
+ * without creating a payment transaction. A quote never changes this status.
2121
+ *
2122
+ * A usage invoice stays `draft` through its month: each charge is added to it as it is priced
1958
2123
  * and paid from credits and balance as it goes. It is issued at the end of the month, becoming
1959
2124
  * `paid` when everything was covered and `open` when something is still owed.
1960
2125
  *
@@ -2316,7 +2481,29 @@ export interface components {
2316
2481
  items: components["schemas"]["Subscription"][];
2317
2482
  pagination: components["schemas"]["OffsetPagination"];
2318
2483
  };
2319
- /** @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. */
2484
+ /**
2485
+ * @description An independently billed purchase relationship, separate from the owning service's resource.
2486
+ * Placing a new prepaid or postpaid service order creates a pending subscription for each line
2487
+ * in the same purchase transaction. Its ID is returned on the order item and remains stable
2488
+ * through checkout and delivery. One order may create several subscriptions, such as an instance,
2489
+ * its system disk and its address; it has no single subscription ID.
2490
+ *
2491
+ * Pending does not grant service or accrue usage. Payment confirmation and order acceptance do
2492
+ * not activate a service-owned subscription. It becomes active when the owning service confirms
2493
+ * delivery, with started_at set to the confirmed effective time. Prepaid service periods start
2494
+ * then; postpaid usage starts only when the service reports actual delivery and metering.
2495
+ *
2496
+ * One-time delivery may omit a subscription. Renewals reference and extend existing subscriptions
2497
+ * rather than creating another; changes may create pending replacements. Canceling or failing an
2498
+ * unfulfilled purchase closes its pending subscriptions without starting a service period.
2499
+ * Fixed renewals use the agreed recurring_amount and interval; already paid periods retain their
2500
+ * original value. Technical state belongs to the owning service.
2501
+ *
2502
+ * A purchased shared capacity limit, such as a regional snapshot count quota, can have its own
2503
+ * subscription. Activating that capacity confirms delivery of the quota, not individual snapshots.
2504
+ * Creating or deleting snapshots within it does not create, activate or terminate more subscriptions;
2505
+ * the owning service enforces current holdings against the purchased count.
2506
+ */
2320
2507
  Subscription: {
2321
2508
  currency: string;
2322
2509
  /** @enum {string} */
@@ -2324,7 +2511,11 @@ export interface components {
2324
2511
  /** @enum {string} */
2325
2512
  interval: "none" | "day" | "month" | "year";
2326
2513
  interval_count?: number;
2327
- /** @description Whole-subscription prepaid renewal amount, after continuing discounts and before tax. Absent for other billing types. */
2514
+ /**
2515
+ * @description Whole-subscription prepaid renewal amount, after continuing discounts and before tax.
2516
+ * Pending subscriptions show base terms until checkout confirms any new continuing discount.
2517
+ * Absent for other billing types.
2518
+ */
2328
2519
  recurring_amount?: string;
2329
2520
  termination_policy?: components["schemas"]["TerminationPolicy"];
2330
2521
  refund_policy?: components["schemas"]["RefundPolicy"];
@@ -2378,13 +2569,21 @@ export interface components {
2378
2569
  quantity: string;
2379
2570
  /**
2380
2571
  * Format: date-time
2381
- * @description Present for prepaid items. Absent for metered ones, which have no end date.
2572
+ * @description End of the prepaid service already activated. Null for a new pending subscription, even
2573
+ * when its purchase has been paid, and for postpaid subscriptions with no prepaid end date.
2382
2574
  */
2383
2575
  paid_until?: string | null;
2384
2576
  auto_renew: boolean;
2385
- /** @enum {string} */
2577
+ /**
2578
+ * @description pending means the purchase relationship exists but service has not started. For a
2579
+ * service-owned purchase, only confirmed delivery moves it to active; paying alone does not.
2580
+ * @enum {string}
2581
+ */
2386
2582
  status: "pending" | "active" | "suspended" | "canceled" | "terminated";
2387
- /** Format: date-time */
2583
+ /**
2584
+ * Format: date-time
2585
+ * @description Confirmed start of service. Null for a new pending subscription, including after payment.
2586
+ */
2388
2587
  started_at?: string | null;
2389
2588
  /** Format: date-time */
2390
2589
  ended_at?: string | null;
@@ -2480,7 +2679,11 @@ export interface components {
2480
2679
  auto_renew: boolean;
2481
2680
  };
2482
2681
  /**
2483
- * @description Follows the items. `pending` is not yet accepted and may be paid or unpaid. `active` is
2682
+ * @description pending_checkout has recorded purchase terms but no confirmed checkout. An absent invoice
2683
+ * or zero total does not permit acceptance. Confirmation moves it to pending. Both pending_checkout
2684
+ * and pending can expire or be canceled; neither establishes service delivery.
2685
+ *
2686
+ * Follows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `active` is
2484
2687
  * accepted with items still being set up. `completed` means every item was set up.
2485
2688
  * `partially_completed` means some items were set up and the others failed and were
2486
2689
  * refunded to their original payment sources. `failed` means every item failed and the
@@ -2488,7 +2691,7 @@ export interface components {
2488
2691
  * nothing was charged.
2489
2692
  * @enum {string}
2490
2693
  */
2491
- OrderStatus: "pending" | "active" | "completed" | "partially_completed" | "failed" | "canceled";
2694
+ OrderStatus: "pending_checkout" | "pending" | "active" | "completed" | "partially_completed" | "failed" | "canceled";
2492
2695
  /**
2493
2696
  * @description `pending` is waiting to be set up. `completed` was confirmed by the service.
2494
2697
  * `failed` was not set up and its amount was refunded to the original payment sources.
@@ -2497,13 +2700,19 @@ export interface components {
2497
2700
  * @enum {string}
2498
2701
  */
2499
2702
  OrderItemStatus: "pending" | "completed" | "failed" | "canceled";
2703
+ /**
2704
+ * @description A recorded purchase. pending_checkout requires explicit Billing confirmation before collection
2705
+ * or acceptance, even without an invoice. Coupon fields describe a discount confirmed at checkout and are absent
2706
+ * before confirmation; a quote never populates them. A draft invoice contains base purchase
2707
+ * amounts awaiting checkout. Payment and acceptance remain separate from resource delivery.
2708
+ */
2500
2709
  Order: {
2501
2710
  /** Format: uuid */
2502
2711
  coupon_id?: string;
2503
2712
  coupon?: components["schemas"]["ObjectIdentity"];
2504
2713
  /** Format: uuid */
2505
2714
  promotion_code_id?: string;
2506
- /** @description Code text frozen when this order applied the coupon. */
2715
+ /** @description Code text frozen when checkout applied the coupon. Absent for an account discount. */
2507
2716
  promotion_code?: string;
2508
2717
  invoice?: components["schemas"]["InvoiceSummary"];
2509
2718
  /** @description How the order was paid. Absent until it is paid. */
@@ -2554,7 +2763,7 @@ export interface components {
2554
2763
  change_effective?: "none" | "immediate" | "period_end";
2555
2764
  /**
2556
2765
  * Format: date-time
2557
- * @description Acceptance deadline. Only pending orders expire automatically.
2766
+ * @description Acceptance deadline. pending_checkout and pending orders can expire automatically.
2558
2767
  */
2559
2768
  expires_at?: string | null;
2560
2769
  /** Format: date-time */
@@ -2640,8 +2849,8 @@ export interface components {
2640
2849
  */
2641
2850
  shortfall?: components["schemas"]["Money"];
2642
2851
  /**
2643
- * @description What it would take off this purchase. An estimate: the amount is settled at the
2644
- * moment the order is placed.
2852
+ * @description What it would take off this purchase. An estimate: the discount is confirmed during
2853
+ * order checkout. Use CreateQuote for the purchase's complete total, including tax.
2645
2854
  */
2646
2855
  estimated_discount?: components["schemas"]["Money"];
2647
2856
  };
@@ -2747,13 +2956,22 @@ export interface components {
2747
2956
  /** @description The longest term a purchase may have, in months. */
2748
2957
  max_term_months?: number;
2749
2958
  };
2750
- /** @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. */
2959
+ /**
2960
+ * @description Frozen purchase terms. Monetary fields come from related invoice-line snapshots and are absent
2961
+ * when there is no immediate invoice. Later catalog changes do not reprice this line. A new service
2962
+ * purchase creates its pending subscription when this item is recorded, not when payment succeeds.
2963
+ */
2751
2964
  OrderItem: {
2752
2965
  position?: number;
2753
2966
  configuration?: {
2754
2967
  [key: string]: unknown;
2755
2968
  };
2756
- /** Format: uuid */
2969
+ /**
2970
+ * Format: uuid
2971
+ * @description Stable Billing subscription ID. A new prepaid or postpaid service purchase returns the
2972
+ * pending subscription here; renewals reference the existing subscription and changes the
2973
+ * replacement. Absent for delivery without a subscription. This is not a business resource ID.
2974
+ */
2757
2975
  subscription_id?: string;
2758
2976
  /** @enum {string} */
2759
2977
  interval: "none" | "day" | "month" | "year";
@@ -2891,7 +3109,11 @@ export interface components {
2891
3109
  items: components["schemas"]["Entitlement"][];
2892
3110
  pagination: components["schemas"]["OffsetPagination"];
2893
3111
  };
2894
- /** @description Purchase-related invoice amounts, without account contact details or payment methods. Absent on an order with no immediate invoice. */
3112
+ /**
3113
+ * @description Purchase-related invoice amounts, without account contact details or payment methods. A draft
3114
+ * order invoice shows base amounts awaiting checkout, not a confirmed discount or collectible total.
3115
+ * Absent when no invoice has been created; absence does not establish acceptance or delivery.
3116
+ */
2895
3117
  InvoiceSummary: {
2896
3118
  /** Format: uuid */
2897
3119
  id: string;
@@ -3511,7 +3733,7 @@ export interface operations {
3511
3733
  default: components["responses"]["Error"];
3512
3734
  };
3513
3735
  };
3514
- "pay-invoice": {
3736
+ "collect-invoice-payment": {
3515
3737
  parameters: {
3516
3738
  query?: never;
3517
3739
  header?: never;
@@ -3522,7 +3744,7 @@ export interface operations {
3522
3744
  };
3523
3745
  requestBody?: {
3524
3746
  content: {
3525
- "application/json": components["schemas"]["PayRequest"];
3747
+ "application/json": components["schemas"]["CollectInvoicePaymentRequest"];
3526
3748
  };
3527
3749
  };
3528
3750
  responses: {
@@ -4289,6 +4511,48 @@ export interface operations {
4289
4511
  default: components["responses"]["Error"];
4290
4512
  };
4291
4513
  };
4514
+ "checkout-order": {
4515
+ parameters: {
4516
+ query?: never;
4517
+ header?: never;
4518
+ path: {
4519
+ orderId: components["parameters"]["OrderId"];
4520
+ };
4521
+ cookie?: never;
4522
+ };
4523
+ requestBody: {
4524
+ content: {
4525
+ /**
4526
+ * @example {
4527
+ * "promotion_code": "WELCOME",
4528
+ * "expected_amount": "90.00"
4529
+ * }
4530
+ */
4531
+ "application/json": components["schemas"]["CheckoutOrderRequest"];
4532
+ };
4533
+ };
4534
+ responses: {
4535
+ /** @description The order with confirmed checkout terms and its invoice, when applicable. */
4536
+ 200: {
4537
+ headers: {
4538
+ [name: string]: unknown;
4539
+ };
4540
+ content: {
4541
+ "application/json": components["schemas"]["Order"];
4542
+ };
4543
+ };
4544
+ /** @description The order no longer permits checkout or another discount has already been confirmed. */
4545
+ 409: {
4546
+ headers: {
4547
+ [name: string]: unknown;
4548
+ };
4549
+ content: {
4550
+ "application/json": components["schemas"]["Error"];
4551
+ };
4552
+ };
4553
+ default: components["responses"]["Error"];
4554
+ };
4555
+ };
4292
4556
  "cancel-order": {
4293
4557
  parameters: {
4294
4558
  query?: never;