chargebee 2.41.0 → 3.0.0-beta.2
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 +11 -15
- package/LICENSE +1 -1
- package/README.md +90 -170
- package/cjs/RequestWrapper.js +84 -0
- package/cjs/asyncApiSupport.js +39 -0
- package/cjs/chargebee.cjs.js +13 -0
- package/cjs/chargebee.cjs.worker.js +9 -0
- package/cjs/chargebeeError.js +17 -0
- package/cjs/coreCommon.js +72 -0
- package/cjs/createChargebee.js +92 -0
- package/cjs/environment.js +18 -0
- package/cjs/filter.js +1 -0
- package/cjs/net/ClientInterface.js +40 -0
- package/cjs/net/FetchClient.js +86 -0
- package/cjs/net/NodeClient.js +61 -0
- package/cjs/package.json +1 -0
- package/cjs/resources/api_endpoints.js +1086 -0
- package/cjs/util.js +218 -0
- package/esm/RequestWrapper.js +80 -0
- package/esm/asyncApiSupport.js +35 -0
- package/esm/chargebee.esm.js +9 -0
- package/esm/chargebee.esm.worker.js +5 -0
- package/esm/chargebeeError.js +13 -0
- package/esm/coreCommon.js +67 -0
- package/esm/createChargebee.js +88 -0
- package/esm/environment.js +15 -0
- package/esm/filter.js +1 -0
- package/esm/net/ClientInterface.js +35 -0
- package/esm/net/FetchClient.js +81 -0
- package/esm/net/NodeClient.js +56 -0
- package/esm/package.json +1 -0
- package/esm/resources/api_endpoints.js +1083 -0
- package/esm/util.js +202 -0
- package/package.json +69 -38
- package/types/core.d.ts +558 -89
- package/types/index.d.ts +90 -55
- package/types/resources/Address.d.ts +57 -272
- package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
- package/types/resources/AttachedItem.d.ts +91 -329
- package/types/resources/Attribute.d.ts +5 -5
- package/types/resources/BusinessEntity.d.ts +49 -69
- package/types/resources/BusinessEntityTransfer.d.ts +11 -17
- package/types/resources/Card.d.ts +146 -424
- package/types/resources/Comment.d.ts +72 -189
- package/types/resources/Contact.d.ts +12 -64
- package/types/resources/ContractTerm.d.ts +15 -96
- package/types/resources/Coupon.d.ts +282 -758
- package/types/resources/CouponCode.d.ts +56 -52
- package/types/resources/CouponSet.d.ts +92 -234
- package/types/resources/CreditNote.d.ts +588 -1758
- package/types/resources/CreditNoteEstimate.d.ts +131 -157
- package/types/resources/Currency.d.ts +75 -62
- package/types/resources/Customer.d.ts +892 -835
- package/types/resources/CustomerEntitlement.d.ts +24 -35
- package/types/resources/DifferentialPrice.d.ts +116 -314
- package/types/resources/Discount.d.ts +20 -125
- package/types/resources/Download.d.ts +6 -22
- package/types/resources/Entitlement.d.ts +51 -160
- package/types/resources/EntitlementOverride.d.ts +58 -139
- package/types/resources/Estimate.d.ts +1178 -527
- package/types/resources/Event.d.ts +67 -178
- package/types/resources/Export.d.ts +563 -723
- package/types/resources/Feature.d.ts +117 -433
- package/types/resources/GatewayErrorDetail.d.ts +16 -72
- package/types/resources/Gift.d.ts +265 -432
- package/types/resources/Hierarchy.d.ts +8 -36
- package/types/resources/HostedPage.d.ts +1017 -1153
- package/types/resources/ImpactedItem.d.ts +13 -50
- package/types/resources/ImpactedItemPrice.d.ts +13 -15
- package/types/resources/ImpactedSubscription.d.ts +13 -45
- package/types/resources/InAppSubscription.d.ts +93 -389
- package/types/resources/Installment.d.ts +35 -110
- package/types/resources/InstallmentConfig.d.ts +54 -155
- package/types/resources/InstallmentDetail.d.ts +19 -27
- package/types/resources/Invoice.d.ts +1574 -3157
- package/types/resources/InvoiceEstimate.d.ts +131 -161
- package/types/resources/Item.d.ts +133 -611
- package/types/resources/ItemEntitlement.d.ts +78 -215
- package/types/resources/ItemFamily.d.ts +69 -178
- package/types/resources/ItemPrice.d.ts +291 -1203
- package/types/resources/Metadata.d.ts +3 -5
- package/types/resources/Order.d.ts +538 -1471
- package/types/resources/PaymentIntent.d.ts +163 -347
- package/types/resources/PaymentReferenceNumber.d.ts +7 -29
- package/types/resources/PaymentSource.d.ts +476 -1272
- package/types/resources/PaymentVoucher.d.ts +87 -306
- package/types/resources/PortalSession.d.ts +71 -207
- package/types/resources/PriceVariant.d.ts +91 -279
- package/types/resources/PricingPageSession.d.ts +92 -41
- package/types/resources/PromotionalCredit.d.ts +90 -346
- package/types/resources/Purchase.d.ts +185 -315
- package/types/resources/Quote.d.ts +1406 -887
- package/types/resources/QuoteLineGroup.d.ts +125 -452
- package/types/resources/QuotedCharge.d.ts +45 -274
- package/types/resources/QuotedSubscription.d.ts +100 -488
- package/types/resources/Ramp.d.ts +230 -747
- package/types/resources/ResourceMigration.d.ts +25 -80
- package/types/resources/SiteMigrationDetail.d.ts +34 -112
- package/types/resources/Subscription.d.ts +2390 -4336
- package/types/resources/SubscriptionEntitlement.d.ts +59 -160
- package/types/resources/SubscriptionEstimate.d.ts +51 -75
- package/types/resources/TaxWithheld.d.ts +15 -40
- package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
- package/types/resources/TimeMachine.d.ts +43 -97
- package/types/resources/Token.d.ts +15 -85
- package/types/resources/Transaction.d.ts +276 -911
- package/types/resources/UnbilledCharge.d.ts +189 -164
- package/types/resources/Usage.d.ts +89 -279
- package/types/resources/VirtualBankAccount.d.ts +103 -255
- package/types/resources/filter.d.ts +52 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
- package/.github/ISSUE_TEMPLATE/config.yml +0 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/lib/chargebee.js +0 -512
- package/lib/resources/api_endpoints.js +0 -2935
- package/types/resources/NonSubscription.d.ts +0 -30
- package/types/resources/Session.d.ts +0 -41
|
@@ -1,303 +1,113 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
3
4
|
declare module 'chargebee' {
|
|
4
5
|
export interface Usage {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
usage_date:number;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @description The id of the [subscription](/docs/api/subscriptions?prod_cat_ver=2) to which this usage record belongs.
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
subscription_id:string;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @description The id of the [item price](/docs/api/item_prices?prod_cat_ver=2) to which this usage belongs. The item price must be a part of the subscription or should have been part of it historically.
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
item_price_id:string;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @description When the usage has been invoiced, this is the `id` of the [invoice](/docs/api/invoices?prod_cat_ver=2). This is cleared when the invoice is `voided` or deleted.
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
invoice_id?:string;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @description When the usage has been invoiced, this is the `id` of the [invoice.line_item](/docs/api/invoices?prod_cat_ver=2#invoice_line_items) that the usage is for. This is cleared when the invoice is [voided](/docs/api/invoices?prod_cat_ver=2#void_an_invoice) or [deleted](/docs/api/invoices?prod_cat_ver=2#delete_an_invoice).
|
|
44
|
-
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
line_item_id?:string;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @description The quantity specified for this usage record.
|
|
51
|
-
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
quantity:string;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @description The source from which the usage record was created. \* admin_console - Operation made through the Chargebee admin UI \* api - Operation made through the API \* bulk_operation - Operation that are triggerd through bulk operation.
|
|
58
|
-
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
source?:Source;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @description A note for this usage record. This appears against the usage on the Chargebee UI. This note is not displayed on any customer-facing document or interface such as [invoice PDFs](/docs/api/invoices?prod_cat_ver=2#retrieve_invoice_as_pdf) or [Hosted Pages](/docs/api/hosted_pages?prod_cat_ver=2).
|
|
65
|
-
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
note?:string;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @description Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
|
|
72
|
-
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
resource_version?:number;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @description Timestamp indicating when this usage resource was last updated.
|
|
79
|
-
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
updated_at?:number;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @description Timestamp indicating when the item was created.
|
|
86
|
-
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
created_at:number;
|
|
6
|
+
id?: string;
|
|
7
|
+
usage_date: number;
|
|
8
|
+
subscription_id: string;
|
|
9
|
+
item_price_id: string;
|
|
10
|
+
invoice_id?: string;
|
|
11
|
+
line_item_id?: string;
|
|
12
|
+
quantity: string;
|
|
13
|
+
source?: Source;
|
|
14
|
+
note?: string;
|
|
15
|
+
resource_version?: number;
|
|
16
|
+
updated_at?: number;
|
|
17
|
+
created_at: number;
|
|
90
18
|
}
|
|
91
|
-
export namespace Usage {
|
|
92
|
-
export class UsageResource {
|
|
93
|
-
/**
|
|
94
|
-
* @description Creates a usage record for an item price in a subscription. The item price must belong to a [metered](/docs/api/items?prod_cat_ver=2#item_metered) item.
|
|
95
|
-
**Max Usages**
|
|
96
|
-
The maximum number of usages that can be recorded for the entire lifetime of a subscription is 5000. [Contact Support](https://chargebee.freshdesk.com/support/home) if you want this limit to be increased for your site.
|
|
97
|
-
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
create(subscription_id:string, input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* @description Retrieves a usage record of a specific subscription.
|
|
104
|
-
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
retrieve(subscription_id:string, input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* @description Deletes a usage record. This operation cannot be invoked for a usage record that has been [invoiced](usages?prod_cat_ver=2#invoicing_usages).
|
|
111
19
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
20
|
+
export namespace Usage {
|
|
21
|
+
export class UsageResource {
|
|
22
|
+
create(
|
|
23
|
+
subscription_id: string,
|
|
24
|
+
input: CreateInputParam,
|
|
25
|
+
headers?: ChargebeeRequestHeader,
|
|
26
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
27
|
+
|
|
28
|
+
retrieve(
|
|
29
|
+
subscription_id: string,
|
|
30
|
+
input: RetrieveInputParam,
|
|
31
|
+
headers?: ChargebeeRequestHeader,
|
|
32
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
33
|
+
|
|
34
|
+
delete(
|
|
35
|
+
subscription_id: string,
|
|
36
|
+
input: DeleteInputParam,
|
|
37
|
+
headers?: ChargebeeRequestHeader,
|
|
38
|
+
): Promise<ChargebeeResponse<DeleteResponse>>;
|
|
39
|
+
|
|
40
|
+
list(
|
|
41
|
+
input?: ListInputParam,
|
|
42
|
+
headers?: ChargebeeRequestHeader,
|
|
43
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
44
|
+
|
|
45
|
+
pdf(
|
|
46
|
+
input: PdfInputParam,
|
|
47
|
+
headers?: ChargebeeRequestHeader,
|
|
48
|
+
): Promise<ChargebeeResponse<PdfResponse>>;
|
|
49
|
+
}
|
|
125
50
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
pdf(input:PdfInputParam):ChargebeeRequest<PdfResponse>;
|
|
51
|
+
export interface CreateResponse {
|
|
52
|
+
usage: Usage;
|
|
129
53
|
}
|
|
130
|
-
|
|
131
|
-
|
|
54
|
+
|
|
55
|
+
export interface RetrieveResponse {
|
|
56
|
+
usage: Usage;
|
|
132
57
|
}
|
|
133
|
-
export interface CreateInputParam {
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* @description A unique and immutable id for the usage. If not provided, it is autogenerated.
|
|
137
58
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* @description The id of the [item price](/docs/api/item_prices?prod_cat_ver=2) to which this usage belongs. The item price must be a part of the subscription or should have been part of it historically.
|
|
59
|
+
export interface DeleteResponse {
|
|
60
|
+
usage: Usage;
|
|
61
|
+
}
|
|
144
62
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* @description The quantity specified for this usage record.
|
|
63
|
+
export interface ListResponse {
|
|
64
|
+
list: { usage: Usage }[];
|
|
65
|
+
next_offset?: string;
|
|
66
|
+
}
|
|
151
67
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @description The time at which this usage occurred. Chargebee bills only those usages whose `usage_date` falls within a time when the subscription `status` was `active` or `non_renewing`. However, the remaining usage records are still stored and are [retrievable](/docs/api/usages?prod_cat_ver=2#retrieve_a_usage).
|
|
158
|
-
**Note:** If `usage_date` corresponds to a time already invoiced, then it is stored but never invoiced unless the [invoice is regenerated](/docs/api/subscriptions?prod_cat_ver=2#regenerate_an_invoice).
|
|
68
|
+
export interface PdfResponse {
|
|
69
|
+
download: Download;
|
|
70
|
+
}
|
|
159
71
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
usage_date:number;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @description A note for this usage record. This appears against the usage on the Chargebee UI. This note is not displayed on any customer-facing document or interface such as [invoice PDFs](/docs/api/invoices?prod_cat_ver=2#retrieve_invoice_as_pdf) or [Hosted Pages](/docs/api/hosted_pages?prod_cat_ver=2).
|
|
72
|
+
// REQUEST PARAMS
|
|
73
|
+
//---------------
|
|
166
74
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
75
|
+
export interface CreateInputParam {
|
|
76
|
+
id?: string;
|
|
77
|
+
item_price_id: string;
|
|
78
|
+
quantity: string;
|
|
79
|
+
usage_date: number /**
|
|
80
|
+
* @deprecated Please refer API docs to use other attributes
|
|
81
|
+
*/;
|
|
82
|
+
|
|
83
|
+
dedupe_option?: DedupeOption;
|
|
84
|
+
note?: string;
|
|
173
85
|
}
|
|
174
86
|
export interface RetrieveInputParam {
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* @description Retrieves a usage record of a specific subscription.
|
|
178
|
-
|
|
179
|
-
*/
|
|
180
|
-
|
|
181
|
-
id:string;
|
|
182
|
-
}
|
|
183
|
-
export interface DeleteResponse {
|
|
184
|
-
usage:Usage;
|
|
87
|
+
id: string;
|
|
185
88
|
}
|
|
186
89
|
export interface DeleteInputParam {
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* @description A unique and immutable id for the usage. If not provided, it is autogenerated.
|
|
190
|
-
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
id:string;
|
|
194
|
-
}
|
|
195
|
-
export interface ListResponse {
|
|
196
|
-
/**
|
|
197
|
-
* @description Retrieves the list of usages.
|
|
198
|
-
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
list:{usage:Usage}[];
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* @description Retrieves the list of usages.
|
|
205
|
-
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
next_offset?:string;
|
|
90
|
+
id: string;
|
|
209
91
|
}
|
|
210
92
|
export interface ListInputParam {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
offset?:string;
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* @description Retrieves the list of usages.
|
|
228
|
-
|
|
229
|
-
*/
|
|
230
|
-
|
|
231
|
-
id?:{is?:string,is_not?:string,starts_with?:string};
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @description Retrieves the list of usages.
|
|
235
|
-
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
subscription_id:{is?:string,is_not?:string,starts_with?:string};
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* @description Retrieves the list of usages.
|
|
242
|
-
|
|
243
|
-
*/
|
|
244
|
-
|
|
245
|
-
usage_date?:{after?:string,before?:string,between?:string,on?:string};
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* @description Retrieves the list of usages.
|
|
249
|
-
|
|
250
|
-
*/
|
|
251
|
-
|
|
252
|
-
item_price_id?:{is?:string,is_not?:string,starts_with?:string};
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* @description Retrieves the list of usages.
|
|
256
|
-
|
|
257
|
-
*/
|
|
258
|
-
|
|
259
|
-
invoice_id?:{is?:string,is_not?:string,is_present?:'true' | 'false',starts_with?:string};
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @description Retrieves the list of usages.
|
|
263
|
-
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
|
-
source?:{in?:string,is?:'admin_console' | 'bulk_operation' | 'api',is_not?:'admin_console' | 'bulk_operation' | 'api',not_in?:string};
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @description Retrieves the list of usages.
|
|
270
|
-
|
|
271
|
-
*/
|
|
272
|
-
|
|
273
|
-
sort_by?:{asc?:'usage_date',desc?:'usage_date'};
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @description Indicates the date at which this credit note is last updated.
|
|
277
|
-
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
281
|
-
}
|
|
282
|
-
export interface PdfResponse {
|
|
283
|
-
download:Download;
|
|
93
|
+
limit?: number;
|
|
94
|
+
offset?: string;
|
|
95
|
+
id?: filter.String;
|
|
96
|
+
subscription_id?: filter.String;
|
|
97
|
+
usage_date?: filter.Timestamp;
|
|
98
|
+
updated_at?: filter.Timestamp;
|
|
99
|
+
item_price_id?: filter.String;
|
|
100
|
+
invoice_id?: filter.String;
|
|
101
|
+
source?: filter.Enum;
|
|
102
|
+
'sort_by[asc]'?: string;
|
|
103
|
+
'sort_by[desc]'?: string;
|
|
284
104
|
}
|
|
285
105
|
export interface PdfInputParam {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
disposition_type?:DispositionType;
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* @description Parameters for invoice
|
|
296
|
-
|
|
297
|
-
*/
|
|
298
|
-
|
|
299
|
-
invoice:{id:string};
|
|
106
|
+
disposition_type?: DispositionType;
|
|
107
|
+
invoice?: InvoicePdfInputParam;
|
|
108
|
+
}
|
|
109
|
+
export interface InvoicePdfInputParam {
|
|
110
|
+
id: string;
|
|
300
111
|
}
|
|
301
|
-
|
|
302
112
|
}
|
|
303
|
-
}
|
|
113
|
+
}
|