chargebee 3.0.1 → 3.1.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 (86) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +16 -0
  4. package/esm/environment.js +1 -1
  5. package/esm/resources/api_endpoints.js +16 -0
  6. package/package.json +1 -1
  7. package/types/core.d.ts +588 -0
  8. package/types/index.d.ts +172 -0
  9. package/types/resources/Address.d.ts +71 -0
  10. package/types/resources/AdvanceInvoiceSchedule.d.ts +29 -0
  11. package/types/resources/AttachedItem.d.ts +116 -0
  12. package/types/resources/Attribute.d.ts +9 -0
  13. package/types/resources/BusinessEntity.d.ts +64 -0
  14. package/types/resources/BusinessEntityTransfer.d.ts +15 -0
  15. package/types/resources/Card.d.ts +172 -0
  16. package/types/resources/Comment.d.ts +92 -0
  17. package/types/resources/Contact.d.ts +16 -0
  18. package/types/resources/ContractTerm.d.ts +19 -0
  19. package/types/resources/Coupon.d.ts +329 -0
  20. package/types/resources/CouponCode.d.ts +70 -0
  21. package/types/resources/CouponSet.d.ts +111 -0
  22. package/types/resources/CreditNote.d.ts +629 -0
  23. package/types/resources/CreditNoteEstimate.d.ts +143 -0
  24. package/types/resources/Currency.d.ts +91 -0
  25. package/types/resources/Customer.d.ts +964 -0
  26. package/types/resources/CustomerEntitlement.d.ts +36 -0
  27. package/types/resources/DifferentialPrice.d.ts +144 -0
  28. package/types/resources/Discount.d.ts +24 -0
  29. package/types/resources/Download.d.ts +10 -0
  30. package/types/resources/Entitlement.d.ts +66 -0
  31. package/types/resources/EntitlementOverride.d.ts +76 -0
  32. package/types/resources/Estimate.d.ts +1237 -0
  33. package/types/resources/Event.d.ts +81 -0
  34. package/types/resources/Export.d.ts +615 -0
  35. package/types/resources/Feature.d.ts +142 -0
  36. package/types/resources/GatewayErrorDetail.d.ts +20 -0
  37. package/types/resources/Gift.d.ts +296 -0
  38. package/types/resources/Hierarchy.d.ts +12 -0
  39. package/types/resources/HostedPage.d.ts +1112 -0
  40. package/types/resources/ImpactedItem.d.ts +20 -0
  41. package/types/resources/ImpactedItemPrice.d.ts +20 -0
  42. package/types/resources/ImpactedSubscription.d.ts +20 -0
  43. package/types/resources/InAppSubscription.d.ts +116 -0
  44. package/types/resources/Invoice.d.ts +1695 -0
  45. package/types/resources/InvoiceEstimate.d.ts +143 -0
  46. package/types/resources/Item.d.ts +208 -0
  47. package/types/resources/ItemEntitlement.d.ts +103 -0
  48. package/types/resources/ItemFamily.d.ts +93 -0
  49. package/types/resources/ItemPrice.d.ts +332 -0
  50. package/types/resources/Metadata.d.ts +8 -0
  51. package/types/resources/NonSubscription.d.ts +48 -0
  52. package/types/resources/OmnichannelSubscription.d.ts +75 -0
  53. package/types/resources/OmnichannelTransaction.d.ts +16 -0
  54. package/types/resources/Order.d.ts +586 -0
  55. package/types/resources/PaymentIntent.d.ts +178 -0
  56. package/types/resources/PaymentReferenceNumber.d.ts +11 -0
  57. package/types/resources/PaymentSchedule.d.ts +28 -0
  58. package/types/resources/PaymentScheduleEstimate.d.ts +25 -0
  59. package/types/resources/PaymentScheduleScheme.d.ts +67 -0
  60. package/types/resources/PaymentSource.d.ts +530 -0
  61. package/types/resources/PaymentVoucher.d.ts +107 -0
  62. package/types/resources/PortalSession.d.ts +88 -0
  63. package/types/resources/PriceVariant.d.ts +116 -0
  64. package/types/resources/PricingPageSession.d.ts +130 -0
  65. package/types/resources/PromotionalCredit.d.ts +111 -0
  66. package/types/resources/Purchase.d.ts +202 -0
  67. package/types/resources/Quote.d.ts +1467 -0
  68. package/types/resources/QuoteLineGroup.d.ts +136 -0
  69. package/types/resources/QuotedCharge.d.ts +56 -0
  70. package/types/resources/QuotedSubscription.d.ts +114 -0
  71. package/types/resources/Ramp.d.ts +260 -0
  72. package/types/resources/RecordedPurchase.d.ts +60 -0
  73. package/types/resources/ResourceMigration.d.ts +36 -0
  74. package/types/resources/SiteMigrationDetail.d.ts +46 -0
  75. package/types/resources/Subscription.d.ts +2447 -0
  76. package/types/resources/SubscriptionEntitlement.d.ts +79 -0
  77. package/types/resources/SubscriptionEstimate.d.ts +59 -0
  78. package/types/resources/TaxWithheld.d.ts +19 -0
  79. package/types/resources/ThirdPartyPaymentMethod.d.ts +11 -0
  80. package/types/resources/TimeMachine.d.ts +57 -0
  81. package/types/resources/Token.d.ts +19 -0
  82. package/types/resources/Transaction.d.ts +316 -0
  83. package/types/resources/UnbilledCharge.d.ts +209 -0
  84. package/types/resources/Usage.d.ts +113 -0
  85. package/types/resources/VirtualBankAccount.d.ts +125 -0
  86. package/types/resources/filter.d.ts +52 -0
@@ -0,0 +1,332 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface ItemPrice {
6
+ [key: string]: unknown;
7
+ id: string;
8
+ name: string;
9
+ item_family_id?: string;
10
+ item_id?: string;
11
+ description?: string;
12
+ status?: 'active' | 'archived' | 'deleted';
13
+ external_name?: string;
14
+ price_variant_id?: string;
15
+ proration_type?: 'site_default' | 'partial_term' | 'full_term';
16
+ pricing_model: PricingModelEnum;
17
+ price?: number;
18
+ price_in_decimal?: string;
19
+ period?: number;
20
+ currency_code: string;
21
+ period_unit?: 'day' | 'week' | 'month' | 'year';
22
+ trial_period?: number;
23
+ trial_period_unit?: 'day' | 'month';
24
+ trial_end_action?:
25
+ | 'site_default'
26
+ | 'activate_subscription'
27
+ | 'cancel_subscription';
28
+ shipping_period?: number;
29
+ shipping_period_unit?: 'day' | 'week' | 'month' | 'year';
30
+ billing_cycles?: number;
31
+ free_quantity: number;
32
+ free_quantity_in_decimal?: string;
33
+ channel?: ChannelEnum;
34
+ resource_version?: number;
35
+ updated_at?: number;
36
+ created_at: number;
37
+ usage_accumulation_reset_frequency?: UsageAccumulationResetFrequencyEnum;
38
+ archived_at?: number;
39
+ invoice_notes?: string;
40
+ tiers?: ItemPrice.Tier[];
41
+ is_taxable?: boolean;
42
+ tax_detail?: ItemPrice.TaxDetail;
43
+ tax_providers_fields?: ItemPrice.TaxProvidersField[];
44
+ accounting_detail?: ItemPrice.AccountingDetail;
45
+ metadata?: any;
46
+ item_type?: ItemTypeEnum;
47
+ archivable?: boolean;
48
+ parent_item_id?: string;
49
+ show_description_in_invoices?: boolean;
50
+ show_description_in_quotes?: boolean;
51
+ business_entity_id?: string;
52
+ }
53
+
54
+ export namespace ItemPrice {
55
+ export class ItemPriceResource {
56
+ create(
57
+ input: CreateInputParam,
58
+ headers?: ChargebeeRequestHeader,
59
+ ): Promise<ChargebeeResponse<CreateResponse>>;
60
+
61
+ retrieve(
62
+ item_price_id: string,
63
+ headers?: ChargebeeRequestHeader,
64
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
65
+
66
+ update(
67
+ item_price_id: string,
68
+ input: UpdateInputParam,
69
+ headers?: ChargebeeRequestHeader,
70
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
71
+
72
+ list(
73
+ input?: ListInputParam,
74
+ headers?: ChargebeeRequestHeader,
75
+ ): Promise<ChargebeeResponse<ListResponse>>;
76
+
77
+ delete(
78
+ item_price_id: string,
79
+ headers?: ChargebeeRequestHeader,
80
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
81
+
82
+ findApplicableItems(
83
+ item_price_id: string,
84
+ input?: FindApplicableItemsInputParam,
85
+ headers?: ChargebeeRequestHeader,
86
+ ): Promise<ChargebeeResponse<FindApplicableItemsResponse>>;
87
+
88
+ findApplicableItemPrices(
89
+ item_price_id: string,
90
+ input?: FindApplicableItemPricesInputParam,
91
+ headers?: ChargebeeRequestHeader,
92
+ ): Promise<ChargebeeResponse<FindApplicableItemPricesResponse>>;
93
+ }
94
+
95
+ export interface CreateResponse {
96
+ item_price: ItemPrice;
97
+ }
98
+
99
+ export interface RetrieveResponse {
100
+ item_price: ItemPrice;
101
+ }
102
+
103
+ export interface UpdateResponse {
104
+ item_price: ItemPrice;
105
+ }
106
+
107
+ export interface ListResponse {
108
+ list: { item_price: ItemPrice }[];
109
+ next_offset?: string;
110
+ }
111
+
112
+ export interface DeleteResponse {
113
+ item_price: ItemPrice;
114
+ }
115
+
116
+ export interface FindApplicableItemsResponse {
117
+ list: { item: Item }[];
118
+ next_offset?: string;
119
+ }
120
+
121
+ export interface FindApplicableItemPricesResponse {
122
+ list: { item_price: ItemPrice }[];
123
+ next_offset?: string;
124
+ }
125
+
126
+ export interface Tier {
127
+ starting_unit: number;
128
+ ending_unit?: number;
129
+ price: number;
130
+ starting_unit_in_decimal?: string;
131
+ ending_unit_in_decimal?: string;
132
+ price_in_decimal?: string;
133
+ }
134
+ export interface TaxDetail {
135
+ tax_profile_id?: string;
136
+ avalara_sale_type?: AvalaraSaleTypeEnum;
137
+ avalara_transaction_type?: number;
138
+ avalara_service_type?: number;
139
+ avalara_tax_code?: string;
140
+ hsn_code?: string;
141
+ taxjar_product_code?: string;
142
+ }
143
+ export interface TaxProvidersField {
144
+ provider_name: string;
145
+ field_id: string;
146
+ field_value: string;
147
+ }
148
+ export interface AccountingDetail {
149
+ sku?: string;
150
+ accounting_code?: string;
151
+ accounting_category1?: string;
152
+ accounting_category2?: string;
153
+ accounting_category3?: string;
154
+ accounting_category4?: string;
155
+ }
156
+ // REQUEST PARAMS
157
+ //---------------
158
+
159
+ export interface CreateInputParam {
160
+ id: string;
161
+ name: string;
162
+ description?: string;
163
+ item_id: string;
164
+ invoice_notes?: string;
165
+ proration_type?: 'site_default' | 'partial_term' | 'full_term';
166
+ external_name?: string;
167
+ currency_code?: string;
168
+ price_variant_id?: string;
169
+ is_taxable?: boolean;
170
+ free_quantity?: number;
171
+ free_quantity_in_decimal?: string;
172
+ metadata?: any;
173
+ show_description_in_invoices?: boolean;
174
+ show_description_in_quotes?: boolean;
175
+ usage_accumulation_reset_frequency?: UsageAccumulationResetFrequencyEnum;
176
+ business_entity_id?: string;
177
+ pricing_model?: PricingModelEnum;
178
+ price?: number;
179
+ price_in_decimal?: string;
180
+ period_unit?: 'day' | 'week' | 'month' | 'year';
181
+ period?: number;
182
+ trial_period_unit?: 'day' | 'month';
183
+ trial_period?: number;
184
+ shipping_period?: number;
185
+ shipping_period_unit?: 'day' | 'week' | 'month' | 'year';
186
+ billing_cycles?: number;
187
+ trial_end_action?:
188
+ | 'site_default'
189
+ | 'activate_subscription'
190
+ | 'cancel_subscription';
191
+ tax_detail?: TaxDetailCreateInputParam;
192
+ accounting_detail?: AccountingDetailCreateInputParam;
193
+ tiers?: TiersCreateInputParam[];
194
+ tax_providers_fields?: TaxProvidersFieldsCreateInputParam[];
195
+ [key: `cf_${string}`]: unknown;
196
+ }
197
+ export interface UpdateInputParam {
198
+ name?: string;
199
+ description?: string;
200
+ proration_type?: 'site_default' | 'partial_term' | 'full_term';
201
+ price_variant_id?: string;
202
+ status?: 'active' | 'archived';
203
+ external_name?: string;
204
+ usage_accumulation_reset_frequency?: UsageAccumulationResetFrequencyEnum;
205
+ currency_code?: string;
206
+ invoice_notes?: string;
207
+ is_taxable?: boolean;
208
+ free_quantity?: number;
209
+ free_quantity_in_decimal?: string;
210
+ metadata?: any;
211
+ pricing_model?: PricingModelEnum;
212
+ price?: number;
213
+ price_in_decimal?: string;
214
+ period_unit?: 'day' | 'week' | 'month' | 'year';
215
+ period?: number;
216
+ trial_period_unit?: 'day' | 'month';
217
+ trial_period?: number;
218
+ shipping_period?: number;
219
+ shipping_period_unit?: 'day' | 'week' | 'month' | 'year';
220
+ billing_cycles?: number;
221
+ trial_end_action?:
222
+ | 'site_default'
223
+ | 'activate_subscription'
224
+ | 'cancel_subscription';
225
+ show_description_in_invoices?: boolean;
226
+ show_description_in_quotes?: boolean;
227
+ tax_detail?: TaxDetailUpdateInputParam;
228
+ accounting_detail?: AccountingDetailUpdateInputParam;
229
+ tiers?: TiersUpdateInputParam[];
230
+ tax_providers_fields?: TaxProvidersFieldsUpdateInputParam[];
231
+ [key: `cf_${string}`]: unknown;
232
+ }
233
+ export interface ListInputParam {
234
+ limit?: number;
235
+ offset?: string;
236
+ id?: filter.String;
237
+ name?: filter.String;
238
+ pricing_model?: filter.Enum;
239
+ item_id?: filter.String;
240
+ item_family_id?: filter.String;
241
+ item_type?: filter.Enum;
242
+ currency_code?: filter.String;
243
+ price_variant_id?: filter.String;
244
+ trial_period?: filter.Number;
245
+ trial_period_unit?: filter.Enum;
246
+ status?: filter.Enum;
247
+ updated_at?: filter.Timestamp;
248
+ business_entity_id?: filter.String;
249
+ include_site_level_resources?: filter.Boolean;
250
+ period_unit?: filter.Enum;
251
+ period?: filter.Number;
252
+ channel?: filter.Enum;
253
+ 'sort_by[asc]'?: string;
254
+ 'sort_by[desc]'?: string;
255
+ }
256
+ export interface FindApplicableItemsInputParam {
257
+ limit?: number;
258
+ offset?: string;
259
+ 'sort_by[asc]'?: string;
260
+ 'sort_by[desc]'?: string;
261
+ }
262
+ export interface FindApplicableItemPricesInputParam {
263
+ limit?: number;
264
+ offset?: string;
265
+ item_id?: string;
266
+ 'sort_by[asc]'?: string;
267
+ 'sort_by[desc]'?: string;
268
+ }
269
+ export interface TaxDetailCreateInputParam {
270
+ tax_profile_id?: string;
271
+ avalara_tax_code?: string;
272
+ hsn_code?: string;
273
+ avalara_sale_type?: AvalaraSaleTypeEnum;
274
+ avalara_transaction_type?: number;
275
+ avalara_service_type?: number;
276
+ taxjar_product_code?: string;
277
+ }
278
+ export interface AccountingDetailCreateInputParam {
279
+ sku?: string;
280
+ accounting_code?: string;
281
+ accounting_category1?: string;
282
+ accounting_category2?: string;
283
+ accounting_category3?: string;
284
+ accounting_category4?: string;
285
+ }
286
+
287
+ export interface TiersCreateInputParam {
288
+ starting_unit?: number;
289
+ ending_unit?: number;
290
+ price?: number;
291
+ starting_unit_in_decimal?: string;
292
+ ending_unit_in_decimal?: string;
293
+ price_in_decimal?: string;
294
+ }
295
+ export interface TaxProvidersFieldsCreateInputParam {
296
+ provider_name: string;
297
+ field_id: string;
298
+ field_value: string;
299
+ }
300
+ export interface TaxDetailUpdateInputParam {
301
+ tax_profile_id?: string;
302
+ avalara_tax_code?: string;
303
+ hsn_code?: string;
304
+ avalara_sale_type?: AvalaraSaleTypeEnum;
305
+ avalara_transaction_type?: number;
306
+ avalara_service_type?: number;
307
+ taxjar_product_code?: string;
308
+ }
309
+ export interface AccountingDetailUpdateInputParam {
310
+ sku?: string;
311
+ accounting_code?: string;
312
+ accounting_category1?: string;
313
+ accounting_category2?: string;
314
+ accounting_category3?: string;
315
+ accounting_category4?: string;
316
+ }
317
+
318
+ export interface TiersUpdateInputParam {
319
+ starting_unit?: number;
320
+ ending_unit?: number;
321
+ price?: number;
322
+ starting_unit_in_decimal?: string;
323
+ ending_unit_in_decimal?: string;
324
+ price_in_decimal?: string;
325
+ }
326
+ export interface TaxProvidersFieldsUpdateInputParam {
327
+ provider_name: string;
328
+ field_id: string;
329
+ field_value: string;
330
+ }
331
+ }
332
+ }
@@ -0,0 +1,8 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface Metadata {
6
+ change_type?: string;
7
+ }
8
+ }
@@ -0,0 +1,48 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface NonSubscription {
6
+ app_id: string;
7
+ invoice_id: string;
8
+ customer_id?: string;
9
+ charge_id: string;
10
+ }
11
+
12
+ export namespace NonSubscription {
13
+ export class NonSubscriptionResource {
14
+ processReceipt(
15
+ non_subscription_app_id: string,
16
+ input: ProcessReceiptInputParam,
17
+ headers?: ChargebeeRequestHeader,
18
+ ): Promise<ChargebeeResponse<ProcessReceiptResponse>>;
19
+ }
20
+
21
+ export interface ProcessReceiptResponse {
22
+ non_subscription: NonSubscription;
23
+ }
24
+
25
+ // REQUEST PARAMS
26
+ //---------------
27
+
28
+ export interface ProcessReceiptInputParam {
29
+ receipt: string;
30
+ product?: ProductProcessReceiptInputParam;
31
+ customer?: CustomerProcessReceiptInputParam;
32
+ }
33
+ export interface CustomerProcessReceiptInputParam {
34
+ id?: string;
35
+ email?: string;
36
+ first_name?: string;
37
+ last_name?: string;
38
+ }
39
+ export interface ProductProcessReceiptInputParam {
40
+ id: string;
41
+ currency_code: string;
42
+ price: number;
43
+ type: 'consumable' | 'non_consumable' | 'non_renewing_subscription';
44
+ name?: string;
45
+ price_in_decimal?: string;
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,75 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface OmnichannelSubscription {
6
+ id: string;
7
+ id_at_source: string;
8
+ app_id: string;
9
+ source: 'apple_app_store';
10
+ customer_id?: string;
11
+ created_at: number;
12
+ omnichannel_subscription_items: OmnichannelSubscription.OmnichannelSubscriptionItem[];
13
+ }
14
+
15
+ export namespace OmnichannelSubscription {
16
+ export class OmnichannelSubscriptionResource {
17
+ retrieve(
18
+ omnichannel_subscription_id: string,
19
+ headers?: ChargebeeRequestHeader,
20
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
21
+
22
+ list(
23
+ input?: ListInputParam,
24
+ headers?: ChargebeeRequestHeader,
25
+ ): Promise<ChargebeeResponse<ListResponse>>;
26
+
27
+ omnichannelTransactionsForOmnichannelSubscription(
28
+ omnichannel_subscription_id: string,
29
+ input?: OmnichannelTransactionsForOmnichannelSubscriptionInputParam,
30
+ headers?: ChargebeeRequestHeader,
31
+ ): Promise<
32
+ ChargebeeResponse<OmnichannelTransactionsForOmnichannelSubscriptionResponse>
33
+ >;
34
+ }
35
+
36
+ export interface RetrieveResponse {
37
+ omnichannel_subscription: OmnichannelSubscription;
38
+ }
39
+
40
+ export interface ListResponse {
41
+ list: { omnichannel_subscription: OmnichannelSubscription }[];
42
+ next_offset?: string;
43
+ }
44
+
45
+ export interface OmnichannelTransactionsForOmnichannelSubscriptionResponse {
46
+ list: { omnichannel_transaction: OmnichannelTransaction }[];
47
+ next_offset?: string;
48
+ }
49
+
50
+ export interface OmnichannelSubscriptionItem {
51
+ id: string;
52
+ id_at_source: string;
53
+ status: 'active' | 'expired' | 'cancelled';
54
+ current_term_start?: number;
55
+ current_term_end?: number;
56
+ expired_at?: number;
57
+ expiration_reason?: 'billing_error' | 'product_not_available' | 'other';
58
+ cancelled_at?: number;
59
+ cancellation_reason?:
60
+ | 'customer_cancelled'
61
+ | 'customer_did_not_consent_to_price_increase';
62
+ }
63
+ // REQUEST PARAMS
64
+ //---------------
65
+
66
+ export interface ListInputParam {
67
+ limit?: number;
68
+ offset?: string;
69
+ }
70
+ export interface OmnichannelTransactionsForOmnichannelSubscriptionInputParam {
71
+ limit?: number;
72
+ offset?: string;
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,16 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface OmnichannelTransaction {
6
+ id: string;
7
+ id_at_source: string;
8
+ app_id: string;
9
+ price_currency: string;
10
+ price_units: number;
11
+ price_nanos: number;
12
+ type: 'purchase' | 'renewal';
13
+ transacted_at: number;
14
+ created_at: number;
15
+ }
16
+ }