orb-billing 5.37.2 → 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.
- package/CHANGELOG.md +35 -0
- package/LICENSE +1 -1
- package/README.md +4 -1
- package/index.d.mts +7 -4
- package/index.d.ts +7 -4
- package/index.d.ts.map +1 -1
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/index.mjs +7 -2
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/credit-blocks.d.ts +59 -0
- package/resources/credit-blocks.d.ts.map +1 -0
- package/resources/credit-blocks.js +38 -0
- package/resources/credit-blocks.js.map +1 -0
- package/resources/credit-blocks.mjs +34 -0
- package/resources/credit-blocks.mjs.map +1 -0
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.ts +439 -2
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +28 -1
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +26 -0
- package/resources/invoices.mjs.map +1 -1
- package/resources/plans/index.d.ts +1 -0
- package/resources/plans/index.d.ts.map +1 -1
- package/resources/plans/index.js +4 -1
- package/resources/plans/index.js.map +1 -1
- package/resources/plans/index.mjs +1 -0
- package/resources/plans/index.mjs.map +1 -1
- package/resources/plans/migrations.d.ts +47 -0
- package/resources/plans/migrations.d.ts.map +1 -0
- package/resources/plans/migrations.js +36 -0
- package/resources/plans/migrations.js.map +1 -0
- package/resources/plans/migrations.mjs +31 -0
- package/resources/plans/migrations.mjs.map +1 -0
- package/resources/plans/plans.d.ts +4 -0
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +5 -0
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +5 -0
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/prices.d.ts +1 -91
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +3 -273
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscription-changes.d.ts +96 -1
- package/resources/subscription-changes.d.ts.map +1 -1
- package/resources/subscription-changes.js +15 -1
- package/resources/subscription-changes.js.map +1 -1
- package/resources/subscription-changes.mjs +13 -0
- package/resources/subscription-changes.mjs.map +1 -1
- package/resources/subscriptions.d.ts +1 -91
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/index.ts +19 -0
- package/src/resources/credit-blocks.ts +81 -0
- package/src/resources/index.ts +7 -0
- package/src/resources/invoices.ts +557 -1
- package/src/resources/plans/index.ts +8 -0
- package/src/resources/plans/migrations.ts +105 -0
- package/src/resources/plans/plans.ts +21 -0
- package/src/resources/prices/prices.ts +1 -91
- package/src/resources/shared.ts +3 -273
- package/src/resources/subscription-changes.ts +142 -0
- package/src/resources/subscriptions.ts +1 -91
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- 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
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -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 {
|