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,352 +1,114 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface AttachedItem {
4
-
5
- /**
6
- * @description The unique id for the attached item. Set to a random, immutable value automatically when the attached item is created.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description The id of the plan-item to which the item is attached.
14
-
15
- */
16
-
17
- parent_item_id:string;
18
-
19
- /**
20
- * @description The id of the item being attached.
21
-
22
- */
23
-
24
- item_id:string;
25
-
26
- /**
27
- * @description The type of attachment for the addon. Only applicable for addon-items. \* recommended - The addon is recommended to go with the plan-item when using [Checkout](https://www.chargebee.com/docs/2.0/configure-inapp.html#fundamental-settings_recommending-addons-in-checkout) or [Portal](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html#allow-change-subscription). \* optional - The addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a &#x60;quantity&#x60; and &#x60;billing_cycles&#x60; for the addon, for when it is applied to subscriptions with the plan. \* mandatory - The addon is attached automatically to the subscription for the plan-item unless [explicitly removed](./subscriptions?prod_cat_ver&#x3D;2) via API.
28
-
29
- */
30
-
31
- type:'optional' | 'mandatory' | 'recommended';
32
-
33
- /**
34
- * @description The item state. \* active - New subscriptions can be created with the item. \* deleted - No subscriptions allowed for the item. \* archived - No new subscriptions allowed for the item.
35
-
36
- */
37
-
38
- status?:'archived' | 'deleted' | 'active';
39
-
40
- /**
41
- * @description The default quantity of the addon to be attached when the quantity is not specified while [creating](subscriptions?prod_cat_ver&#x3D;2#create_subscription_for_items)/[updating](subscriptions?prod_cat_ver&#x3D;2#update_subscription_for_items) the subscription.
42
-
43
- */
44
-
45
- quantity?:number;
46
-
47
- /**
48
- * @description The decimal representation of the quantity of the addon. Returned for quantity-based addons when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
49
-
50
- */
51
-
52
- quantity_in_decimal?:string;
53
-
54
- /**
55
- * @description The number of subscription billing cycles for which this item is attached when applied to a subscription. Applicable only for items of type addon. Requires [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html) to be enabled for the site.
56
- The value set explicitly for &#x60;billing_cycles&#x60; while [applying the addon to a subscription](./subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items) takes precedence over this attribute. This attribute, in turn, has a higher precedence than [the value set for the addon-item price](./item_prices?prod_cat_ver&#x3D;2).
57
-
58
- */
59
-
60
- billing_cycles?:number;
61
-
62
- /**
63
- * @description Indicates when the item is charged. This attribute only applies to charge-items. \* contract_termination - when a contract term is [terminated](./subscriptions?prod_cat_ver&#x3D;2#cancel_subscription_for_items_contract_term_cancel_option). \* subscription_creation - the time of creation of the subscription. \* subscription_trial_start - the time when the trial period of the subscription begins. \* on_demand - Item can be charged on demand \* plan_activation - same as subscription activation, but also includes the case when the plan-item of the subscription is changed. \* subscription_activation - the moment a subscription enters an &#x60;active&#x60; or &#x60;non-renewing&#x60; state. Also includes reactivations of canceled subscriptions.
64
-
65
- */
66
-
67
- charge_on_event:ChargeOnEvent;
68
-
69
- /**
70
- * @description Indicates if the charge-item is to be charged only once or each time the &#x60;charge_on_event&#x60; occurs. This attribute only applies to charge-items.
71
-
72
- */
73
-
74
- charge_once:boolean;
75
-
76
- /**
77
- * @description The time at which this attached item was created.
78
-
79
- */
80
-
81
- created_at:number;
82
-
83
- /**
84
- * @description Version number of this resource. The &#x60;resource_version&#x60; 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.
85
-
86
- */
87
-
88
- resource_version?:number;
89
-
90
- /**
91
- * @description The time at which this attached item was last updated.
92
-
93
- */
94
-
95
- updated_at?:number;
96
-
97
- /**
98
- * @description The subscription channel this object originated from and is maintained in. \* web - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI. \* app_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed. \* play_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
99
-
100
- */
101
-
102
- channel?:Channel;
6
+ id: string;
7
+ parent_item_id: string;
8
+ item_id: string;
9
+ type: 'recommended' | 'mandatory' | 'optional';
10
+ status?: 'active' | 'archived' | 'deleted';
11
+ quantity?: number;
12
+ quantity_in_decimal?: string;
13
+ billing_cycles?: number;
14
+ charge_on_event: ChargeOnEvent;
15
+ charge_once: boolean;
16
+ created_at: number;
17
+ resource_version?: number;
18
+ updated_at?: number;
19
+ channel?: Channel;
103
20
  }
104
- export namespace AttachedItem {
105
- export class AttachedItemResource {
106
- /**
107
- * @description Creates an attached addon or a charge item for a plan.
108
-
109
- */
110
-
111
- create(item_id:string, input:CreateInputParam):ChargebeeRequest<CreateResponse>;
112
-
113
- /**
114
- * @description Updates an attached addon or a charge item for a plan.
115
-
116
- */
117
-
118
- update(attached_item_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
119
-
120
- /**
121
- * @description Retrieves details of an attached addon or a charge item.
122
-
123
- */
124
-
125
- retrieve(attached_item_id:string, input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
126
-
127
- /**
128
- * @description Deletes an attached addon or a charge item.
129
21
 
130
- */
131
-
132
- delete(attached_item_id:string, input:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
133
-
134
- /**
135
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
136
-
137
- */
138
-
139
- list(item_id:string, input?:ListInputParam):ChargebeeRequest<ListResponse>;
140
- }
141
- export interface CreateResponse {
142
- attached_item:AttachedItem;
22
+ export namespace AttachedItem {
23
+ export class AttachedItemResource {
24
+ create(
25
+ item_id: string,
26
+ input: CreateInputParam,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<CreateResponse>>;
29
+
30
+ update(
31
+ attached_item_id: string,
32
+ input: UpdateInputParam,
33
+ headers?: ChargebeeRequestHeader,
34
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
35
+
36
+ retrieve(
37
+ attached_item_id: string,
38
+ input: RetrieveInputParam,
39
+ headers?: ChargebeeRequestHeader,
40
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
41
+
42
+ delete(
43
+ attached_item_id: string,
44
+ input: DeleteInputParam,
45
+ headers?: ChargebeeRequestHeader,
46
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
47
+
48
+ list(
49
+ item_id: string,
50
+ input?: ListInputParam,
51
+ headers?: ChargebeeRequestHeader,
52
+ ): Promise<ChargebeeResponse<ListResponse>>;
143
53
  }
144
- export interface CreateInputParam {
145
-
146
- /**
147
- * @description The id of the addon or charge that is being attached to the plan-item.
148
-
149
- */
150
-
151
- item_id:string;
152
-
153
- /**
154
- * @description The type of attachment for the addon. Only applicable for addon-items and is a required parameter as well for addon-items. \* recommended - The addon is recommended to go with the plan-item when using [Checkout](https://www.chargebee.com/docs/2.0/configure-inapp.html#fundamental-settings_recommending-addons-in-checkout) or [Portal](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html#allow-change-subscription). \* optional - The addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a &#x60;quantity&#x60; and &#x60;billing_cycles&#x60; for the addon, for when it is applied to subscriptions with the plan. \* mandatory - The addon is attached automatically to the subscription for the plan-item unless [explicitly removed](./subscriptions?prod_cat_ver&#x3D;2) via API.
155
-
156
- */
157
-
158
- type?:'optional' | 'mandatory' | 'recommended';
159
-
160
- /**
161
- * @description The number of subscription billing cycles for which this item is attached when applied to a subscription. Applicable only for items of type addon. Requires [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html) to be enabled for the site.
162
-
163
- The value set explicitly for &#x60;billing_cycles&#x60; while [applying the addon to a subscription](./subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items) takes precedence over this parameter. This parameter, in turn, has a higher precedence than [the value set for the addon-item price](./item_prices?prod_cat_ver&#x3D;2).
164
-
165
- */
166
-
167
- billing_cycles?:number;
168
-
169
- /**
170
- * @description The default quantity of the addon to be attached when the quantity is not specified while [creating](subscriptions?prod_cat_ver&#x3D;2#create_subscription_for_items)/[updating](subscriptions?prod_cat_ver&#x3D;2#update_subscription_for_items) the subscription.
171
-
172
- */
173
-
174
- quantity?:number;
175
-
176
- /**
177
- * @description The decimal representation of the quantity of the addon. Returned for quantity-based addons when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
178
54
 
179
- */
180
-
181
- quantity_in_decimal?:string;
182
-
183
- /**
184
- * @description Indicates when the item is charged. This parameter only applies to charge-items. \* contract_termination - when a contract term is [terminated](./subscriptions?prod_cat_ver&#x3D;2#cancel_subscription_for_items_contract_term_cancel_option). \* subscription_creation - the time of creation of the subscription. \* subscription_trial_start - the time when the trial period of the subscription begins. \* on_demand - Item can be charged on demand \* plan_activation - same as subscription activation, but also includes the case when the plan-item of the subscription is changed. \* subscription_activation - the moment a subscription enters an &#x60;active&#x60; or &#x60;non-renewing&#x60; state. Also includes reactivations of canceled subscriptions.
185
-
186
- */
187
-
188
- charge_on_event?:ChargeOnEvent;
189
-
190
- /**
191
- * @description Indicates if the charge-item is to be charged only once or each time the &#x60;charge_on_event&#x60; occurs. This parameter only applies to charge-items.
192
-
193
- */
194
-
195
- charge_once?:boolean;
55
+ export interface CreateResponse {
56
+ attached_item: AttachedItem;
196
57
  }
197
- export interface UpdateResponse {
198
- attached_item:AttachedItem;
199
- }
200
- export interface UpdateInputParam {
201
-
202
- /**
203
- * @description The id of the parent item in the attachment relationship.
204
58
 
205
- */
206
-
207
- parent_item_id:string;
208
-
209
- /**
210
- * @description The type of attachment for the addon. Only applicable for addon-items and is a required parameter as well for addon-items. \* recommended - The addon is recommended to go with the plan-item when using [Checkout](https://www.chargebee.com/docs/2.0/configure-inapp.html#fundamental-settings_recommending-addons-in-checkout) or [Portal](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html#allow-change-subscription). \* optional - The addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a &#x60;quantity&#x60; and &#x60;billing_cycles&#x60; for the addon, for when it is applied to subscriptions with the plan. \* mandatory - The addon is attached automatically to the subscription for the plan-item unless [explicitly removed](./subscriptions?prod_cat_ver&#x3D;2) via API.
211
-
212
- */
213
-
214
- type?:'optional' | 'mandatory' | 'recommended';
215
-
216
- /**
217
- * @description The number of subscription billing cycles for which this item is attached when applied to a subscription. Applicable only for items of type addon. Requires [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html) to be enabled for the site.
218
-
219
- The value set explicitly for &#x60;billing_cycles&#x60; while [applying the addon to a subscription](./subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items) takes precedence over this parameter. This parameter, in turn, has a higher precedence than [the value set for the addon-item price](./item_prices?prod_cat_ver&#x3D;2).
59
+ export interface UpdateResponse {
60
+ attached_item: AttachedItem;
61
+ }
220
62
 
221
- */
222
-
223
- billing_cycles?:number;
224
-
225
- /**
226
- * @description The default quantity of the addon to be attached when the quantity is not specified while [creating](subscriptions?prod_cat_ver&#x3D;2#create_subscription_for_items)/[updating](subscriptions?prod_cat_ver&#x3D;2#update_subscription_for_items) the subscription.
63
+ export interface RetrieveResponse {
64
+ attached_item: AttachedItem;
65
+ }
227
66
 
228
- */
229
-
230
- quantity?:number;
231
-
232
- /**
233
- * @description The decimal representation of the quantity of the addon. Returned for quantity-based addons when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
67
+ export interface DeleteResponse {
68
+ attached_item: AttachedItem;
69
+ }
234
70
 
235
- */
236
-
237
- quantity_in_decimal?:string;
238
-
239
- /**
240
- * @description Indicates when the item is charged. This parameter only applies to charge-items. \* contract_termination - when a contract term is [terminated](./subscriptions?prod_cat_ver&#x3D;2#cancel_subscription_for_items_contract_term_cancel_option). \* subscription_creation - the time of creation of the subscription. \* subscription_trial_start - the time when the trial period of the subscription begins. \* on_demand - Item can be charged on demand \* plan_activation - same as subscription activation, but also includes the case when the plan-item of the subscription is changed. \* subscription_activation - the moment a subscription enters an &#x60;active&#x60; or &#x60;non-renewing&#x60; state. Also includes reactivations of canceled subscriptions.
71
+ export interface ListResponse {
72
+ list: { attached_item: AttachedItem }[];
73
+ next_offset?: string;
74
+ }
241
75
 
242
- */
243
-
244
- charge_on_event?:ChargeOnEvent;
245
-
246
- /**
247
- * @description Indicates if the charge-item is to be charged only once or each time the &#x60;charge_on_event&#x60; occurs. This parameter only applies to charge-items.
76
+ // REQUEST PARAMS
77
+ //---------------
248
78
 
249
- */
250
-
251
- charge_once?:boolean;
79
+ export interface CreateInputParam {
80
+ item_id: string;
81
+ type?: 'recommended' | 'mandatory' | 'optional';
82
+ billing_cycles?: number;
83
+ quantity?: number;
84
+ quantity_in_decimal?: string;
85
+ charge_on_event?: ChargeOnEvent;
86
+ charge_once?: boolean;
252
87
  }
253
- export interface RetrieveResponse {
254
- attached_item:AttachedItem;
88
+ export interface UpdateInputParam {
89
+ parent_item_id: string;
90
+ type?: 'recommended' | 'mandatory' | 'optional';
91
+ billing_cycles?: number;
92
+ quantity?: number;
93
+ quantity_in_decimal?: string;
94
+ charge_on_event?: ChargeOnEvent;
95
+ charge_once?: boolean;
255
96
  }
256
97
  export interface RetrieveInputParam {
257
-
258
- /**
259
- * @description Retrieves details of an attached addon or a charge item.
260
-
261
- */
262
-
263
- parent_item_id:string;
264
- }
265
- export interface DeleteResponse {
266
- attached_item:AttachedItem;
98
+ parent_item_id: string;
267
99
  }
268
100
  export interface DeleteInputParam {
269
-
270
- /**
271
- * @description The id of the addon or charge that is being attached to the plan-item.
272
-
273
- */
274
-
275
- parent_item_id:string;
276
- }
277
- export interface ListResponse {
278
- /**
279
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
280
-
281
- */
282
-
283
- list:{attached_item:AttachedItem}[];
284
-
285
- /**
286
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
287
-
288
- */
289
-
290
- next_offset?:string;
101
+ parent_item_id: string;
291
102
  }
292
103
  export interface ListInputParam {
293
- [key : string]: any;
294
- /**
295
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
296
-
297
- */
298
-
299
- limit?:number;
300
-
301
- /**
302
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
303
-
304
- */
305
-
306
- offset?:string;
307
-
308
- /**
309
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
310
-
311
- */
312
-
313
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
314
-
315
- /**
316
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
317
-
318
- */
319
-
320
- item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
321
-
322
- /**
323
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
324
-
325
- */
326
-
327
- type?:{in?:string,is?:'optional' | 'mandatory' | 'recommended',is_not?:'optional' | 'mandatory' | 'recommended',not_in?:string};
328
-
329
- /**
330
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
331
-
332
- */
333
-
334
- item_type?:{in?:string,is?:'charge' | 'addon' | 'plan',is_not?:'charge' | 'addon' | 'plan',not_in?:string};
335
-
336
- /**
337
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
338
-
339
- */
340
-
341
- charge_on_event?:{in?:string,is?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation' | 'on_demand',is_not?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation' | 'on_demand',not_in?:string};
342
-
343
- /**
344
- * @description Returns a list of attached items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
345
-
346
- */
347
-
348
- updated_at?:{after?:string,before?:string,between?:string,on?:string};
104
+ limit?: number;
105
+ offset?: string;
106
+ id?: filter.String;
107
+ item_id?: filter.String;
108
+ type?: filter.Enum;
109
+ item_type?: filter.Enum;
110
+ charge_on_event?: filter.Enum;
111
+ updated_at?: filter.Timestamp;
349
112
  }
350
-
351
113
  }
352
- }
114
+ }
@@ -1,9 +1,9 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface Attribute {
4
-
5
- name:string;
6
-
7
- value:string;
6
+ name: string;
7
+ value: string;
8
8
  }
9
- }
9
+ }
@@ -1,84 +1,64 @@
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 BusinessEntity {
5
-
6
- id:string;
7
-
8
- name:string;
9
-
10
- status:'active' | 'inactive';
11
-
12
- deleted:boolean;
13
-
14
- created_at:number;
15
-
16
- resource_version?:number;
17
-
18
- updated_at?:number;
6
+ id: string;
7
+ name: string;
8
+ status: 'active' | 'inactive';
9
+ deleted: boolean;
10
+ created_at: number;
11
+ resource_version?: number;
12
+ updated_at?: number;
19
13
  }
14
+
20
15
  export namespace BusinessEntity {
21
- export class BusinessEntityResource {
22
- create_transfers(input:CreateTransfersInputParam):ChargebeeRequest<CreateTransfersResponse>;
23
-
24
- get_transfers(input?:GetTransfersInputParam):ChargebeeRequest<GetTransfersResponse>;
25
- }
26
- export interface CreateTransfersResponse {
27
- business_entity_transfer:BusinessEntityTransfer;
16
+ export class BusinessEntityResource {
17
+ createTransfers(
18
+ input: CreateTransfersInputParam,
19
+ headers?: ChargebeeRequestHeader,
20
+ ): Promise<ChargebeeResponse<CreateTransfersResponse>>;
21
+
22
+ getTransfers(
23
+ input?: GetTransfersInputParam,
24
+ headers?: ChargebeeRequestHeader,
25
+ ): Promise<ChargebeeResponse<GetTransfersResponse>>;
28
26
  }
29
- export interface CreateTransfersInputParam {
30
-
31
- active_resource_ids:string[];
32
-
33
- destination_business_entity_ids:string[];
34
-
35
- source_business_entity_ids?:string[];
36
-
37
- resource_types:string[];
38
-
39
- reason_codes:string[];
27
+
28
+ export interface CreateTransfersResponse {
29
+ business_entity_transfer: BusinessEntityTransfer;
40
30
  }
41
- export interface GetTransfersResponse {
42
- list:{business_entity_transfer:BusinessEntityTransfer}[];
43
-
44
- next_offset?:string;
31
+
32
+ export interface GetTransfersResponse {
33
+ list: { business_entity_transfer: BusinessEntityTransfer }[];
34
+ next_offset?: string;
45
35
  }
46
- export interface GetTransfersInputParam {
47
- [key : string]: any;
48
- /**
49
- * @description The number of resources to be returned.
50
36
 
51
- */
52
-
53
- limit?:number;
54
-
55
- /**
56
- * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
37
+ // REQUEST PARAMS
38
+ //---------------
57
39
 
58
- */
59
-
60
- offset?:string;
61
-
62
- resource_type?:{is?:string};
63
-
64
- /**
65
- * @description External handle of the resource from old business entity id
40
+ export interface CreateTransfersInputParam {
41
+ active_resource_ids: string[];
42
+ destination_business_entity_ids: string[] /**
43
+ * @deprecated Please refer API docs to use other attributes
44
+ */;
66
45
 
67
- */
68
-
69
- resource_id?:{is?:string};
70
-
71
- /**
72
- * @description External handle of the active resource
46
+ source_business_entity_ids?: string[] /**
47
+ * @deprecated Please refer API docs to use other attributes
48
+ */;
73
49
 
74
- */
75
-
76
- active_resource_id?:{is?:string};
77
-
78
- created_at?:{after?:string,before?:string,between?:string,on?:string};
79
-
80
- sort_by?:{asc?:'created_at',desc?:'created_at'};
50
+ resource_types: string[];
51
+ reason_codes: string[];
52
+ }
53
+ export interface GetTransfersInputParam {
54
+ limit?: number;
55
+ offset?: string;
56
+ resource_type?: filter.String;
57
+ resource_id?: filter.String;
58
+ active_resource_id?: filter.String;
59
+ created_at?: filter.Timestamp;
60
+ 'sort_by[asc]'?: string;
61
+ 'sort_by[desc]'?: string;
81
62
  }
82
-
83
63
  }
84
- }
64
+ }
@@ -1,21 +1,15 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface BusinessEntityTransfer {
4
-
5
- id:string;
6
-
7
- resource_type:'customer' | 'subscription';
8
-
9
- resource_id:string;
10
-
11
- active_resource_id:string;
12
-
13
- destination_business_entity_id:string;
14
-
15
- source_business_entity_id:string;
16
-
17
- reason_code:'correction';
18
-
19
- created_at:number;
6
+ id: string;
7
+ resource_type: 'customer' | 'subscription';
8
+ resource_id: string;
9
+ active_resource_id: string;
10
+ destination_business_entity_id: string;
11
+ source_business_entity_id: string;
12
+ reason_code: 'correction';
13
+ created_at: number;
20
14
  }
21
- }
15
+ }