chargebee 3.13.0 → 3.15.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 (57) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +24 -0
  3. package/cjs/RequestWrapper.js +12 -8
  4. package/cjs/chargebee.cjs.js +1 -5
  5. package/cjs/coreCommon.js +5 -5
  6. package/cjs/createChargebee.js +2 -1
  7. package/cjs/environment.js +1 -1
  8. package/cjs/net/ClientInterface.js +2 -21
  9. package/cjs/net/FetchClient.js +9 -39
  10. package/cjs/resources/api_endpoints.js +66 -0
  11. package/esm/RequestWrapper.js +12 -8
  12. package/esm/chargebee.esm.js +1 -5
  13. package/esm/coreCommon.js +5 -5
  14. package/esm/createChargebee.js +2 -1
  15. package/esm/environment.js +1 -1
  16. package/esm/net/ClientInterface.js +1 -19
  17. package/esm/net/FetchClient.js +9 -38
  18. package/esm/resources/api_endpoints.js +66 -0
  19. package/package.json +1 -1
  20. package/types/core.d.ts +10 -1
  21. package/types/index.d.ts +79 -63
  22. package/types/resources/Comment.d.ts +0 -9
  23. package/types/resources/Content.d.ts +4 -0
  24. package/types/resources/CreditNote.d.ts +5 -1
  25. package/types/resources/CreditNoteEstimate.d.ts +32 -31
  26. package/types/resources/Currency.d.ts +11 -5
  27. package/types/resources/Customer.d.ts +2 -1
  28. package/types/resources/Entitlement.d.ts +1 -1
  29. package/types/resources/EntitlementOverride.d.ts +1 -1
  30. package/types/resources/Estimate.d.ts +2 -0
  31. package/types/resources/Event.d.ts +3 -0
  32. package/types/resources/GatewayErrorDetail.d.ts +1 -0
  33. package/types/resources/HostedPage.d.ts +2 -0
  34. package/types/resources/Invoice.d.ts +29 -1
  35. package/types/resources/InvoiceEstimate.d.ts +43 -42
  36. package/types/resources/OfferEvent.d.ts +25 -0
  37. package/types/resources/OfferFulfillment.d.ts +77 -0
  38. package/types/resources/OmnichannelOneTimeOrder.d.ts +1 -13
  39. package/types/resources/OmnichannelSubscription.d.ts +13 -12
  40. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  41. package/types/resources/OmnichannelSubscriptionItemOffer.d.ts +22 -0
  42. package/types/resources/OmnichannelTransaction.d.ts +13 -0
  43. package/types/resources/Order.d.ts +0 -1
  44. package/types/resources/PaymentIntent.d.ts +42 -0
  45. package/types/resources/PersonalizedOffer.d.ts +64 -0
  46. package/types/resources/Quote.d.ts +35 -33
  47. package/types/resources/QuoteLineGroup.d.ts +22 -21
  48. package/types/resources/Ramp.d.ts +46 -0
  49. package/types/resources/SalesOrder.d.ts +2 -2
  50. package/types/resources/Subscription.d.ts +1 -1
  51. package/types/resources/SubscriptionEntitlement.d.ts +1 -1
  52. package/types/resources/SubscriptionEstimate.d.ts +0 -1
  53. package/types/resources/Transaction.d.ts +5 -1
  54. package/types/resources/UsageFile.d.ts +2 -0
  55. package/types/resources/WebhookEvent.d.ts +17 -0
  56. package/cjs/net/NodeClient.js +0 -61
  57. package/esm/net/NodeClient.js +0 -56
@@ -4642,6 +4642,19 @@ export const Endpoints = {
4642
4642
  {},
4643
4643
  {},
4644
4644
  ],
4645
+ [
4646
+ 'move',
4647
+ 'POST',
4648
+ '/omnichannel_subscriptions',
4649
+ '/move',
4650
+ true,
4651
+ null,
4652
+ false,
4653
+ {},
4654
+ {
4655
+ isIdempotent: true,
4656
+ },
4657
+ ],
4645
4658
  ],
4646
4659
  omnichannelTransaction: [],
4647
4660
  omnichannelSubscriptionItem: [
@@ -4752,7 +4765,60 @@ export const Endpoints = {
4752
4765
  {},
4753
4766
  ],
4754
4767
  ],
4768
+ personalizedOffer: [
4769
+ [
4770
+ 'personalizedOffers',
4771
+ 'POST',
4772
+ '/personalized_offers',
4773
+ null,
4774
+ false,
4775
+ 'grow',
4776
+ true,
4777
+ {
4778
+ custom: 0,
4779
+ },
4780
+ {},
4781
+ ],
4782
+ ],
4755
4783
  brand: [],
4784
+ offerFulfillment: [
4785
+ [
4786
+ 'offerFulfillments',
4787
+ 'POST',
4788
+ '/offer_fulfillments',
4789
+ null,
4790
+ false,
4791
+ 'grow',
4792
+ true,
4793
+ {},
4794
+ {},
4795
+ ],
4796
+ [
4797
+ 'offerFulfillmentsGet',
4798
+ 'GET',
4799
+ '/offer_fulfillments',
4800
+ null,
4801
+ true,
4802
+ 'grow',
4803
+ true,
4804
+ {},
4805
+ {},
4806
+ ],
4807
+ [
4808
+ 'offerFulfillmentsUpdate',
4809
+ 'POST',
4810
+ '/offer_fulfillments',
4811
+ null,
4812
+ true,
4813
+ 'grow',
4814
+ true,
4815
+ {},
4816
+ {},
4817
+ ],
4818
+ ],
4819
+ offerEvent: [
4820
+ ['offerEvents', 'POST', '/offer_events', null, false, 'grow', true, {}, {}],
4821
+ ],
4756
4822
  webhookEndpoint: [
4757
4823
  [
4758
4824
  'create',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chargebee",
3
- "version": "3.13.0",
3
+ "version": "3.15.0",
4
4
  "description": "A library for integrating with Chargebee.",
5
5
  "scripts": {
6
6
  "prepack": "npm install && npm run build",
package/types/core.d.ts CHANGED
@@ -45,6 +45,7 @@ declare module 'chargebee' {
45
45
  | 'end_of_term'
46
46
  | 'specific_date'
47
47
  | 'end_of_billing_term';
48
+ type CategoryEnum = 'introductory' | 'promotional' | 'developer_determined';
48
49
  type ChangeOptionEnum = 'immediately' | 'end_of_term' | 'specific_date';
49
50
  type ChannelEnum = 'web' | 'app_store' | 'play_store';
50
51
  type ChargeModelEnum = 'full_charge' | 'prorate';
@@ -80,6 +81,7 @@ declare module 'chargebee' {
80
81
  | 'becs_nz'
81
82
  | 'pad'
82
83
  | 'not_applicable';
84
+ type DiscountTypeEnum = 'fixed_amount' | 'percentage' | 'price';
83
85
  type DispositionTypeEnum = 'attachment' | 'inline';
84
86
  type DunningTypeEnum = 'auto_collect' | 'offline' | 'direct_debit';
85
87
  type DurationTypeEnum = 'one_time' | 'forever' | 'limited_period';
@@ -219,6 +221,7 @@ declare module 'chargebee' {
219
221
  | 'transaction_deleted'
220
222
  | 'payment_succeeded'
221
223
  | 'payment_failed'
224
+ | 'dunning_updated'
222
225
  | 'payment_refunded'
223
226
  | 'payment_initiated'
224
227
  | 'refund_initiated'
@@ -356,6 +359,8 @@ declare module 'chargebee' {
356
359
  | 'omnichannel_one_time_order_item_cancelled'
357
360
  | 'usage_file_ingested'
358
361
  | 'omnichannel_subscription_item_pause_scheduled'
362
+ | 'omnichannel_subscription_moved_in'
363
+ | 'omnichannel_transaction_created'
359
364
  | 'plan_created'
360
365
  | 'plan_updated'
361
366
  | 'plan_deleted'
@@ -419,6 +424,7 @@ declare module 'chargebee' {
419
424
  | 'solidgate'
420
425
  | 'paystack'
421
426
  | 'jp_morgan'
427
+ | 'deutsche_bank'
422
428
  | 'gocardless'
423
429
  | 'not_applicable';
424
430
  type HierarchyOperationTypeEnum =
@@ -611,7 +617,10 @@ declare module 'chargebee' {
611
617
  | 'automated_bank_transfer'
612
618
  | 'klarna_pay_now'
613
619
  | 'online_banking_poland'
614
- | 'payconiq_by_bancontact';
620
+ | 'payconiq_by_bancontact'
621
+ | 'free_trial'
622
+ | 'pay_up_front'
623
+ | 'pay_as_you_go';
615
624
  type UnbilledChargesHandlingEnum = 'no_action' | 'invoice';
616
625
  type UnbilledChargesOptionEnum = 'invoice' | 'delete';
617
626
  type UnpaidInvoicesHandlingEnum = 'no_action' | 'schedule_payment_collection';
package/types/index.d.ts CHANGED
@@ -47,10 +47,13 @@
47
47
  ///<reference path='./resources/ItemPrice.d.ts' />
48
48
  ///<reference path='./resources/Metadata.d.ts' />
49
49
  ///<reference path='./resources/NonSubscription.d.ts' />
50
+ ///<reference path='./resources/OfferEvent.d.ts' />
51
+ ///<reference path='./resources/OfferFulfillment.d.ts' />
50
52
  ///<reference path='./resources/OmnichannelOneTimeOrder.d.ts' />
51
53
  ///<reference path='./resources/OmnichannelOneTimeOrderItem.d.ts' />
52
54
  ///<reference path='./resources/OmnichannelSubscription.d.ts' />
53
55
  ///<reference path='./resources/OmnichannelSubscriptionItem.d.ts' />
56
+ ///<reference path='./resources/OmnichannelSubscriptionItemOffer.d.ts' />
54
57
  ///<reference path='./resources/OmnichannelSubscriptionItemScheduledChange.d.ts' />
55
58
  ///<reference path='./resources/OmnichannelTransaction.d.ts' />
56
59
  ///<reference path='./resources/Order.d.ts' />
@@ -61,6 +64,7 @@
61
64
  ///<reference path='./resources/PaymentScheduleScheme.d.ts' />
62
65
  ///<reference path='./resources/PaymentSource.d.ts' />
63
66
  ///<reference path='./resources/PaymentVoucher.d.ts' />
67
+ ///<reference path='./resources/PersonalizedOffer.d.ts' />
64
68
  ///<reference path='./resources/Plan.d.ts' />
65
69
  ///<reference path='./resources/PortalSession.d.ts' />
66
70
  ///<reference path='./resources/PriceVariant.d.ts' />
@@ -99,74 +103,83 @@
99
103
  ///<reference path='./resources/WebhookEndpoint.d.ts' />
100
104
  ///<reference path='./resources/Content.d.ts' />
101
105
  ///<reference path='./resources/WebhookEvent.d.ts' />
106
+ declare module 'chargebee' {
107
+ export type Config = {
108
+ /**
109
+ * @apiKey api key for the site.
110
+ */
111
+ apiKey: string;
112
+ /**
113
+ * @site api site name.
114
+ */
115
+ site: string;
116
+ /**
117
+ * @apiPath this value indicates the api version, default value is /api/v2.
118
+ */
119
+ apiPath?: '/api/v2' | '/api/v1';
120
+ /**
121
+ * @timeout client side request timeout in milliseconds, default value is 80000ms.
122
+ */
123
+ timeout?: number;
124
+ /**
125
+ * @port url port
126
+ */
127
+ port?: number;
128
+ /**
129
+ * @timemachineWaitInMillis time interval at which two subsequent retrieve timemachine call in milliseconds, default value is 3000ms.
130
+ */
131
+ timemachineWaitInMillis?: number;
132
+ /**
133
+ * @exportWaitInMillis time interval at which two subsequent retrieve export call in milliseconds, default value is 3000ms.
134
+ */
135
+ exportWaitInMillis?: number;
136
+ /**
137
+ * @protocol http protocol, default value is https
138
+ */
139
+ protocol?: 'https' | 'http';
140
+ /**
141
+ * @hostSuffix url host suffix, default value is .chargebee.com
142
+ */
143
+ hostSuffix?: string;
102
144
 
103
- export type Config = {
104
- /**
105
- * @apiKey api key for the site.
106
- */
107
- apiKey: string;
108
- /**
109
- * @site api site name.
110
- */
111
- site: string;
112
- /**
113
- * @apiPath this value indicates the api version, default value is /api/v2.
114
- */
115
- apiPath?: '/api/v2' | '/api/v1';
116
- /**
117
- * @timeout client side request timeout in milliseconds, default value is 80000ms.
118
- */
119
- timeout?: number;
120
- /**
121
- * @port url port
122
- */
123
- port?: number;
124
- /**
125
- * @timemachineWaitInMillis time interval at which two subsequent retrieve timemachine call in milliseconds, default value is 3000ms.
126
- */
127
- timemachineWaitInMillis?: number;
128
- /**
129
- * @exportWaitInMillis time interval at which two subsequent retrieve export call in milliseconds, default value is 3000ms.
130
- */
131
- exportWaitInMillis?: number;
132
- /**
133
- * @protocol http protocol, default value is https
134
- */
135
- protocol?: 'https' | 'http';
136
- /**
137
- * @hostSuffix url host suffix, default value is .chargebee.com
138
- */
139
- hostSuffix?: string;
145
+ /**
146
+ * @retryConfig retry configuration for the client, default value is { enabled: false, maxRetries: 3, delayMs: 1000, retryOn: [500, 502, 503, 504]}
147
+ */
148
+ retryConfig?: RetryConfig;
140
149
 
141
- /**
142
- * @retryConfig retry configuration for the client, default value is { enabled: false, maxRetries: 3, delayMs: 1000, retryOn: [500, 502, 503, 504]}
143
- */
144
- retryConfig?: RetryConfig;
150
+ /**
151
+ * @enableDebugLogs whether to enable debug logs, default value is false
152
+ */
153
+ enableDebugLogs?: boolean;
145
154
 
146
- /**
147
- * @enableDebugLogs whether to enable debug logs, default value is false
148
- */
149
- enableDebugLogs?: boolean;
155
+ /**
156
+ * @userAgentSuffix optional string appended to the User-Agent header for additional logging
157
+ */
158
+ userAgentSuffix?: string;
150
159
 
151
- /**
152
- * @userAgentSuffix optional string appended to the User-Agent header for additional logging
153
- */
154
- userAgentSuffix?: string;
155
- };
160
+ /**
161
+ * @httpClient optional http client implementation, default http client will be used if not provided
162
+ */
163
+ httpClient?: HttpClientInterface;
164
+ };
165
+
166
+ export interface HttpClientInterface {
167
+ makeApiRequest: (request: Request, timeout: number) => Promise<Response>;
168
+ }
169
+
170
+ export type RetryConfig = {
171
+ /**
172
+ * @enabled whether to enable retry logic, default value is false
173
+ * @maxRetries maximum number of retries, default value is 3
174
+ * @delayMs delay in milliseconds between retries, default value is 1000ms
175
+ * @retryOn array of HTTP status codes to retry on, default value is [500, 502, 503, 504]
176
+ */
177
+ enabled?: boolean;
178
+ maxRetries?: number;
179
+ delayMs?: number;
180
+ retryOn?: Array<number>;
181
+ };
156
182
 
157
- export type RetryConfig = {
158
- /**
159
- * @enabled whether to enable retry logic, default value is false
160
- * @maxRetries maximum number of retries, default value is 3
161
- * @delayMs delay in milliseconds between retries, default value is 1000ms
162
- * @retryOn array of HTTP status codes to retry on, default value is [500, 502, 503, 504]
163
- */
164
- enabled?: boolean;
165
- maxRetries?: number;
166
- delayMs?: number;
167
- retryOn?: Array<number>;
168
- };
169
- declare module 'chargebee' {
170
183
  export default class Chargebee {
171
184
  constructor(config: Config);
172
185
  addon: Addon.AddonResource;
@@ -199,6 +212,8 @@ declare module 'chargebee' {
199
212
  itemFamily: ItemFamily.ItemFamilyResource;
200
213
  itemPrice: ItemPrice.ItemPriceResource;
201
214
  nonSubscription: NonSubscription.NonSubscriptionResource;
215
+ offerEvent: OfferEvent.OfferEventResource;
216
+ offerFulfillment: OfferFulfillment.OfferFulfillmentResource;
202
217
  omnichannelOneTimeOrder: OmnichannelOneTimeOrder.OmnichannelOneTimeOrderResource;
203
218
  omnichannelSubscription: OmnichannelSubscription.OmnichannelSubscriptionResource;
204
219
  omnichannelSubscriptionItem: OmnichannelSubscriptionItem.OmnichannelSubscriptionItemResource;
@@ -207,6 +222,7 @@ declare module 'chargebee' {
207
222
  paymentScheduleScheme: PaymentScheduleScheme.PaymentScheduleSchemeResource;
208
223
  paymentSource: PaymentSource.PaymentSourceResource;
209
224
  paymentVoucher: PaymentVoucher.PaymentVoucherResource;
225
+ personalizedOffer: PersonalizedOffer.PersonalizedOfferResource;
210
226
  plan: Plan.PlanResource;
211
227
  portalSession: PortalSession.PortalSessionResource;
212
228
  priceVariant: PriceVariant.PriceVariantResource;
@@ -77,15 +77,6 @@ declare module 'chargebee' {
77
77
  | 'coupon'
78
78
  | 'order'
79
79
  | 'business_entity'
80
- | 'omnichannel_subscription'
81
- | 'omnichannel_subscription_item'
82
- | 'omnichannel_transaction'
83
- | 'recorded_purchase'
84
- | 'omnichannel_subscription_item_scheduled_change'
85
- | 'sales_order'
86
- | 'omnichannel_one_time_order'
87
- | 'omnichannel_one_time_order_item'
88
- | 'usage_file'
89
80
  | 'item_family'
90
81
  | 'item'
91
82
  | 'item_price'
@@ -52,10 +52,13 @@ declare module 'chargebee' {
52
52
  item_price: ItemPrice;
53
53
  metadata: Metadata;
54
54
  non_subscription: NonSubscription;
55
+ offer_event: OfferEvent;
56
+ offer_fulfillment: OfferFulfillment;
55
57
  omnichannel_one_time_order: OmnichannelOneTimeOrder;
56
58
  omnichannel_one_time_order_item: OmnichannelOneTimeOrderItem;
57
59
  omnichannel_subscription: OmnichannelSubscription;
58
60
  omnichannel_subscription_item: OmnichannelSubscriptionItem;
61
+ omnichannel_subscription_item_offer: OmnichannelSubscriptionItemOffer;
59
62
  omnichannel_subscription_item_scheduled_change: OmnichannelSubscriptionItemScheduledChange;
60
63
  omnichannel_transaction: OmnichannelTransaction;
61
64
  order: Order;
@@ -66,6 +69,7 @@ declare module 'chargebee' {
66
69
  payment_schedule_scheme: PaymentScheduleScheme;
67
70
  payment_source: PaymentSource;
68
71
  payment_voucher: PaymentVoucher;
72
+ personalized_offer: PersonalizedOffer;
69
73
  plan: Plan;
70
74
  portal_session: PortalSession;
71
75
  price_variant: PriceVariant;
@@ -3,6 +3,7 @@
3
3
  ///<reference path='./filter.d.ts'/>
4
4
  declare module 'chargebee' {
5
5
  export interface CreditNote {
6
+ [key: string]: unknown;
6
7
  id: string;
7
8
  customer_id: string;
8
9
  subscription_id?: string;
@@ -330,6 +331,7 @@ declare module 'chargebee' {
330
331
  export interface Discount {
331
332
  amount: number;
332
333
  description?: string;
334
+ line_item_id?: string;
333
335
  entity_type:
334
336
  | 'item_level_coupon'
335
337
  | 'document_level_coupon'
@@ -395,7 +397,6 @@ declare module 'chargebee' {
395
397
  country?: string;
396
398
  zip?: string;
397
399
  validation_status?: ValidationStatusEnum;
398
- index: number;
399
400
  }
400
401
  export interface BillingAddress {
401
402
  first_name?: string;
@@ -450,6 +451,7 @@ declare module 'chargebee' {
450
451
  currency_code?: string;
451
452
  comment?: string;
452
453
  line_items?: LineItemsCreateInputParam[];
454
+ [key: `cf_${string}`]: unknown;
453
455
  }
454
456
  export interface RetrieveInputParam {
455
457
  line_item?: LineItemRetrieveInputParam;
@@ -528,6 +530,7 @@ declare module 'chargebee' {
528
530
  taxes?: TaxesImportCreditNoteInputParam[];
529
531
  allocations?: AllocationsImportCreditNoteInputParam[];
530
532
  linked_refunds?: LinkedRefundsImportCreditNoteInputParam[];
533
+ [key: `cf_${string}`]: unknown;
531
534
  }
532
535
  export interface LineItemsCreateInputParam {
533
536
  reference_line_item_id?: string;
@@ -582,6 +585,7 @@ declare module 'chargebee' {
582
585
  allocated_at: number;
583
586
  }
584
587
  export interface DiscountsImportCreditNoteInputParam {
588
+ line_item_id?: string;
585
589
  entity_type:
586
590
  | 'item_level_coupon'
587
591
  | 'document_level_coupon'
@@ -12,11 +12,11 @@ declare module 'chargebee' {
12
12
  amount_allocated: number;
13
13
  amount_available: number;
14
14
  line_items?: CreditNoteEstimate.LineItem[];
15
+ line_item_tiers?: CreditNoteEstimate.LineItemTier[];
16
+ line_item_discounts?: CreditNoteEstimate.LineItemDiscount[];
17
+ line_item_taxes?: CreditNoteEstimate.LineItemTax[];
15
18
  discounts?: CreditNoteEstimate.Discount[];
16
19
  taxes?: CreditNoteEstimate.Tax[];
17
- line_item_taxes?: CreditNoteEstimate.LineItemTax[];
18
- line_item_discounts?: CreditNoteEstimate.LineItemDiscount[];
19
- line_item_tiers?: CreditNoteEstimate.LineItemTier[];
20
20
  round_off_amount?: number;
21
21
  customer_id?: string;
22
22
  }
@@ -71,24 +71,31 @@ declare module 'chargebee' {
71
71
  entity_id?: string;
72
72
  customer_id?: string;
73
73
  }
74
- export interface Discount {
75
- amount: number;
76
- description?: string;
77
- entity_type:
74
+ export interface LineItemTier {
75
+ line_item_id?: string;
76
+ starting_unit: number;
77
+ ending_unit?: number;
78
+ quantity_used: number;
79
+ unit_amount: number;
80
+ starting_unit_in_decimal?: string;
81
+ ending_unit_in_decimal?: string;
82
+ quantity_used_in_decimal?: string;
83
+ unit_amount_in_decimal?: string;
84
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
85
+ package_size?: number;
86
+ }
87
+ export interface LineItemDiscount {
88
+ line_item_id: string;
89
+ discount_type:
78
90
  | 'item_level_coupon'
79
91
  | 'document_level_coupon'
80
92
  | 'promotional_credits'
81
93
  | 'prorated_credits'
82
94
  | 'item_level_discount'
83
95
  | 'document_level_discount';
84
- discount_type?: 'fixed_amount' | 'percentage';
96
+ coupon_id?: string;
85
97
  entity_id?: string;
86
- coupon_set_code?: string;
87
- }
88
- export interface Tax {
89
- name: string;
90
- amount: number;
91
- description?: string;
98
+ discount_amount: number;
92
99
  }
93
100
  export interface LineItemTax {
94
101
  line_item_id?: string;
@@ -115,31 +122,25 @@ declare module 'chargebee' {
115
122
  tax_amount_in_local_currency?: number;
116
123
  local_currency_code?: string;
117
124
  }
118
- export interface LineItemDiscount {
119
- line_item_id: string;
120
- discount_type:
125
+ export interface Discount {
126
+ amount: number;
127
+ description?: string;
128
+ line_item_id?: string;
129
+ entity_type:
121
130
  | 'item_level_coupon'
122
131
  | 'document_level_coupon'
123
132
  | 'promotional_credits'
124
133
  | 'prorated_credits'
125
134
  | 'item_level_discount'
126
135
  | 'document_level_discount';
127
- coupon_id?: string;
136
+ discount_type?: 'fixed_amount' | 'percentage';
128
137
  entity_id?: string;
129
- discount_amount: number;
138
+ coupon_set_code?: string;
130
139
  }
131
- export interface LineItemTier {
132
- line_item_id?: string;
133
- starting_unit: number;
134
- ending_unit?: number;
135
- quantity_used: number;
136
- unit_amount: number;
137
- starting_unit_in_decimal?: string;
138
- ending_unit_in_decimal?: string;
139
- quantity_used_in_decimal?: string;
140
- unit_amount_in_decimal?: string;
141
- pricing_type?: 'per_unit' | 'flat_fee' | 'package';
142
- package_size?: number;
140
+ export interface Tax {
141
+ name: string;
142
+ amount: number;
143
+ description?: string;
143
144
  }
144
145
  // REQUEST PARAMS
145
146
  //---------------
@@ -1,19 +1,20 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  ///<reference path='./../index.d.ts'/>
3
-
3
+ ///<reference path='./filter.d.ts'/>
4
4
  declare module 'chargebee' {
5
5
  export interface Currency {
6
- id?: string;
6
+ id: string;
7
7
  enabled: boolean;
8
8
  forex_type?: 'manual' | 'auto';
9
- currency_code?: string;
10
- is_base_currency?: boolean;
9
+ currency_code: string;
10
+ is_base_currency: boolean;
11
11
  manual_exchange_rate?: string;
12
12
  }
13
13
 
14
14
  export namespace Currency {
15
15
  export class CurrencyResource {
16
16
  list(
17
+ input?: ListInputParam,
17
18
  headers?: ChargebeeRequestHeader,
18
19
  ): Promise<ChargebeeResponse<ListResponse>>;
19
20
 
@@ -46,7 +47,8 @@ declare module 'chargebee' {
46
47
  }
47
48
 
48
49
  export interface ListResponse {
49
- currency: Currency;
50
+ list: { currency: Currency }[];
51
+ next_offset?: string;
50
52
  }
51
53
 
52
54
  export interface RetrieveResponse {
@@ -74,6 +76,10 @@ declare module 'chargebee' {
74
76
  // REQUEST PARAMS
75
77
  //---------------
76
78
 
79
+ export interface ListInputParam {
80
+ limit?: number;
81
+ offset?: string;
82
+ }
77
83
  export interface CreateInputParam {
78
84
  currency_code: string;
79
85
  forex_type: 'manual' | 'auto';
@@ -348,7 +348,7 @@ declare module 'chargebee' {
348
348
  }
349
349
 
350
350
  export interface ListHierarchyDetailResponse {
351
- list: { hierarchies: any[] }[];
351
+ list: { hierarchy: Hierarchy }[];
352
352
  next_offset?: string;
353
353
  }
354
354
 
@@ -412,6 +412,7 @@ declare module 'chargebee' {
412
412
  unbilled_charges: number;
413
413
  currency_code: string;
414
414
  balance_currency_code: string;
415
+ business_entity_id?: string;
415
416
  }
416
417
  export interface EntityIdentifier {
417
418
  id: string;
@@ -31,7 +31,7 @@ declare module 'chargebee' {
31
31
  }
32
32
 
33
33
  export interface CreateResponse {
34
- entitlement: Entitlement;
34
+ list: { entitlement: Entitlement }[];
35
35
  }
36
36
 
37
37
  // REQUEST PARAMS
@@ -35,7 +35,7 @@ declare module 'chargebee' {
35
35
  }
36
36
 
37
37
  export interface AddEntitlementOverrideForSubscriptionResponse {
38
- entitlement_override: EntitlementOverride;
38
+ list: { entitlement_override: EntitlementOverride }[];
39
39
  }
40
40
 
41
41
  export interface ListEntitlementOverrideForSubscriptionResponse {
@@ -593,6 +593,7 @@ declare module 'chargebee' {
593
593
  * @deprecated Please refer API docs to use other attributes
594
594
  */
595
595
  coupon?: string;
596
+ offline_payment_method?: OfflinePaymentMethodEnum;
596
597
  free_period?: number;
597
598
  free_period_unit?: FreePeriodUnitEnum;
598
599
  contract_term_billing_cycle_on_renewal?: number;
@@ -734,6 +735,7 @@ declare module 'chargebee' {
734
735
  */
735
736
  setup_fee?: number;
736
737
  start_date?: number;
738
+ offline_payment_method?: OfflinePaymentMethodEnum;
737
739
  free_period?: number;
738
740
  free_period_unit?: FreePeriodUnitEnum;
739
741
  contract_term_billing_cycle_on_renewal?: number;
@@ -47,6 +47,7 @@ declare module 'chargebee' {
47
47
  CustomerDeletedContent &
48
48
  RefundInitiatedContent &
49
49
  InvoiceGeneratedWithBackdatingContent &
50
+ OmnichannelTransactionCreatedContent &
50
51
  AddUsagesReminderContent &
51
52
  VoucherCreatedContent &
52
53
  RuleUpdatedContent &
@@ -73,6 +74,7 @@ declare module 'chargebee' {
73
74
  SubscriptionAdvanceInvoiceScheduleUpdatedContent &
74
75
  ItemDeletedContent &
75
76
  SubscriptionRampDraftedContent &
77
+ DunningUpdatedContent &
76
78
  ItemEntitlementsUpdatedContent &
77
79
  TokenConsumedContent &
78
80
  HierarchyDeletedContent &
@@ -166,6 +168,7 @@ declare module 'chargebee' {
166
168
  SubscriptionScheduledCancellationRemovedContent &
167
169
  PaymentRefundedContent &
168
170
  UsageFileIngestedContent &
171
+ OmnichannelSubscriptionMovedInContent &
169
172
  DifferentialPriceCreatedContent &
170
173
  TransactionCreatedContent &
171
174
  PaymentSucceededContent &
@@ -17,5 +17,6 @@ declare module 'chargebee' {
17
17
  processor_error_code?: string;
18
18
  processor_error_message?: string;
19
19
  error_cause_id?: string;
20
+ processor_advice_code?: string;
20
21
  }
21
22
  }
@@ -14,6 +14,7 @@ declare module 'chargebee' {
14
14
  | 'checkout_one_time'
15
15
  | 'pre_cancel'
16
16
  | 'view_voucher'
17
+ | 'accept_quote'
17
18
  | 'checkout_gift'
18
19
  | 'claim_gift';
19
20
  url?: string;
@@ -813,6 +814,7 @@ declare module 'chargebee' {
813
814
  start_date?: number;
814
815
  coupon?: string;
815
816
  auto_collection?: AutoCollectionEnum;
817
+ offline_payment_method?: OfflinePaymentMethodEnum;
816
818
  invoice_notes?: string;
817
819
  po_number?: string;
818
820
  contract_term_billing_cycle_on_renewal?: number;