chargebee 3.0.0-beta.4 → 3.0.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 (84) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +4 -3
  3. package/cjs/environment.js +1 -1
  4. package/cjs/util.js +1 -1
  5. package/esm/environment.js +1 -1
  6. package/esm/util.js +1 -1
  7. package/package.json +1 -1
  8. package/types/core.d.ts +0 -564
  9. package/types/index.d.ts +0 -167
  10. package/types/resources/Address.d.ts +0 -71
  11. package/types/resources/AdvanceInvoiceSchedule.d.ts +0 -29
  12. package/types/resources/AttachedItem.d.ts +0 -114
  13. package/types/resources/Attribute.d.ts +0 -9
  14. package/types/resources/BusinessEntity.d.ts +0 -64
  15. package/types/resources/BusinessEntityTransfer.d.ts +0 -15
  16. package/types/resources/Card.d.ts +0 -171
  17. package/types/resources/Comment.d.ts +0 -89
  18. package/types/resources/Contact.d.ts +0 -16
  19. package/types/resources/ContractTerm.d.ts +0 -19
  20. package/types/resources/Coupon.d.ts +0 -314
  21. package/types/resources/CouponCode.d.ts +0 -70
  22. package/types/resources/CouponSet.d.ts +0 -111
  23. package/types/resources/CreditNote.d.ts +0 -628
  24. package/types/resources/CreditNoteEstimate.d.ts +0 -143
  25. package/types/resources/Currency.d.ts +0 -91
  26. package/types/resources/Customer.d.ts +0 -962
  27. package/types/resources/CustomerEntitlement.d.ts +0 -36
  28. package/types/resources/DifferentialPrice.d.ts +0 -142
  29. package/types/resources/Discount.d.ts +0 -24
  30. package/types/resources/Download.d.ts +0 -10
  31. package/types/resources/Entitlement.d.ts +0 -66
  32. package/types/resources/EntitlementOverride.d.ts +0 -76
  33. package/types/resources/Estimate.d.ts +0 -1237
  34. package/types/resources/Event.d.ts +0 -81
  35. package/types/resources/Export.d.ts +0 -607
  36. package/types/resources/Feature.d.ts +0 -142
  37. package/types/resources/GatewayErrorDetail.d.ts +0 -20
  38. package/types/resources/Gift.d.ts +0 -296
  39. package/types/resources/Hierarchy.d.ts +0 -12
  40. package/types/resources/HostedPage.d.ts +0 -1112
  41. package/types/resources/ImpactedItem.d.ts +0 -20
  42. package/types/resources/ImpactedItemPrice.d.ts +0 -20
  43. package/types/resources/ImpactedSubscription.d.ts +0 -20
  44. package/types/resources/InAppSubscription.d.ts +0 -116
  45. package/types/resources/Invoice.d.ts +0 -1691
  46. package/types/resources/InvoiceEstimate.d.ts +0 -143
  47. package/types/resources/Item.d.ts +0 -204
  48. package/types/resources/ItemEntitlement.d.ts +0 -103
  49. package/types/resources/ItemFamily.d.ts +0 -89
  50. package/types/resources/ItemPrice.d.ts +0 -328
  51. package/types/resources/Metadata.d.ts +0 -8
  52. package/types/resources/NonSubscription.d.ts +0 -48
  53. package/types/resources/Order.d.ts +0 -586
  54. package/types/resources/PaymentIntent.d.ts +0 -178
  55. package/types/resources/PaymentReferenceNumber.d.ts +0 -11
  56. package/types/resources/PaymentSchedule.d.ts +0 -28
  57. package/types/resources/PaymentScheduleEstimate.d.ts +0 -25
  58. package/types/resources/PaymentScheduleScheme.d.ts +0 -62
  59. package/types/resources/PaymentSource.d.ts +0 -529
  60. package/types/resources/PaymentVoucher.d.ts +0 -107
  61. package/types/resources/PortalSession.d.ts +0 -88
  62. package/types/resources/PriceVariant.d.ts +0 -112
  63. package/types/resources/PricingPageSession.d.ts +0 -130
  64. package/types/resources/PromotionalCredit.d.ts +0 -111
  65. package/types/resources/Purchase.d.ts +0 -202
  66. package/types/resources/Quote.d.ts +0 -1467
  67. package/types/resources/QuoteLineGroup.d.ts +0 -136
  68. package/types/resources/QuotedCharge.d.ts +0 -56
  69. package/types/resources/QuotedSubscription.d.ts +0 -114
  70. package/types/resources/Ramp.d.ts +0 -260
  71. package/types/resources/ResourceMigration.d.ts +0 -36
  72. package/types/resources/SiteMigrationDetail.d.ts +0 -46
  73. package/types/resources/Subscription.d.ts +0 -2443
  74. package/types/resources/SubscriptionEntitlement.d.ts +0 -79
  75. package/types/resources/SubscriptionEstimate.d.ts +0 -59
  76. package/types/resources/TaxWithheld.d.ts +0 -19
  77. package/types/resources/ThirdPartyPaymentMethod.d.ts +0 -11
  78. package/types/resources/TimeMachine.d.ts +0 -57
  79. package/types/resources/Token.d.ts +0 -19
  80. package/types/resources/Transaction.d.ts +0 -313
  81. package/types/resources/UnbilledCharge.d.ts +0 -209
  82. package/types/resources/Usage.d.ts +0 -113
  83. package/types/resources/VirtualBankAccount.d.ts +0 -125
  84. package/types/resources/filter.d.ts +0 -52
@@ -1,143 +0,0 @@
1
- ///<reference path='./../core.d.ts'/>
2
- ///<reference path='./../index.d.ts'/>
3
-
4
- declare module 'chargebee' {
5
- export interface InvoiceEstimate {
6
- recurring: boolean;
7
- price_type: PriceType;
8
- currency_code: string;
9
- sub_total: number;
10
- total?: number;
11
- credits_applied?: number;
12
- amount_paid?: number;
13
- amount_due?: number;
14
- line_items?: InvoiceEstimate.LineItem[];
15
- discounts?: InvoiceEstimate.Discount[];
16
- taxes?: InvoiceEstimate.Tax[];
17
- line_item_taxes?: InvoiceEstimate.LineItemTax[];
18
- line_item_tiers?: InvoiceEstimate.LineItemTier[];
19
- line_item_discounts?: InvoiceEstimate.LineItemDiscount[];
20
- round_off_amount?: number;
21
- customer_id?: string;
22
- }
23
-
24
- export namespace InvoiceEstimate {
25
- export interface LineItem {
26
- id?: string;
27
- subscription_id?: string;
28
- date_from: number;
29
- date_to: number;
30
- unit_amount: number;
31
- quantity?: number;
32
- amount?: number;
33
- pricing_model?:
34
- | 'flat_fee'
35
- | 'per_unit'
36
- | 'tiered'
37
- | 'volume'
38
- | 'stairstep';
39
- is_taxed: boolean;
40
- tax_amount?: number;
41
- tax_rate?: number;
42
- unit_amount_in_decimal?: string;
43
- quantity_in_decimal?: string;
44
- amount_in_decimal?: string;
45
- discount_amount?: number;
46
- item_level_discount_amount?: number;
47
- usage_percentage?: string;
48
- reference_line_item_id?: string;
49
- description: string;
50
- entity_description?: string;
51
- entity_type:
52
- | 'adhoc'
53
- | 'plan_item_price'
54
- | 'addon_item_price'
55
- | 'charge_item_price'
56
- | 'plan_setup'
57
- | 'plan'
58
- | 'addon';
59
- tax_exempt_reason?:
60
- | 'tax_not_configured'
61
- | 'region_non_taxable'
62
- | 'export'
63
- | 'customer_exempt'
64
- | 'product_exempt'
65
- | 'zero_rated'
66
- | 'reverse_charge'
67
- | 'high_value_physical_goods'
68
- | 'zero_value_item'
69
- | 'tax_not_configured_external_provider';
70
- entity_id?: string;
71
- customer_id?: string;
72
- }
73
- export interface Discount {
74
- amount: number;
75
- description?: string;
76
- entity_type:
77
- | 'item_level_coupon'
78
- | 'document_level_coupon'
79
- | 'promotional_credits'
80
- | 'prorated_credits'
81
- | 'item_level_discount'
82
- | 'document_level_discount';
83
- entity_id?: string;
84
- coupon_set_code?: string;
85
- }
86
- export interface Tax {
87
- name: string;
88
- amount: number;
89
- description?: string;
90
- }
91
- export interface LineItemTax {
92
- line_item_id?: string;
93
- tax_name: string;
94
- tax_rate: number;
95
- date_to?: number;
96
- date_from?: number;
97
- prorated_taxable_amount?: number;
98
- is_partial_tax_applied?: boolean;
99
- is_non_compliance_tax?: boolean;
100
- taxable_amount: number;
101
- tax_amount: number;
102
- tax_juris_type?:
103
- | 'country'
104
- | 'federal'
105
- | 'state'
106
- | 'county'
107
- | 'city'
108
- | 'special'
109
- | 'unincorporated'
110
- | 'other';
111
- tax_juris_name?: string;
112
- tax_juris_code?: string;
113
- tax_amount_in_local_currency?: number;
114
- local_currency_code?: string;
115
- }
116
- export interface LineItemTier {
117
- line_item_id?: string;
118
- starting_unit: number;
119
- ending_unit?: number;
120
- quantity_used: number;
121
- unit_amount: number;
122
- starting_unit_in_decimal?: string;
123
- ending_unit_in_decimal?: string;
124
- quantity_used_in_decimal?: string;
125
- unit_amount_in_decimal?: string;
126
- }
127
- export interface LineItemDiscount {
128
- line_item_id: string;
129
- discount_type:
130
- | 'item_level_coupon'
131
- | 'document_level_coupon'
132
- | 'promotional_credits'
133
- | 'prorated_credits'
134
- | 'item_level_discount'
135
- | 'document_level_discount';
136
- coupon_id?: string;
137
- entity_id?: string;
138
- discount_amount: number;
139
- }
140
- // REQUEST PARAMS
141
- //---------------
142
- }
143
- }
@@ -1,204 +0,0 @@
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 Item {
6
- [key: string]: unknown;
7
- id: string;
8
- name: string;
9
- external_name?: string;
10
- description?: string;
11
- status?: 'active' | 'archived' | 'deleted';
12
- resource_version?: number;
13
- updated_at?: number;
14
- item_family_id?: string;
15
- type: 'plan' | 'addon' | 'charge';
16
- is_shippable?: boolean;
17
- is_giftable: boolean;
18
- redirect_url?: string;
19
- enabled_for_checkout: boolean;
20
- enabled_in_portal: boolean;
21
- included_in_mrr?: boolean;
22
- item_applicability: 'all' | 'restricted';
23
- gift_claim_redirect_url?: string;
24
- unit?: string;
25
- metered: boolean;
26
- usage_calculation?: 'sum_of_usages' | 'last_usage' | 'max_usage';
27
- archived_at?: number;
28
- channel?: Channel;
29
- applicable_items?: Item.ApplicableItem[];
30
- bundle_items?: Item.BundleItem[];
31
- bundle_configuration?: Item.BundleConfiguration;
32
- metadata?: any;
33
- }
34
-
35
- export namespace Item {
36
- export class ItemResource {
37
- create(
38
- input: CreateInputParam,
39
- headers?: ChargebeeRequestHeader,
40
- ): Promise<ChargebeeResponse<CreateResponse>>;
41
-
42
- retrieve(
43
- item_id: string,
44
- headers?: ChargebeeRequestHeader,
45
- ): Promise<ChargebeeResponse<RetrieveResponse>>;
46
-
47
- update(
48
- item_id: string,
49
- input?: UpdateInputParam,
50
- headers?: ChargebeeRequestHeader,
51
- ): Promise<ChargebeeResponse<UpdateResponse>>;
52
-
53
- list(
54
- input?: ListInputParam,
55
- headers?: ChargebeeRequestHeader,
56
- ): Promise<ChargebeeResponse<ListResponse>>;
57
-
58
- delete(
59
- item_id: string,
60
- headers?: ChargebeeRequestHeader,
61
- ): Promise<ChargebeeResponse<DeleteResponse>>;
62
- }
63
-
64
- export interface CreateResponse {
65
- item: Item;
66
- }
67
-
68
- export interface RetrieveResponse {
69
- item: Item;
70
- }
71
-
72
- export interface UpdateResponse {
73
- item: Item;
74
- }
75
-
76
- export interface ListResponse {
77
- list: { item: Item }[];
78
- next_offset?: string;
79
- }
80
-
81
- export interface DeleteResponse {
82
- item: Item;
83
- }
84
-
85
- export interface ApplicableItem {
86
- id?: string;
87
- }
88
- export interface BundleItem {
89
- item_id: string;
90
- item_type?: 'plan' | 'addon' | 'charge';
91
- quantity?: number;
92
- price_allocation?: number;
93
- }
94
- export interface BundleConfiguration {
95
- type?: 'fixed';
96
- }
97
- // REQUEST PARAMS
98
- //---------------
99
-
100
- export interface CreateInputParam {
101
- id: string;
102
- name: string;
103
- type: 'plan' | 'addon' | 'charge';
104
- description?: string;
105
- item_family_id: string;
106
- is_giftable?: boolean;
107
- is_shippable?: boolean;
108
- external_name?: string;
109
- enabled_in_portal?: boolean;
110
- redirect_url?: string;
111
- enabled_for_checkout?: boolean;
112
- item_applicability?: 'all' | 'restricted';
113
- applicable_items?: string[];
114
- unit?: string;
115
- gift_claim_redirect_url?: string;
116
- included_in_mrr?: boolean;
117
- metered?: boolean;
118
- usage_calculation?: 'sum_of_usages' | 'last_usage' | 'max_usage';
119
- metadata?: any;
120
- bundle_configuration?: BundleConfigurationCreateInputParam;
121
- bundle_items_to_add?: BundleItemsToAddCreateInputParam[];
122
- [key: `cf_${string}`]: unknown;
123
- }
124
- export interface UpdateInputParam {
125
- name?: string;
126
- description?: string;
127
- is_shippable?: boolean;
128
- external_name?: string;
129
- item_family_id?: string;
130
- enabled_in_portal?: boolean;
131
- redirect_url?: string;
132
- enabled_for_checkout?: boolean;
133
- item_applicability?: 'all' | 'restricted' /**
134
- * @deprecated Please refer API docs to use other attributes
135
- */;
136
-
137
- clear_applicable_items?: boolean;
138
- applicable_items?: string[];
139
- unit?: string;
140
- gift_claim_redirect_url?: string;
141
- metadata?: any;
142
- included_in_mrr?: boolean;
143
- status?: 'active' | 'archived';
144
- bundle_configuration?: BundleConfigurationUpdateInputParam;
145
- bundle_items_to_add?: BundleItemsToAddUpdateInputParam[];
146
- bundle_items_to_update?: BundleItemsToUpdateUpdateInputParam[];
147
- bundle_items_to_remove?: BundleItemsToRemoveUpdateInputParam[];
148
- [key: `cf_${string}`]: unknown;
149
- }
150
- export interface ListInputParam {
151
- limit?: number;
152
- offset?: string;
153
- bundle_configuration?: BundleConfigurationItemListInputParam;
154
- id?: filter.String;
155
- item_family_id?: filter.String;
156
- type?: filter.Enum;
157
- name?: filter.String;
158
- item_applicability?: filter.Enum;
159
- status?: filter.Enum;
160
- is_giftable?: filter.Boolean;
161
- updated_at?: filter.Timestamp;
162
- enabled_for_checkout?: filter.Boolean;
163
- enabled_in_portal?: filter.Boolean;
164
- metered?: filter.Boolean;
165
- usage_calculation?: filter.Enum;
166
- channel?: filter.Enum;
167
- 'sort_by[asc]'?: string;
168
- 'sort_by[desc]'?: string;
169
- }
170
- export interface BundleConfigurationCreateInputParam {
171
- type?: 'fixed';
172
- }
173
-
174
- export interface BundleItemsToAddCreateInputParam {
175
- item_id?: string;
176
- item_type?: ItemType;
177
- quantity?: number;
178
- price_allocation?: number;
179
- }
180
- export interface BundleConfigurationUpdateInputParam {
181
- type?: 'fixed';
182
- }
183
-
184
- export interface BundleItemsToAddUpdateInputParam {
185
- item_id?: string;
186
- item_type?: ItemType;
187
- quantity?: number;
188
- price_allocation?: number;
189
- }
190
- export interface BundleItemsToUpdateUpdateInputParam {
191
- item_id?: string;
192
- item_type?: ItemType;
193
- quantity?: number;
194
- price_allocation?: number;
195
- }
196
- export interface BundleItemsToRemoveUpdateInputParam {
197
- item_id?: string;
198
- item_type?: ItemType;
199
- }
200
- export interface BundleConfigurationItemListInputParam {
201
- type?: filter.Enum;
202
- }
203
- }
204
- }
@@ -1,103 +0,0 @@
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 ItemEntitlement {
6
- id: string;
7
- item_id?: string;
8
- item_type?: 'plan' | 'addon' | 'charge' | 'subscription' | 'item';
9
- feature_id?: string;
10
- feature_name?: string;
11
- value?: string;
12
- name?: string;
13
- }
14
-
15
- export namespace ItemEntitlement {
16
- export class ItemEntitlementResource {
17
- itemEntitlementsForItem(
18
- item_id: string,
19
- input?: ItemEntitlementsForItemInputParam,
20
- headers?: ChargebeeRequestHeader,
21
- ): Promise<ChargebeeResponse<ItemEntitlementsForItemResponse>>;
22
-
23
- itemEntitlementsForFeature(
24
- feature_id: string,
25
- input?: ItemEntitlementsForFeatureInputParam,
26
- headers?: ChargebeeRequestHeader,
27
- ): Promise<ChargebeeResponse<ItemEntitlementsForFeatureResponse>>;
28
-
29
- addItemEntitlements(
30
- feature_id: string,
31
- input: AddItemEntitlementsInputParam,
32
- headers?: ChargebeeRequestHeader,
33
- ): Promise<ChargebeeResponse<AddItemEntitlementsResponse>>;
34
-
35
- upsertOrRemoveItemEntitlementsForItem(
36
- item_id: string,
37
- input: UpsertOrRemoveItemEntitlementsForItemInputParam,
38
- headers?: ChargebeeRequestHeader,
39
- ): Promise<
40
- ChargebeeResponse<UpsertOrRemoveItemEntitlementsForItemResponse>
41
- >;
42
- }
43
-
44
- export interface ItemEntitlementsForItemResponse {
45
- list: { item_entitlement: ItemEntitlement }[];
46
- next_offset?: string;
47
- }
48
-
49
- export interface ItemEntitlementsForFeatureResponse {
50
- list: { item_entitlement: ItemEntitlement }[];
51
- next_offset?: string;
52
- }
53
-
54
- export interface AddItemEntitlementsResponse {
55
- item_entitlement: ItemEntitlement;
56
- }
57
-
58
- export interface UpsertOrRemoveItemEntitlementsForItemResponse {
59
- item_entitlement: ItemEntitlement;
60
- }
61
-
62
- // REQUEST PARAMS
63
- //---------------
64
-
65
- export interface ItemEntitlementsForItemInputParam {
66
- limit?: number;
67
- offset?: string /**
68
- * @deprecated Please refer API docs to use other attributes
69
- */;
70
-
71
- include_drafts?: boolean /**
72
- * @deprecated Please refer API docs to use other attributes
73
- */;
74
-
75
- embed?: string;
76
- }
77
- export interface ItemEntitlementsForFeatureInputParam {
78
- limit?: number;
79
- offset?: string /**
80
- * @deprecated Please refer API docs to use other attributes
81
- */;
82
-
83
- include_drafts?: boolean;
84
- }
85
- export interface AddItemEntitlementsInputParam {
86
- action: Action;
87
- item_entitlements?: ItemEntitlementsAddItemEntitlementsInputParam[];
88
- }
89
- export interface UpsertOrRemoveItemEntitlementsForItemInputParam {
90
- action: Action;
91
- item_entitlements?: ItemEntitlementsUpsertOrRemoveItemEntitlementsForItemInputParam[];
92
- }
93
- export interface ItemEntitlementsAddItemEntitlementsInputParam {
94
- item_id: string;
95
- item_type?: 'plan' | 'addon' | 'charge' | 'subscription' | 'item';
96
- value?: string;
97
- }
98
- export interface ItemEntitlementsUpsertOrRemoveItemEntitlementsForItemInputParam {
99
- feature_id: string;
100
- value?: string;
101
- }
102
- }
103
- }
@@ -1,89 +0,0 @@
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 ItemFamily {
6
- [key: string]: unknown;
7
- id: string;
8
- name: string;
9
- description?: string;
10
- status?: 'active' | 'deleted';
11
- resource_version?: number;
12
- updated_at?: number;
13
- channel?: Channel;
14
- }
15
-
16
- export namespace ItemFamily {
17
- export class ItemFamilyResource {
18
- create(
19
- input: CreateInputParam,
20
- headers?: ChargebeeRequestHeader,
21
- ): Promise<ChargebeeResponse<CreateResponse>>;
22
-
23
- retrieve(
24
- item_family_id: string,
25
- headers?: ChargebeeRequestHeader,
26
- ): Promise<ChargebeeResponse<RetrieveResponse>>;
27
-
28
- list(
29
- input?: ListInputParam,
30
- headers?: ChargebeeRequestHeader,
31
- ): Promise<ChargebeeResponse<ListResponse>>;
32
-
33
- update(
34
- item_family_id: string,
35
- input?: UpdateInputParam,
36
- headers?: ChargebeeRequestHeader,
37
- ): Promise<ChargebeeResponse<UpdateResponse>>;
38
-
39
- delete(
40
- item_family_id: string,
41
- headers?: ChargebeeRequestHeader,
42
- ): Promise<ChargebeeResponse<DeleteResponse>>;
43
- }
44
-
45
- export interface CreateResponse {
46
- item_family: ItemFamily;
47
- }
48
-
49
- export interface RetrieveResponse {
50
- item_family: ItemFamily;
51
- }
52
-
53
- export interface ListResponse {
54
- list: { item_family: ItemFamily }[];
55
- next_offset?: string;
56
- }
57
-
58
- export interface UpdateResponse {
59
- item_family: ItemFamily;
60
- }
61
-
62
- export interface DeleteResponse {
63
- item_family: ItemFamily;
64
- }
65
-
66
- // REQUEST PARAMS
67
- //---------------
68
-
69
- export interface CreateInputParam {
70
- id: string;
71
- name: string;
72
- description?: string;
73
- [key: `cf_${string}`]: unknown;
74
- }
75
- export interface ListInputParam {
76
- limit?: number;
77
- offset?: string;
78
- id?: filter.String;
79
- name?: filter.String;
80
- updated_at?: filter.Timestamp;
81
- [key: `cf_${string}`]: unknown;
82
- }
83
- export interface UpdateInputParam {
84
- name?: string;
85
- description?: string;
86
- [key: `cf_${string}`]: unknown;
87
- }
88
- }
89
- }