chargebee 2.26.0 → 2.27.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 (65) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/chargebee.js +1 -1
  3. package/lib/resources/api_endpoints.js +8 -1
  4. package/package.json +1 -1
  5. package/types/core.d.ts +1 -0
  6. package/types/resources/Address.d.ts +235 -5
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  8. package/types/resources/AttachedItem.d.ts +285 -13
  9. package/types/resources/Card.d.ts +375 -13
  10. package/types/resources/Comment.d.ts +160 -11
  11. package/types/resources/Contact.d.ts +54 -0
  12. package/types/resources/ContractTerm.d.ts +83 -0
  13. package/types/resources/Coupon.d.ts +628 -20
  14. package/types/resources/CouponCode.d.ts +46 -5
  15. package/types/resources/CouponSet.d.ts +194 -17
  16. package/types/resources/CreditNote.d.ts +1100 -44
  17. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  18. package/types/resources/Customer.d.ts +1819 -73
  19. package/types/resources/DifferentialPrice.d.ts +246 -15
  20. package/types/resources/Discount.d.ts +107 -0
  21. package/types/resources/Download.d.ts +18 -0
  22. package/types/resources/EntitlementOverride.d.ts +101 -7
  23. package/types/resources/Estimate.d.ts +1021 -27
  24. package/types/resources/Event.d.ts +138 -8
  25. package/types/resources/Export.d.ts +622 -32
  26. package/types/resources/Feature.d.ts +287 -22
  27. package/types/resources/Gift.d.ts +296 -24
  28. package/types/resources/Hierarchy.d.ts +30 -0
  29. package/types/resources/HostedPage.d.ts +1046 -37
  30. package/types/resources/ImpactedItem.d.ts +41 -1
  31. package/types/resources/ImpactedSubscription.d.ts +36 -1
  32. package/types/resources/InAppSubscription.d.ts +369 -9
  33. package/types/resources/Invoice.d.ts +1942 -92
  34. package/types/resources/InvoiceEstimate.d.ts +75 -6
  35. package/types/resources/Item.d.ts +522 -16
  36. package/types/resources/ItemEntitlement.d.ts +162 -13
  37. package/types/resources/ItemFamily.d.ts +153 -15
  38. package/types/resources/ItemPrice.d.ts +951 -26
  39. package/types/resources/Media.d.ts +24 -0
  40. package/types/resources/NonSubscription.d.ts +46 -3
  41. package/types/resources/Order.d.ts +1172 -32
  42. package/types/resources/PaymentIntent.d.ts +293 -8
  43. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  44. package/types/resources/PaymentSource.d.ts +984 -55
  45. package/types/resources/PaymentVoucher.d.ts +252 -14
  46. package/types/resources/PortalSession.d.ts +154 -10
  47. package/types/resources/PromotionalCredit.d.ts +300 -16
  48. package/types/resources/Purchase.d.ts +206 -5
  49. package/types/resources/Quote.d.ts +1430 -62
  50. package/types/resources/QuoteLineGroup.d.ts +134 -5
  51. package/types/resources/QuotedCharge.d.ts +63 -5
  52. package/types/resources/QuotedSubscription.d.ts +192 -5
  53. package/types/resources/ResourceMigration.d.ts +68 -3
  54. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  55. package/types/resources/Subscription.d.ts +2564 -137
  56. package/types/resources/SubscriptionEntitlement.d.ts +116 -8
  57. package/types/resources/SubscriptionEstimate.d.ts +36 -2
  58. package/types/resources/TaxWithheld.d.ts +32 -0
  59. package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
  60. package/types/resources/TimeMachine.d.ts +82 -7
  61. package/types/resources/Token.d.ts +164 -7
  62. package/types/resources/Transaction.d.ts +567 -25
  63. package/types/resources/UnbilledCharge.d.ts +309 -14
  64. package/types/resources/Usage.d.ts +237 -13
  65. package/types/resources/VirtualBankAccount.d.ts +220 -17
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ### v2.26.1 (2023-08-11)
2
+ * * *
3
+ * Support Descriptions for the attributes and actions has been added.
4
+
5
+ ### v2.27.0 (2023-09-05)
6
+ * * *
7
+
8
+ #### New Resource:
9
+ * CsvTaxRule has been added.
10
+
11
+ #### New attributes:
12
+ * direct_debit_scheme has been added to the PaymentSource#PaymentSourceBankAccount resource.
13
+
14
+ #### New Enum :
15
+ * DirectDebitSchemeEnum has been added.
16
+ * Tax1JurisTypeEnum has been added.
17
+ * Tax2JurisTypeEnum has been added.
18
+ * Tax3JurisTypeEnum has been added.
19
+ * Tax4JurisTypeEnum has been added.
20
+
21
+ #### New Input parameters:
22
+ * avalara_tax_code, hsn_code, taxjar_product_code has been added to Invoice#AddChargeRequest.
23
+
24
+
1
25
  ### v2.26.0 (2023-07-31)
2
26
  * * *
3
27
 
package/lib/chargebee.js CHANGED
@@ -11,7 +11,7 @@ ChargeBee._env = {
11
11
  hostSuffix: '.chargebee.com',
12
12
  apiPath: '/api/v2',
13
13
  timeout: 80000,
14
- clientVersion: 'v2.26.0',
14
+ clientVersion: 'v2.27.0',
15
15
  port: 443,
16
16
  timemachineWaitInMillis: 3000,
17
17
  exportWaitInMillis: 3000
@@ -2676,6 +2676,13 @@ var _endpoints = {
2676
2676
  "/payment_vouchers",
2677
2677
  true
2678
2678
  ]
2679
- ]
2679
+ ],
2680
+ "csv_tax_rule": [[
2681
+ "create",
2682
+ "POST",
2683
+ "/csv_tax_rules",
2684
+ null,
2685
+ false
2686
+ ]]
2680
2687
  };
2681
2688
  module.exports = _endpoints;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"chargebee",
3
- "version":"2.26.0",
3
+ "version":"2.27.0",
4
4
  "description":"A library for integrating with ChargeBee.",
5
5
  "keywords":[
6
6
  "payments",
package/types/core.d.ts CHANGED
@@ -57,6 +57,7 @@ declare module 'chargebee' {
57
57
  type Operation = 'create' | 'update' | 'delete'
58
58
  type OperationType = 'add' | 'remove'
59
59
  type PauseOption = 'end_of_term' | 'billing_cycles' | 'immediately' | 'specific_date'
60
+ type PaymentInitiator = 'merchant' | 'customer'
60
61
  type PaymentMethod = 'other' | 'netbanking_emandates' | 'ach_credit' | 'dotpay' | 'boleto' | 'direct_debit' | 'chargeback' | 'wechat_pay' | 'cash' | 'giropay' | 'bank_transfer' | 'alipay' | 'ideal' | 'google_pay' | 'custom' | 'unionpay' | 'check' | 'sofort' | 'amazon_payments' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'sepa_credit' | 'card'
61
62
  type PaymentMethodType = 'giropay' | 'alipay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'unionpay' | 'direct_debit' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'wechat_pay' | 'card'
62
63
  type PaymentVoucherType = 'boleto'
@@ -1,54 +1,284 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface Address {
4
+
5
+ /**
6
+ * @description Label to identify the address. This is unique for all the address for a subscription.
7
+
8
+ */
9
+
4
10
  label:string;
11
+
12
+ /**
13
+ * @description First name
14
+
15
+ */
16
+
5
17
  first_name?:string;
18
+
19
+ /**
20
+ * @description Last name
21
+
22
+ */
23
+
6
24
  last_name?:string;
25
+
26
+ /**
27
+ * @description Email
28
+
29
+ */
30
+
7
31
  email?:string;
32
+
33
+ /**
34
+ * @description Company name
35
+
36
+ */
37
+
8
38
  company?:string;
39
+
40
+ /**
41
+ * @description Phone number
42
+
43
+ */
44
+
9
45
  phone?:string;
46
+
47
+ /**
48
+ * @description Address line 1
49
+
50
+ */
51
+
10
52
  addr?:string;
53
+
54
+ /**
55
+ * @description Address line 2
56
+
57
+ */
58
+
11
59
  extended_addr?:string;
60
+
61
+ /**
62
+ * @description Address line 3
63
+
64
+ */
65
+
12
66
  extended_addr2?:string;
67
+
68
+ /**
69
+ * @description Name of the city
70
+
71
+ */
72
+
13
73
  city?:string;
74
+
75
+ /**
76
+ * @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
77
+
78
+ */
79
+
14
80
  state_code?:string;
81
+
82
+ /**
83
+ * @description State or Province
84
+
85
+ */
86
+
15
87
  state?:string;
88
+
89
+ /**
90
+ * @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
91
+
92
+ **Note** : If you enter an invalid country code, the system will return an error.
93
+
94
+ **Brexit**
95
+
96
+
97
+ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
98
+
99
+ */
100
+
16
101
  country?:string;
102
+
103
+ /**
104
+ * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
105
+
106
+ */
107
+
17
108
  zip?:string;
109
+
110
+ /**
111
+ * @description The address verification status. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* not_validated - Address is not yet validated. \* invalid - Address is invalid. \* valid - Address was validated successfully.
112
+
113
+ */
114
+
18
115
  validation_status?:ValidationStatus;
116
+
117
+ /**
118
+ * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
119
+
120
+ */
121
+
19
122
  subscription_id:string;
20
123
  }
21
124
  export namespace Address {
22
- export class AddressResource {
125
+ export class AddressResource {
126
+ /**
127
+ * @description Retrieves an address resource for a subscription and the specified label.
128
+
129
+ */
130
+
23
131
  retrieve(input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
132
+
133
+ /**
134
+ * @description Adds or replaces the address for a subscription. If an address is already present for the specified label, it will be replaced otherwise new address is added with that label.
135
+
136
+ */
137
+
24
138
  update(input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
25
139
  }
26
- export interface RetrieveResponse {
27
- address:Address;
140
+ export interface RetrieveResponse {
141
+ address:Address;
28
142
  }
29
143
  export interface RetrieveInputParam {
144
+
145
+ /**
146
+ * @description Retrieves an address resource for a subscription and the specified label.
147
+
148
+ */
149
+
30
150
  subscription_id:string;
151
+
152
+ /**
153
+ * @description Retrieves an address resource for a subscription and the specified label.
154
+
155
+ */
156
+
31
157
  label:string;
32
158
  }
33
- export interface UpdateResponse {
34
- address:Address;
159
+ export interface UpdateResponse {
160
+ address:Address;
35
161
  }
36
162
  export interface UpdateInputParam {
163
+
164
+ /**
165
+ * @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
166
+
167
+ */
168
+
37
169
  subscription_id:string;
170
+
171
+ /**
172
+ * @description Label to identify the address. This is unique for all the address for a subscription.
173
+
174
+ */
175
+
38
176
  label:string;
177
+
178
+ /**
179
+ * @description First name.
180
+
181
+ */
182
+
39
183
  first_name?:string;
184
+
185
+ /**
186
+ * @description Last name.
187
+
188
+ */
189
+
40
190
  last_name?:string;
191
+
192
+ /**
193
+ * @description Email.
194
+
195
+ */
196
+
41
197
  email?:string;
198
+
199
+ /**
200
+ * @description Company name.
201
+
202
+ */
203
+
42
204
  company?:string;
205
+
206
+ /**
207
+ * @description Phone number.
208
+
209
+ */
210
+
43
211
  phone?:string;
212
+
213
+ /**
214
+ * @description Address line 1.
215
+
216
+ */
217
+
44
218
  addr?:string;
219
+
220
+ /**
221
+ * @description Address line 2.
222
+
223
+ */
224
+
45
225
  extended_addr?:string;
226
+
227
+ /**
228
+ * @description Address line 3.
229
+
230
+ */
231
+
46
232
  extended_addr2?:string;
233
+
234
+ /**
235
+ * @description Name of the city.
236
+
237
+ */
238
+
47
239
  city?:string;
240
+
241
+ /**
242
+ * @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
243
+
244
+ */
245
+
48
246
  state_code?:string;
247
+
248
+ /**
249
+ * @description The state/province name. Is set by Chargebee automatically for US, Canada and India If &#x60;state_code&#x60; is provided.
250
+
251
+ */
252
+
49
253
  state?:string;
254
+
255
+ /**
256
+ * @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
257
+
258
+ */
259
+
50
260
  zip?:string;
261
+
262
+ /**
263
+ * @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
264
+
265
+ **Note** : If you enter an invalid country code, the system will return an error.
266
+
267
+ **Brexit**
268
+
269
+
270
+ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
271
+ .
272
+
273
+ */
274
+
51
275
  country?:string;
276
+
277
+ /**
278
+ * @description The address verification status. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* not_validated - Address is not yet validated. \* invalid - Address is invalid. \* valid - Address was validated successfully.
279
+
280
+ */
281
+
52
282
  validation_status?:ValidationStatus;
53
283
  }
54
284
 
@@ -1,25 +1,101 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface AdvanceInvoiceSchedule {
4
+
5
+ /**
6
+ * @description System-generated and immutable unique Id for the &#x60;advance_invoice_schedule&#x60;.
7
+
8
+ */
9
+
4
10
  id:string;
11
+
12
+ /**
13
+ * @description The type of advance invoice or advance invoicing schedule. \* specific_dates - The advance charges occur on specific dates. For each date, [a fixed number of billing cycles](advance_invoice_schedules#advance_invoice_schedule_specific_dates_schedule_terms_to_charge) is charged for. There can be up to 5 dates configured. \* fixed_intervals - The advance charges occur at [fixed intervals of time](advance_invoice_schedules#advance_invoice_schedule_fixed_interval_schedule_terms_to_charge).
14
+
15
+ */
16
+
5
17
  schedule_type?:'specific_dates' | 'fixed_intervals';
18
+
19
+ /**
20
+ * @description When the &#x60;schedule_type&#x60; is &#x60;fixed_intervals&#x60;, this object gives further details of the schedule.
21
+
22
+ */
23
+
6
24
  fixed_interval_schedule?:AdvanceInvoiceSchedule.FixedIntervalSchedule;
25
+
26
+ /**
27
+ * @description The advance charges occur on specific dates. For each date, [a fixed number of billing cycles](advance_invoice_schedules#advance_invoice_schedule_specific_dates_schedule_terms_to_charge) is charged for. There can be up to 5 dates configured.
28
+
29
+ */
30
+
7
31
  specific_dates_schedule?:AdvanceInvoiceSchedule.SpecificDatesSchedule;
8
32
  }
9
33
  export namespace AdvanceInvoiceSchedule {
10
34
 
11
35
 
12
- export interface FixedIntervalSchedule {
36
+ export interface FixedIntervalSchedule {
37
+ /**
38
+ * @description Specifies when the schedule should end. \* after_number_of_intervals - Advance invoices are generated a &#x60;specified number of times&#x60; \* subscription_end - Advance invoices are generated for as long as the subscription is active. \* specific_date - End the advance invoicing schedule on a &#x60;specific date&#x60;.
39
+
40
+ */
41
+
13
42
  end_schedule_on?:EndScheduleOn;
43
+
44
+ /**
45
+ * @description The number of advance invoices to generate. The schedule is created such that the total number of billing cycles in the schedule does not exceed the [&#x60;remaining_billing_cycles&#x60;](subscriptions#subscription_remaining_billing_cycles) of the subscription. This parameter is applicable only when [&#x60;fixed_interval_schedule[end_schedule_on]&#x60;](advance_invoice_schedules#advance_invoice_schedule_fixed_interval_schedule_end_schedule_on) &#x3D; &#x60;after_number_of_intervals&#x60;
46
+
47
+ */
48
+
14
49
  number_of_occurrences?:number;
50
+
51
+ /**
52
+ * @description The number of days before each interval that advance invoices are generated.
53
+
54
+ */
55
+
15
56
  days_before_renewal?:number;
57
+
58
+ /**
59
+ * @description The date when the schedule should end. Advance invoices are not generated beyond this date. It must be at least 1 day before the start of the last billing cycle of the subscription and also within 5 years from the current date. This parameter is only applicable when [&#x60;fixed_interval_schedule[end_schedule_on]&#x60;](advance_invoice_schedules#advance_invoice_schedule_fixed_interval_schedule_end_schedule_on) &#x3D; &#x60;specific_date&#x60;.
60
+
61
+ */
62
+
16
63
  end_date?:number;
64
+
65
+ /**
66
+ * @description The date when this advance invoicing schedule was created.
67
+
68
+ */
69
+
17
70
  created_at?:number;
71
+
72
+ /**
73
+ * @description The number of billing cycles in one interval.
74
+
75
+ */
76
+
18
77
  terms_to_charge?:number;
19
78
  }
20
- export interface SpecificDatesSchedule {
79
+ export interface SpecificDatesSchedule {
80
+ /**
81
+ * @description The number of billing cycles to charge for, on the date specified. Applicable only when [&#x60;schedule_type&#x60;](advance_invoice_schedules#advance_invoice_schedule_schedule_type) is specific_dates.
82
+
83
+ */
84
+
21
85
  terms_to_charge?:number;
86
+
87
+ /**
88
+ * @description The unique id of the member of the advance_invoice_schedule array which corresponds to the specific_dates_schedule that you intend to modify. Only applicable when [&#x60;schedule_type&#x60;](advance_invoice_schedules#advance_invoice_schedule_schedule_type) is &#x60;specific_dates&#x60;.
89
+
90
+ */
91
+
22
92
  date?:number;
93
+
94
+ /**
95
+ * @description The date when this advance invoicing schedule was created.
96
+
97
+ */
98
+
23
99
  created_at?:number;
24
100
  }
25
101
  }