chargebee 2.40.0 → 3.0.0-beta.1

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 (118) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/LICENSE +1 -1
  3. package/README.md +90 -172
  4. package/cjs/RequestWrapper.js +81 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +77 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +91 -54
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +36 -0
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +233 -724
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4335
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +278 -900
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2912
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,285 +1,56 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface QuotedCharge {
4
-
5
- /**
6
- * @description Provides details of all the ad-hoc charges [added to the quote](/docs/api/quotes?prod_cat_ver&#x3D;2#create_a_quote_for_charge_and_charge_items).
7
-
8
- */
9
-
10
- charges?:QuotedCharge.Charge[];
11
-
12
- /**
13
- * @description Details of individual [item prices](/docs/api/item_prices?prod_cat_ver&#x3D;2) that are part of this subscription
14
-
15
- */
16
-
17
- invoice_items?:QuotedCharge.ItemPrice[];
18
-
19
- /**
20
- * @description The pricing details of &#x60;subscription_items&#x60; which have &#x60;pricing_model&#x60; as &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60;. [Learn more](https://www.chargebee.com/docs/plans.html#pricing-models) about pricing models.
21
-
22
- */
23
-
24
- item_tiers?:QuotedCharge.ItemTier[];
25
-
26
- /**
27
- * @description List of coupons for this charge
28
-
29
- */
30
-
31
- coupons?:QuotedCharge.Coupon[];
32
-
33
- /**
34
- * @description List of discounts for the charges in this quote.
35
-
36
- */
37
-
38
- discounts?:QuotedCharge.Discount[];
6
+ charges?: QuotedCharge.Charge[];
7
+ addons?: QuotedCharge.Addon[];
8
+ invoice_items?: QuotedCharge.InvoiceItem[];
9
+ item_tiers?: QuotedCharge.ItemTier[];
10
+ coupons?: QuotedCharge.Coupon[];
39
11
  }
40
- export namespace QuotedCharge {
41
-
42
-
43
- export interface Charge {
44
- /**
45
- * @description The amount to be charged. The unit depends on the [type of currency](/docs/api?prod_cat_ver&#x3D;1#md_disabled).
46
-
47
- */
48
-
49
- amount?:number;
50
-
51
- /**
52
- * @description The decimal representation of the amount for the one-time charge. The value is in [major units of the currency](/docs/api#md_enabled). Applicable only when multi-decimal pricing is enabled.
53
-
54
- */
55
-
56
- amount_in_decimal?:string;
57
-
58
- /**
59
- * @description Description for this charge
60
-
61
- */
62
-
63
- description?:string;
64
-
65
- /**
66
- * @description Specifies the service period of the charge in days. When the quote is converted, the [invoice.line_item.date_from](/docs/api/invoices#invoice_line_items) is set to current date/time and &#x60;invoice.line_item.date_to&#x60; is set to &#x60;service_period_in_days&#x60; ahead of &#x60;date_from&#x60;.
67
-
68
- */
69
-
70
- service_period_in_days?:number;
71
-
72
- /**
73
- * @description Indicates the type of sale carried out. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. \* wholesale - Transaction is a sale to another company that will resell your product or service to another consumer \* retail - Transaction is a sale to an end user \* consumed - Transaction is for an item that is consumed directly \* vendor_use - Transaction is for an item that is subject to vendor use tax
74
12
 
75
- */
76
-
77
- avalara_sale_type?:'consumed' | 'wholesale' | 'vendor_use' | 'retail';
78
-
79
- /**
80
- * @description Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
81
-
82
- */
83
-
84
- avalara_transaction_type?:number;
85
-
86
- /**
87
- * @description Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
88
-
89
- */
90
-
91
- avalara_service_type?:number;
13
+ export namespace QuotedCharge {
14
+ export interface Charge {
15
+ amount?: number;
16
+ amount_in_decimal?: string;
17
+ description?: string;
18
+ service_period_in_days?: number;
19
+ avalara_sale_type?: 'wholesale' | 'retail' | 'consumed' | 'vendor_use';
20
+ avalara_transaction_type?: number;
21
+ avalara_service_type?: number;
92
22
  }
93
- export interface ItemPrice {
94
- /**
95
- * @description A unique ID for your system to identify the item price.
96
-
97
- */
98
-
99
- item_price_id:string;
100
-
101
- /**
102
- * @description Item price quantity
103
-
104
- */
105
-
106
- quantity?:number;
107
-
108
- /**
109
- * @description The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
110
-
111
- */
112
-
113
- quantity_in_decimal?:string;
114
-
115
- /**
116
- * @description The price or per-unit-price of the item price. By default, it is the [value set](/docs/api/item_prices#item_price_price) for the &#x60;item_price&#x60;. This is only applicable when the &#x60;pricing_model&#x60; of the &#x60;item_price&#x60; is &#x60;flat_fee&#x60; or &#x60;per_unit&#x60;. The value depends on the [type of currency](/docs/api/#handling_currency_units).
117
-
118
- */
119
-
120
- unit_price?:number;
121
-
122
- /**
123
- * @description The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
124
-
125
- */
126
-
127
- unit_price_in_decimal?:string;
128
-
129
- /**
130
- * @description Defines service period of the item in days from the day of charge.
131
-
132
- */
133
-
134
- service_period_days?:number;
23
+ export interface Addon {
24
+ id: string;
25
+ quantity?: number;
26
+ unit_price?: number;
27
+ quantity_in_decimal?: string;
28
+ unit_price_in_decimal?: string;
29
+ proration_type?: 'full_term' | 'partial_term' | 'none';
30
+ service_period?: number;
135
31
  }
136
- export interface ItemTier {
137
- /**
138
- * @description The id of the item price to which this tier belongs.
139
-
140
- */
141
-
142
- item_price_id:string;
143
-
144
- /**
145
- * @description The lowest value in the quantity tier.
146
-
147
- */
148
-
149
- starting_unit:number;
150
-
151
- /**
152
- * @description The highest value in the quantity tier.
153
-
154
- */
155
-
156
- ending_unit?:number;
157
-
158
- /**
159
- * @description The per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. The total cost for the item price when the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;. The value is in the minor unit of the currency.
160
-
161
- */
162
-
163
- price:number;
164
-
165
- /**
166
- * @description The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as &#x60;ending_unit_in_decimal&#x60; of the next lower tier. Returned only when the pricing_model is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
167
-
168
- */
169
-
170
- starting_unit_in_decimal?:string;
171
-
172
- /**
173
- * @description The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the &#x60;starting_unit_in_decimal&#x60; of the next higher tier. Returned only when the pricing_model is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
174
-
175
- */
176
-
177
- ending_unit_in_decimal?:string;
178
-
179
- /**
180
- * @description The decimal representation of the per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. When the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
181
-
182
- */
183
-
184
- price_in_decimal?:string;
185
-
186
- /**
187
- * @description The index number of the subscription to which the item price is added. Provide a unique number between &#x60;0&#x60; and &#x60;4&#x60; (inclusive) for each subscription that is to be created.
188
-
189
- */
190
-
191
- index:number;
32
+ export interface InvoiceItem {
33
+ item_price_id: string;
34
+ quantity?: number;
35
+ quantity_in_decimal?: string;
36
+ unit_price?: number;
37
+ unit_price_in_decimal?: string;
38
+ service_period_days?: number;
192
39
  }
193
- export interface Coupon {
194
- /**
195
- * @description Used to uniquely identify the coupon
196
-
197
- */
198
-
199
- coupon_id:string;
40
+ export interface ItemTier {
41
+ item_price_id: string;
42
+ starting_unit: number;
43
+ ending_unit?: number;
44
+ price: number;
45
+ starting_unit_in_decimal?: string;
46
+ ending_unit_in_decimal?: string;
47
+ price_in_decimal?: string;
48
+ index: number;
200
49
  }
201
- export interface Discount {
202
- /**
203
- * @description An immutable unique id for the discount. It is always auto-generated.
204
-
205
- */
206
-
207
- id:string;
208
-
209
- /**
210
- * @description The name of the discount as it should appear on customer-facing pages and documents such as [invoices](/docs/api/invoices?prod_cat_ver&#x3D;2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver&#x3D;2). This is auto-generated based on the &#x60;type&#x60;, &#x60;amount&#x60;, and &#x60;currency_code&#x60; of the discount. For example, it can be &#x60;10% off&#x60; or &#x60;10$ off&#x60;.
211
-
212
- */
213
-
214
- invoice_name?:string;
215
-
216
- /**
217
- * @description The type of discount. Possible value are: \* percentage - The specified percentage will be given as discount. \* fixed_amount - The specified amount will be given as discount.
218
-
219
- */
220
-
221
- type:'fixed_amount' | 'percentage';
222
-
223
- /**
224
- * @description The percentage of the original amount that should be deducted from it. Only applicable when &#x60;discount.type&#x60; is percentage.
225
-
226
- */
227
-
228
- percentage?:number;
229
-
230
- /**
231
- * @description The value of the discount. [The format of this value](https://apidocs.chargebee.com/docs/api?prod_cat_ver&#x3D;2#currencies) depends on the kind of currency. This is only applicable when &#x60;discount.type&#x60; is &#x60;fixed_amount&#x60;.
232
-
233
- */
234
-
235
- amount?:number;
236
-
237
- /**
238
- * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the discount. This is only applicable when &#x60;discount.type&#x60; is &#x60;fixed_amount&#x60;.
239
-
240
- */
241
-
242
- currency_code?:string;
243
-
244
- /**
245
- * @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice &#x60;sub_total&#x60;. \* specific_item_price - The discount is applied to the &#x60;invoice.line_item.amount&#x60; that corresponds to the item price specified by &#x60;item_price_id&#x60;.
246
-
247
- */
248
-
249
- apply_on:'specific_item_price' | 'invoice_amount';
250
-
251
- /**
252
- * @description The [id of the item price](/docs/api/subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when &#x60;apply_on&#x60; &#x3D; &#x60;specific_item_price&#x60;.
253
-
254
- */
255
-
256
- item_price_id?:string;
257
-
258
- /**
259
- * @description Timestamp indicating when this discount is created.
260
-
261
- */
262
-
263
- created_at:number;
264
-
265
- /**
266
- * @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
267
- **Note:**
268
-
269
-
270
- When the coupon ID contains a special character; for example: &#x60;#&#x60;, the API returns an error.
271
- Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
272
-
273
- */
274
-
275
- coupon_id:string;
276
-
277
- /**
278
- * @description The index number of the subscription to which the item price is added. Provide a unique number between &#x60;0&#x60; and &#x60;4&#x60; (inclusive) for each subscription that is to be created.
279
-
280
- */
281
-
282
- index:number;
50
+ export interface Coupon {
51
+ coupon_id: string;
283
52
  }
53
+ // REQUEST PARAMS
54
+ //---------------
284
55
  }
285
- }
56
+ }