orb-billing 5.38.0 → 5.40.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +1 -1
  3. package/README.md +4 -1
  4. package/index.d.mts +7 -4
  5. package/index.d.ts +7 -4
  6. package/index.d.ts.map +1 -1
  7. package/index.js +5 -0
  8. package/index.js.map +1 -1
  9. package/index.mjs +7 -2
  10. package/index.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/credit-blocks.d.ts +59 -0
  13. package/resources/credit-blocks.d.ts.map +1 -0
  14. package/resources/credit-blocks.js +38 -0
  15. package/resources/credit-blocks.js.map +1 -0
  16. package/resources/credit-blocks.mjs +34 -0
  17. package/resources/credit-blocks.mjs.map +1 -0
  18. package/resources/index.d.ts +3 -2
  19. package/resources/index.d.ts.map +1 -1
  20. package/resources/index.js +5 -1
  21. package/resources/index.js.map +1 -1
  22. package/resources/index.mjs +3 -2
  23. package/resources/index.mjs.map +1 -1
  24. package/resources/invoices.d.ts +439 -2
  25. package/resources/invoices.d.ts.map +1 -1
  26. package/resources/invoices.js +28 -1
  27. package/resources/invoices.js.map +1 -1
  28. package/resources/invoices.mjs +26 -0
  29. package/resources/invoices.mjs.map +1 -1
  30. package/resources/plans/index.d.ts +1 -0
  31. package/resources/plans/index.d.ts.map +1 -1
  32. package/resources/plans/index.js +4 -1
  33. package/resources/plans/index.js.map +1 -1
  34. package/resources/plans/index.mjs +1 -0
  35. package/resources/plans/index.mjs.map +1 -1
  36. package/resources/plans/migrations.d.ts +47 -0
  37. package/resources/plans/migrations.d.ts.map +1 -0
  38. package/resources/plans/migrations.js +36 -0
  39. package/resources/plans/migrations.js.map +1 -0
  40. package/resources/plans/migrations.mjs +31 -0
  41. package/resources/plans/migrations.mjs.map +1 -0
  42. package/resources/plans/plans.d.ts +4 -0
  43. package/resources/plans/plans.d.ts.map +1 -1
  44. package/resources/plans/plans.js +5 -0
  45. package/resources/plans/plans.js.map +1 -1
  46. package/resources/plans/plans.mjs +5 -0
  47. package/resources/plans/plans.mjs.map +1 -1
  48. package/resources/prices/prices.d.ts +1 -91
  49. package/resources/prices/prices.d.ts.map +1 -1
  50. package/resources/prices/prices.js.map +1 -1
  51. package/resources/prices/prices.mjs.map +1 -1
  52. package/resources/shared.d.ts +3 -273
  53. package/resources/shared.d.ts.map +1 -1
  54. package/resources/shared.js.map +1 -1
  55. package/resources/shared.mjs.map +1 -1
  56. package/resources/subscription-changes.d.ts +33 -1
  57. package/resources/subscription-changes.d.ts.map +1 -1
  58. package/resources/subscription-changes.js +15 -1
  59. package/resources/subscription-changes.js.map +1 -1
  60. package/resources/subscription-changes.mjs +13 -0
  61. package/resources/subscription-changes.mjs.map +1 -1
  62. package/resources/subscriptions.d.ts +1 -91
  63. package/resources/subscriptions.d.ts.map +1 -1
  64. package/resources/subscriptions.js.map +1 -1
  65. package/resources/subscriptions.mjs.map +1 -1
  66. package/src/index.ts +19 -0
  67. package/src/resources/credit-blocks.ts +81 -0
  68. package/src/resources/index.ts +7 -0
  69. package/src/resources/invoices.ts +557 -1
  70. package/src/resources/plans/index.ts +8 -0
  71. package/src/resources/plans/migrations.ts +105 -0
  72. package/src/resources/plans/plans.ts +21 -0
  73. package/src/resources/prices/prices.ts +1 -91
  74. package/src/resources/shared.ts +3 -273
  75. package/src/resources/subscription-changes.ts +64 -0
  76. package/src/resources/subscriptions.ts +1 -91
  77. package/src/version.ts +1 -1
  78. package/version.d.ts +1 -1
  79. package/version.js +1 -1
  80. package/version.mjs +1 -1
@@ -0,0 +1,81 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import * as Core from '../core';
5
+
6
+ export class CreditBlocks extends APIResource {
7
+ /**
8
+ * This endpoint returns a credit block identified by its block_id.
9
+ */
10
+ retrieve(blockId: string, options?: Core.RequestOptions): Core.APIPromise<CreditBlockRetrieveResponse> {
11
+ return this._client.get(`/credit_blocks/${blockId}`, options);
12
+ }
13
+
14
+ /**
15
+ * This endpoint deletes a credit block by its ID.
16
+ *
17
+ * When a credit block is deleted:
18
+ *
19
+ * - The block is removed from the customer's credit ledger.
20
+ * - Any usage of the credit block is reversed, and the ledger is replayed as if
21
+ * the block never existed.
22
+ * - If invoices were generated from the purchase of the credit block, they will be
23
+ * deleted if in draft status, voided if issued, or a credit note will be issued
24
+ * if the invoice is paid.
25
+ *
26
+ * <Note>
27
+ * Issued invoices that had credits applied from this block will not be regenerated, but the ledger will
28
+ * reflect the state as if credits from the deleted block were never applied.
29
+ * </Note>
30
+ */
31
+ delete(blockId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
32
+ return this._client.delete(`/credit_blocks/${blockId}`, {
33
+ ...options,
34
+ headers: { Accept: '*/*', ...options?.headers },
35
+ });
36
+ }
37
+ }
38
+
39
+ /**
40
+ * The Credit Block resource models prepaid credits within Orb.
41
+ */
42
+ export interface CreditBlockRetrieveResponse {
43
+ id: string;
44
+
45
+ balance: number;
46
+
47
+ effective_date: string | null;
48
+
49
+ expiry_date: string | null;
50
+
51
+ filters: Array<CreditBlockRetrieveResponse.Filter>;
52
+
53
+ maximum_initial_balance: number | null;
54
+
55
+ per_unit_cost_basis: string | null;
56
+
57
+ status: 'active' | 'pending_payment';
58
+ }
59
+
60
+ export namespace CreditBlockRetrieveResponse {
61
+ export interface Filter {
62
+ /**
63
+ * The property of the price to filter on.
64
+ */
65
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
66
+
67
+ /**
68
+ * Should prices that match the filter be included or excluded.
69
+ */
70
+ operator: 'includes' | 'excludes';
71
+
72
+ /**
73
+ * The IDs or values that match this filter.
74
+ */
75
+ values: Array<string>;
76
+ }
77
+ }
78
+
79
+ export declare namespace CreditBlocks {
80
+ export { type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse };
81
+ }
@@ -36,6 +36,7 @@ export {
36
36
  type CouponCreateParams,
37
37
  type CouponListParams,
38
38
  } from './coupons/coupons';
39
+ export { CreditBlocks, type CreditBlockRetrieveResponse } from './credit-blocks';
39
40
  export { CreditNotes, type CreditNoteCreateParams, type CreditNoteListParams } from './credit-notes';
40
41
  export {
41
42
  CustomersPage,
@@ -78,13 +79,16 @@ export {
78
79
  type InvoiceLineItemCreateParams,
79
80
  } from './invoice-line-items';
80
81
  export {
82
+ InvoiceListSummaryResponsesPage,
81
83
  Invoices,
82
84
  type InvoiceFetchUpcomingResponse,
85
+ type InvoiceListSummaryResponse,
83
86
  type InvoiceCreateParams,
84
87
  type InvoiceUpdateParams,
85
88
  type InvoiceListParams,
86
89
  type InvoiceFetchUpcomingParams,
87
90
  type InvoiceIssueParams,
91
+ type InvoiceListSummaryParams,
88
92
  type InvoiceMarkPaidParams,
89
93
  } from './invoices';
90
94
  export {
@@ -117,11 +121,14 @@ export {
117
121
  type PriceEvaluatePreviewEventsParams,
118
122
  } from './prices/prices';
119
123
  export {
124
+ SubscriptionChangeListResponsesPage,
120
125
  SubscriptionChanges,
121
126
  type MutatedSubscription,
122
127
  type SubscriptionChangeRetrieveResponse,
128
+ type SubscriptionChangeListResponse,
123
129
  type SubscriptionChangeApplyResponse,
124
130
  type SubscriptionChangeCancelResponse,
131
+ type SubscriptionChangeListParams,
125
132
  type SubscriptionChangeApplyParams,
126
133
  } from './subscription-changes';
127
134
  export {