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,79 +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 SubscriptionEntitlement {
6
- subscription_id: string;
7
- feature_id?: string;
8
- feature_name?: string;
9
- feature_unit?: string;
10
- feature_type?: string;
11
- value?: string;
12
- name?: string;
13
- is_overridden: boolean;
14
- is_enabled: boolean;
15
- effective_from?: number;
16
- schedule_status?: 'activated' | 'scheduled' | 'failed';
17
- expires_at?: number;
18
- components?: SubscriptionEntitlement.Component;
19
- }
20
-
21
- export namespace SubscriptionEntitlement {
22
- export class SubscriptionEntitlementResource {
23
- subscriptionEntitlementsForSubscription(
24
- subscription_id: string,
25
- input?: SubscriptionEntitlementsForSubscriptionInputParam,
26
- headers?: ChargebeeRequestHeader,
27
- ): Promise<
28
- ChargebeeResponse<SubscriptionEntitlementsForSubscriptionResponse>
29
- >;
30
-
31
- setSubscriptionEntitlementAvailability(
32
- subscription_id: string,
33
- input: SetSubscriptionEntitlementAvailabilityInputParam,
34
- headers?: ChargebeeRequestHeader,
35
- ): Promise<
36
- ChargebeeResponse<SetSubscriptionEntitlementAvailabilityResponse>
37
- >;
38
- }
39
-
40
- export interface SubscriptionEntitlementsForSubscriptionResponse {
41
- list: { subscription_entitlement: SubscriptionEntitlement }[];
42
- next_offset?: string;
43
- }
44
-
45
- export interface SetSubscriptionEntitlementAvailabilityResponse {
46
- subscription_entitlement: SubscriptionEntitlement;
47
- }
48
-
49
- export interface Component {
50
- entitlement_overrides?: EntitlementOverride;
51
- }
52
- // REQUEST PARAMS
53
- //---------------
54
-
55
- export interface SubscriptionEntitlementsForSubscriptionInputParam {
56
- limit?: number;
57
- offset?: string /**
58
- * @deprecated Please refer API docs to use other attributes
59
- */;
60
-
61
- include_drafts?: boolean /**
62
- * @deprecated Please refer API docs to use other attributes
63
- */;
64
-
65
- embed?: string /**
66
- * @deprecated Please refer API docs to use other attributes
67
- */;
68
-
69
- include_scheduled_overrides?: boolean;
70
- }
71
- export interface SetSubscriptionEntitlementAvailabilityInputParam {
72
- is_enabled: boolean;
73
- subscription_entitlements?: SubscriptionEntitlementsSetSubscriptionEntitlementAvailabilityInputParam[];
74
- }
75
- export interface SubscriptionEntitlementsSetSubscriptionEntitlementAvailabilityInputParam {
76
- feature_id: string;
77
- }
78
- }
79
- }
@@ -1,59 +0,0 @@
1
- ///<reference path='./../core.d.ts'/>
2
- ///<reference path='./../index.d.ts'/>
3
-
4
- declare module 'chargebee' {
5
- export interface SubscriptionEstimate {
6
- id?: string;
7
- currency_code: string;
8
- status?:
9
- | 'future'
10
- | 'in_trial'
11
- | 'active'
12
- | 'non_renewing'
13
- | 'paused'
14
- | 'cancelled'
15
- | 'transferred';
16
- trial_end_action?: TrialEndAction;
17
- next_billing_at?: number;
18
- pause_date?: number;
19
- resume_date?: number;
20
- shipping_address?: SubscriptionEstimate.ShippingAddress;
21
- contract_term?: SubscriptionEstimate.ContractTerm;
22
- }
23
-
24
- export namespace SubscriptionEstimate {
25
- export interface ShippingAddress {
26
- first_name?: string;
27
- last_name?: string;
28
- email?: string;
29
- company?: string;
30
- phone?: string;
31
- line1?: string;
32
- line2?: string;
33
- line3?: string;
34
- city?: string;
35
- state_code?: string;
36
- state?: string;
37
- country?: string;
38
- zip?: string;
39
- validation_status?: ValidationStatus;
40
- index: number;
41
- }
42
- export interface ContractTerm {
43
- id: string;
44
- status: 'active' | 'completed' | 'cancelled' | 'terminated';
45
- contract_start: number;
46
- contract_end: number;
47
- billing_cycle: number;
48
- action_at_term_end: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
49
- total_contract_value: number;
50
- total_contract_value_before_tax: number;
51
- cancellation_cutoff_period?: number;
52
- created_at: number;
53
- subscription_id: string;
54
- remaining_billing_cycles?: number;
55
- }
56
- // REQUEST PARAMS
57
- //---------------
58
- }
59
- }
@@ -1,19 +0,0 @@
1
- ///<reference path='./../core.d.ts'/>
2
- ///<reference path='./../index.d.ts'/>
3
-
4
- declare module 'chargebee' {
5
- export interface TaxWithheld {
6
- id: string;
7
- user?: string;
8
- reference_number?: string;
9
- description?: string;
10
- type: 'payment' | 'refund';
11
- payment_method: 'cash' | 'check' | 'chargeback' | 'bank_transfer' | 'other';
12
- date?: number;
13
- currency_code: string;
14
- amount?: number;
15
- resource_version?: number;
16
- updated_at?: number;
17
- exchange_rate?: number;
18
- }
19
- }
@@ -1,11 +0,0 @@
1
- ///<reference path='./../core.d.ts'/>
2
- ///<reference path='./../index.d.ts'/>
3
-
4
- declare module 'chargebee' {
5
- export interface ThirdPartyPaymentMethod {
6
- type: Type;
7
- gateway: Gateway;
8
- gateway_account_id?: string;
9
- reference_id: string;
10
- }
11
- }
@@ -1,57 +0,0 @@
1
- ///<reference path='./../core.d.ts'/>
2
- ///<reference path='./../index.d.ts'/>
3
-
4
- declare module 'chargebee' {
5
- export interface TimeMachine {
6
- name: string;
7
- time_travel_status: 'not_enabled' | 'in_progress' | 'succeeded' | 'failed';
8
- genesis_time: number;
9
- destination_time: number;
10
- failure_code?: string;
11
- failure_reason?: string;
12
- error_json?: string;
13
- }
14
-
15
- export namespace TimeMachine {
16
- export class TimeMachineResource {
17
- retrieve(
18
- time_machine_name: string,
19
- headers?: ChargebeeRequestHeader,
20
- ): Promise<ChargebeeResponse<RetrieveResponse>>;
21
-
22
- startAfresh(
23
- time_machine_name: string,
24
- input?: StartAfreshInputParam,
25
- headers?: ChargebeeRequestHeader,
26
- ): Promise<ChargebeeResponse<StartAfreshResponse>>;
27
-
28
- travelForward(
29
- time_machine_name: string,
30
- input?: TravelForwardInputParam,
31
- headers?: ChargebeeRequestHeader,
32
- ): Promise<ChargebeeResponse<TravelForwardResponse>>;
33
- }
34
-
35
- export interface RetrieveResponse {
36
- time_machine: TimeMachine;
37
- }
38
-
39
- export interface StartAfreshResponse {
40
- time_machine: TimeMachine;
41
- }
42
-
43
- export interface TravelForwardResponse {
44
- time_machine: TimeMachine;
45
- }
46
-
47
- // REQUEST PARAMS
48
- //---------------
49
-
50
- export interface StartAfreshInputParam {
51
- genesis_time?: number;
52
- }
53
- export interface TravelForwardInputParam {
54
- destination_time?: number;
55
- }
56
- }
57
- }
@@ -1,19 +0,0 @@
1
- ///<reference path='./../core.d.ts'/>
2
- ///<reference path='./../index.d.ts'/>
3
-
4
- declare module 'chargebee' {
5
- export interface Token {
6
- id: string;
7
- gateway: Gateway;
8
- gateway_account_id: string;
9
- payment_method_type: PaymentMethodType;
10
- status: 'new' | 'expired' | 'consumed';
11
- id_at_vault: string;
12
- vault: 'spreedly' | 'gateway';
13
- ip_address?: string;
14
- resource_version?: number;
15
- updated_at?: number;
16
- created_at: number;
17
- expired_at?: number;
18
- }
19
- }
@@ -1,313 +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 Transaction {
6
- id: string;
7
- customer_id?: string;
8
- subscription_id?: string;
9
- gateway_account_id?: string;
10
- payment_source_id?: string;
11
- payment_method: PaymentMethod;
12
- reference_number?: string;
13
- gateway: Gateway;
14
- type: 'authorization' | 'payment' | 'refund' | 'payment_reversal';
15
- date?: number;
16
- settled_at?: number;
17
- exchange_rate?: number;
18
- currency_code: string;
19
- amount?: number;
20
- id_at_gateway?: string;
21
- status?:
22
- | 'in_progress'
23
- | 'success'
24
- | 'voided'
25
- | 'failure'
26
- | 'timeout'
27
- | 'needs_attention';
28
- fraud_flag?: 'safe' | 'suspicious' | 'fraudulent';
29
- initiator_type?: 'customer' | 'merchant';
30
- three_d_secure?: boolean;
31
- authorization_reason?: 'blocking_funds' | 'verification';
32
- error_code?: string;
33
- error_text?: string;
34
- voided_at?: number;
35
- resource_version?: number;
36
- updated_at?: number;
37
- fraud_reason?: string;
38
- custom_payment_method_id?: string;
39
- amount_unused?: number;
40
- masked_card_number?: string;
41
- reference_transaction_id?: string;
42
- refunded_txn_id?: string;
43
- reference_authorization_id?: string;
44
- amount_capturable?: number;
45
- reversal_transaction_id?: string;
46
- linked_invoices?: Transaction.LinkedInvoice[];
47
- linked_credit_notes?: Transaction.LinkedCreditNote[];
48
- linked_refunds?: Transaction.LinkedRefund[];
49
- linked_payments?: Transaction.LinkedPayment[];
50
- deleted: boolean;
51
- iin?: string;
52
- last4?: string;
53
- merchant_reference_id?: string;
54
- business_entity_id?: string;
55
- payment_method_details?: string;
56
- error_detail?: Transaction.GatewayErrorDetail;
57
- custom_payment_method_name?: string;
58
- }
59
-
60
- export namespace Transaction {
61
- export class TransactionResource {
62
- createAuthorization(
63
- input: CreateAuthorizationInputParam,
64
- headers?: ChargebeeRequestHeader,
65
- ): Promise<ChargebeeResponse<CreateAuthorizationResponse>>;
66
-
67
- voidTransaction(
68
- transaction_id: string,
69
- headers?: ChargebeeRequestHeader,
70
- ): Promise<ChargebeeResponse<VoidTransactionResponse>>;
71
-
72
- recordRefund(
73
- transaction_id: string,
74
- input: RecordRefundInputParam,
75
- headers?: ChargebeeRequestHeader,
76
- ): Promise<ChargebeeResponse<RecordRefundResponse>>;
77
-
78
- reconcile(
79
- transaction_id: string,
80
- input?: ReconcileInputParam,
81
- headers?: ChargebeeRequestHeader,
82
- ): Promise<ChargebeeResponse<ReconcileResponse>>;
83
-
84
- refund(
85
- transaction_id: string,
86
- input?: RefundInputParam,
87
- headers?: ChargebeeRequestHeader,
88
- ): Promise<ChargebeeResponse<RefundResponse>>;
89
-
90
- list(
91
- input?: ListInputParam,
92
- headers?: ChargebeeRequestHeader,
93
- ): Promise<ChargebeeResponse<ListResponse>>;
94
-
95
- transactionsForCustomer(
96
- customer_id: string,
97
- input?: TransactionsForCustomerInputParam,
98
- headers?: ChargebeeRequestHeader,
99
- ): Promise<ChargebeeResponse<TransactionsForCustomerResponse>>;
100
-
101
- transactionsForSubscription(
102
- subscription_id: string,
103
- input?: TransactionsForSubscriptionInputParam,
104
- headers?: ChargebeeRequestHeader,
105
- ): Promise<ChargebeeResponse<TransactionsForSubscriptionResponse>>;
106
-
107
- paymentsForInvoice(
108
- invoice_id: string,
109
- input?: PaymentsForInvoiceInputParam,
110
- headers?: ChargebeeRequestHeader,
111
- ): Promise<ChargebeeResponse<PaymentsForInvoiceResponse>>;
112
-
113
- retrieve(
114
- transaction_id: string,
115
- headers?: ChargebeeRequestHeader,
116
- ): Promise<ChargebeeResponse<RetrieveResponse>>;
117
-
118
- deleteOfflineTransaction(
119
- transaction_id: string,
120
- input?: DeleteOfflineTransactionInputParam,
121
- headers?: ChargebeeRequestHeader,
122
- ): Promise<ChargebeeResponse<DeleteOfflineTransactionResponse>>;
123
- }
124
-
125
- export interface CreateAuthorizationResponse {
126
- transaction: Transaction;
127
- }
128
-
129
- export interface VoidTransactionResponse {
130
- transaction: Transaction;
131
- }
132
-
133
- export interface RecordRefundResponse {
134
- transaction: Transaction;
135
- }
136
-
137
- export interface ReconcileResponse {
138
- transaction: Transaction;
139
- }
140
-
141
- export interface RefundResponse {
142
- transaction: Transaction;
143
- }
144
-
145
- export interface ListResponse {
146
- list: { transaction: Transaction }[];
147
- next_offset?: string;
148
- }
149
-
150
- export interface TransactionsForCustomerResponse {
151
- list: { transaction: Transaction }[];
152
- next_offset?: string;
153
- }
154
-
155
- export interface TransactionsForSubscriptionResponse {
156
- list: { transaction: Transaction }[];
157
- next_offset?: string;
158
- }
159
-
160
- export interface PaymentsForInvoiceResponse {
161
- list: { transaction: Transaction }[];
162
- next_offset?: string;
163
- }
164
-
165
- export interface RetrieveResponse {
166
- transaction: Transaction;
167
- }
168
-
169
- export interface DeleteOfflineTransactionResponse {
170
- transaction: Transaction;
171
- }
172
-
173
- export interface LinkedInvoice {
174
- invoice_id: string;
175
- applied_amount: number;
176
- applied_at: number;
177
- invoice_date?: number;
178
- invoice_total?: number;
179
- invoice_status:
180
- | 'paid'
181
- | 'posted'
182
- | 'payment_due'
183
- | 'not_paid'
184
- | 'voided'
185
- | 'pending';
186
- }
187
- export interface LinkedCreditNote {
188
- cn_id: string;
189
- applied_amount: number;
190
- applied_at: number;
191
- cn_reason_code?:
192
- | 'write_off'
193
- | 'subscription_change'
194
- | 'subscription_cancellation'
195
- | 'subscription_pause'
196
- | 'chargeback'
197
- | 'product_unsatisfactory'
198
- | 'service_unsatisfactory'
199
- | 'order_change'
200
- | 'order_cancellation'
201
- | 'waiver'
202
- | 'other'
203
- | 'fraudulent';
204
- cn_create_reason_code?: string;
205
- cn_date?: number;
206
- cn_total?: number;
207
- cn_status: 'adjusted' | 'refunded' | 'refund_due' | 'voided';
208
- cn_reference_invoice_id: string;
209
- }
210
- export interface LinkedRefund {
211
- txn_id: string;
212
- txn_status:
213
- | 'in_progress'
214
- | 'success'
215
- | 'voided'
216
- | 'failure'
217
- | 'timeout'
218
- | 'needs_attention';
219
- txn_date: number;
220
- txn_amount: number;
221
- }
222
- export interface LinkedPayment {
223
- id: string;
224
- status?:
225
- | 'in_progress'
226
- | 'success'
227
- | 'voided'
228
- | 'failure'
229
- | 'timeout'
230
- | 'needs_attention';
231
- amount?: number;
232
- date?: number;
233
- }
234
- export interface GatewayErrorDetail {
235
- request_id?: string;
236
- error_category?: string;
237
- error_code?: string;
238
- error_message?: string;
239
- decline_code?: string;
240
- decline_message?: string;
241
- network_error_code?: string;
242
- network_error_message?: string;
243
- error_field?: string;
244
- recommendation_code?: string;
245
- recommendation_message?: string;
246
- processor_error_code?: string;
247
- processor_error_message?: string;
248
- }
249
- // REQUEST PARAMS
250
- //---------------
251
-
252
- export interface CreateAuthorizationInputParam {
253
- customer_id: string;
254
- payment_source_id?: string;
255
- currency_code?: string;
256
- amount: number;
257
- }
258
- export interface RecordRefundInputParam {
259
- amount?: number;
260
- payment_method: PaymentMethod;
261
- date: number;
262
- reference_number?: string;
263
- custom_payment_method_id?: string;
264
- comment?: string;
265
- }
266
- export interface ReconcileInputParam {
267
- id_at_gateway?: string;
268
- customer_id?: string;
269
- status?: 'success' | 'failure';
270
- }
271
- export interface RefundInputParam {
272
- amount?: number;
273
- comment?: string;
274
- }
275
- export interface ListInputParam {
276
- limit?: number;
277
- offset?: string;
278
- include_deleted?: boolean;
279
- id?: filter.String;
280
- customer_id?: filter.String;
281
- subscription_id?: filter.String;
282
- payment_source_id?: filter.String;
283
- payment_method?: filter.Enum;
284
- gateway?: filter.Enum;
285
- gateway_account_id?: filter.String;
286
- id_at_gateway?: filter.String;
287
- reference_number?: filter.String;
288
- type?: filter.Enum;
289
- date?: filter.Timestamp;
290
- amount?: filter.Number;
291
- amount_capturable?: filter.Number;
292
- status?: filter.Enum;
293
- updated_at?: filter.Timestamp;
294
- 'sort_by[asc]'?: string;
295
- 'sort_by[desc]'?: string;
296
- }
297
- export interface TransactionsForCustomerInputParam {
298
- limit?: number;
299
- offset?: string;
300
- }
301
- export interface TransactionsForSubscriptionInputParam {
302
- limit?: number;
303
- offset?: string;
304
- }
305
- export interface PaymentsForInvoiceInputParam {
306
- limit?: number;
307
- offset?: string;
308
- }
309
- export interface DeleteOfflineTransactionInputParam {
310
- comment?: string;
311
- }
312
- }
313
- }