chargebee 3.12.0 → 3.14.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 (45) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +30 -1
  3. package/cjs/coreCommon.js +1 -1
  4. package/cjs/environment.js +1 -1
  5. package/cjs/resources/api_endpoints.js +66 -0
  6. package/esm/coreCommon.js +1 -1
  7. package/esm/environment.js +1 -1
  8. package/esm/resources/api_endpoints.js +66 -0
  9. package/package.json +2 -2
  10. package/types/core.d.ts +8 -1
  11. package/types/index.d.ts +16 -0
  12. package/types/resources/BusinessEntityChange.d.ts +16 -0
  13. package/types/resources/Comment.d.ts +0 -9
  14. package/types/resources/Content.d.ts +110 -0
  15. package/types/resources/CreditNote.d.ts +3 -1
  16. package/types/resources/CreditNoteEstimate.d.ts +31 -31
  17. package/types/resources/Currency.d.ts +11 -5
  18. package/types/resources/Customer.d.ts +1 -0
  19. package/types/resources/Estimate.d.ts +2 -0
  20. package/types/resources/Event.d.ts +208 -1
  21. package/types/resources/GatewayErrorDetail.d.ts +1 -0
  22. package/types/resources/HostedPage.d.ts +3 -1
  23. package/types/resources/Invoice.d.ts +5 -1
  24. package/types/resources/InvoiceEstimate.d.ts +42 -42
  25. package/types/resources/OfferEvent.d.ts +25 -0
  26. package/types/resources/OfferFulfillment.d.ts +77 -0
  27. package/types/resources/OmnichannelOneTimeOrder.d.ts +1 -13
  28. package/types/resources/OmnichannelSubscription.d.ts +13 -12
  29. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  30. package/types/resources/OmnichannelSubscriptionItemOffer.d.ts +22 -0
  31. package/types/resources/OmnichannelTransaction.d.ts +13 -0
  32. package/types/resources/Order.d.ts +0 -1
  33. package/types/resources/PersonalizedOffer.d.ts +64 -0
  34. package/types/resources/Product.d.ts +135 -0
  35. package/types/resources/Quote.d.ts +35 -34
  36. package/types/resources/QuoteLineGroup.d.ts +21 -21
  37. package/types/resources/Ramp.d.ts +46 -0
  38. package/types/resources/SalesOrder.d.ts +143 -0
  39. package/types/resources/Subscription.d.ts +1 -1
  40. package/types/resources/SubscriptionEstimate.d.ts +0 -1
  41. package/types/resources/Transaction.d.ts +1 -0
  42. package/types/resources/UsageFile.d.ts +2 -0
  43. package/types/resources/UsageReminderInfo.d.ts +9 -0
  44. package/types/resources/Variant.d.ts +116 -0
  45. package/types/resources/WebhookEvent.d.ts +1619 -0
@@ -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,24 @@ 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
+ entity_type:
121
129
  | 'item_level_coupon'
122
130
  | 'document_level_coupon'
123
131
  | 'promotional_credits'
124
132
  | 'prorated_credits'
125
133
  | 'item_level_discount'
126
134
  | 'document_level_discount';
127
- coupon_id?: string;
135
+ discount_type?: 'fixed_amount' | 'percentage';
128
136
  entity_id?: string;
129
- discount_amount: number;
137
+ coupon_set_code?: string;
130
138
  }
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;
139
+ export interface Tax {
140
+ name: string;
141
+ amount: number;
142
+ description?: string;
143
143
  }
144
144
  // REQUEST PARAMS
145
145
  //---------------
@@ -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';
@@ -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;
@@ -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;
@@ -20,7 +20,214 @@ declare module 'chargebee' {
20
20
  webhooks?: Event.Webhook[];
21
21
  event_type?: EventTypeEnum;
22
22
  api_version?: ApiVersionEnum;
23
- content: any;
23
+ content: SubscriptionPauseScheduledContent &
24
+ CustomerBusinessEntityChangedContent &
25
+ SubscriptionAdvanceInvoiceScheduleAddedContent &
26
+ GiftExpiredContent &
27
+ TaxWithheldDeletedContent &
28
+ UnbilledChargesDeletedContent &
29
+ CouponUpdatedContent &
30
+ OmnichannelSubscriptionItemReactivatedContent &
31
+ OmnichannelSubscriptionItemRenewedContent &
32
+ UnbilledChargesCreatedContent &
33
+ SubscriptionResumedContent &
34
+ OmnichannelOneTimeOrderItemCancelledContent &
35
+ SubscriptionCancelledContent &
36
+ ItemEntitlementsRemovedContent &
37
+ BusinessEntityCreatedContent &
38
+ CouponSetUpdatedContent &
39
+ DifferentialPriceUpdatedContent &
40
+ OmnichannelSubscriptionItemPausedContent &
41
+ EntitlementOverridesRemovedContent &
42
+ SubscriptionActivatedWithBackdatingContent &
43
+ SubscriptionTrialEndReminderContent &
44
+ SubscriptionShippingAddressUpdatedContent &
45
+ VoucherCreateFailedContent &
46
+ GiftClaimedContent &
47
+ CustomerDeletedContent &
48
+ RefundInitiatedContent &
49
+ InvoiceGeneratedWithBackdatingContent &
50
+ AddUsagesReminderContent &
51
+ VoucherCreatedContent &
52
+ RuleUpdatedContent &
53
+ PaymentSchedulesCreatedContent &
54
+ FeatureActivatedContent &
55
+ PaymentSourceLocallyDeletedContent &
56
+ InvoiceGeneratedContent &
57
+ VoucherExpiredContent &
58
+ AuthorizationSucceededContent &
59
+ GiftScheduledContent &
60
+ SubscriptionChangesScheduledContent &
61
+ SubscriptionChangedWithBackdatingContent &
62
+ OmnichannelSubscriptionItemChangedContent &
63
+ GiftUnclaimedContent &
64
+ VirtualBankAccountAddedContent &
65
+ PaymentIntentCreatedContent &
66
+ CreditNoteCreatedWithBackdatingContent &
67
+ ContractTermTerminatedContent &
68
+ ItemFamilyUpdatedContent &
69
+ OrderCreatedContent &
70
+ PriceVariantDeletedContent &
71
+ SubscriptionMovementFailedContent &
72
+ CustomerMovedInContent &
73
+ SubscriptionAdvanceInvoiceScheduleUpdatedContent &
74
+ ItemDeletedContent &
75
+ SubscriptionRampDraftedContent &
76
+ DunningUpdatedContent &
77
+ ItemEntitlementsUpdatedContent &
78
+ TokenConsumedContent &
79
+ HierarchyDeletedContent &
80
+ SubscriptionCancellationScheduledContent &
81
+ SubscriptionRenewedContent &
82
+ FeatureUpdatedContent &
83
+ FeatureDeletedContent &
84
+ ItemFamilyCreatedContent &
85
+ OmnichannelSubscriptionItemScheduledChangeRemovedContent &
86
+ OmnichannelSubscriptionItemResumedContent &
87
+ PurchaseCreatedContent &
88
+ EntitlementOverridesUpdatedContent &
89
+ ItemFamilyDeletedContent &
90
+ SubscriptionResumptionScheduledContent &
91
+ FeatureReactivatedContent &
92
+ CouponCodesDeletedContent &
93
+ CardExpiredContent &
94
+ CreditNoteUpdatedContent &
95
+ OmnichannelSubscriptionItemDowngradedContent &
96
+ PriceVariantUpdatedContent &
97
+ PromotionalCreditsDeductedContent &
98
+ SubscriptionRampAppliedContent &
99
+ SubscriptionPausedContent &
100
+ OrderReadyToProcessContent &
101
+ FeatureCreatedContent &
102
+ TransactionDeletedContent &
103
+ CreditNoteCreatedContent &
104
+ OmnichannelSubscriptionItemResubscribedContent &
105
+ RecordPurchaseFailedContent &
106
+ ItemCreatedContent &
107
+ TransactionUpdatedContent &
108
+ MrrUpdatedContent &
109
+ UnbilledChargesInvoicedContent &
110
+ ItemPriceUpdatedContent &
111
+ CouponCodesUpdatedContent &
112
+ VirtualBankAccountUpdatedContent &
113
+ ContractTermCreatedContent &
114
+ SubscriptionChangedContent &
115
+ PaymentFailedContent &
116
+ CreditNoteDeletedContent &
117
+ TaxWithheldRefundedContent &
118
+ ContractTermCompletedContent &
119
+ PaymentSchedulesUpdatedContent &
120
+ OmnichannelSubscriptionItemExpiredContent &
121
+ CardUpdatedContent &
122
+ CustomerCreatedContent &
123
+ SubscriptionRenewalReminderContent &
124
+ OrderDeliveredContent &
125
+ OmnichannelSubscriptionItemCancellationScheduledContent &
126
+ OmnichannelSubscriptionItemGracePeriodExpiredContent &
127
+ CouponCodesAddedContent &
128
+ GiftCancelledContent &
129
+ OrderCancelledContent &
130
+ CouponDeletedContent &
131
+ SubscriptionScheduledChangesRemovedContent &
132
+ PendingInvoiceCreatedContent &
133
+ EntitlementOverridesAutoRemovedContent &
134
+ OmnichannelSubscriptionItemUpgradedContent &
135
+ SubscriptionBusinessEntityChangedContent &
136
+ OmnichannelOneTimeOrderCreatedContent &
137
+ PaymentSourceDeletedContent &
138
+ OmnichannelSubscriptionItemCancelledContent &
139
+ QuoteDeletedContent &
140
+ InvoiceUpdatedContent &
141
+ SubscriptionAdvanceInvoiceScheduleRemovedContent &
142
+ CardDeletedContent &
143
+ OrderReadyToShipContent &
144
+ SubscriptionMovedOutContent &
145
+ PaymentScheduleSchemeCreatedContent &
146
+ BusinessEntityUpdatedContent &
147
+ SubscriptionScheduledResumptionRemovedContent &
148
+ PaymentInitiatedContent &
149
+ FeatureArchivedContent &
150
+ SubscriptionReactivatedWithBackdatingContent &
151
+ OmnichannelSubscriptionImportedContent &
152
+ TokenExpiredContent &
153
+ CardAddedContent &
154
+ CouponCreatedContent &
155
+ RuleDeletedContent &
156
+ ItemPriceEntitlementsUpdatedContent &
157
+ ItemPriceDeletedContent &
158
+ VirtualBankAccountDeletedContent &
159
+ PaymentScheduleSchemeDeletedContent &
160
+ SubscriptionCreatedContent &
161
+ SubscriptionEntitlementsCreatedContent &
162
+ OrderReturnedContent &
163
+ SubscriptionDeletedContent &
164
+ PaymentSourceAddedContent &
165
+ SubscriptionMovedInContent &
166
+ ItemPriceCreatedContent &
167
+ SubscriptionScheduledCancellationRemovedContent &
168
+ PaymentRefundedContent &
169
+ UsageFileIngestedContent &
170
+ OmnichannelSubscriptionMovedInContent &
171
+ DifferentialPriceCreatedContent &
172
+ TransactionCreatedContent &
173
+ PaymentSucceededContent &
174
+ SubscriptionCanceledWithBackdatingContent &
175
+ UnbilledChargesVoidedContent &
176
+ QuoteCreatedContent &
177
+ CouponSetDeletedContent &
178
+ AttachedItemCreatedContent &
179
+ SalesOrderCreatedContent &
180
+ CustomerChangedContent &
181
+ SubscriptionStartedContent &
182
+ SubscriptionActivatedContent &
183
+ PaymentSourceExpiringContent &
184
+ SubscriptionReactivatedContent &
185
+ OrderUpdatedContent &
186
+ SubscriptionScheduledPauseRemovedContent &
187
+ SubscriptionCancellationReminderContent &
188
+ SubscriptionCreatedWithBackdatingContent &
189
+ SubscriptionRampCreatedContent &
190
+ OrderDeletedContent &
191
+ OmnichannelSubscriptionItemPauseScheduledContent &
192
+ GiftUpdatedContent &
193
+ SubscriptionTrialExtendedContent &
194
+ OmnichannelSubscriptionItemGracePeriodStartedContent &
195
+ CardExpiryReminderContent &
196
+ TokenCreatedContent &
197
+ PromotionalCreditsAddedContent &
198
+ SubscriptionRampUpdatedContent &
199
+ CustomerEntitlementsUpdatedContent &
200
+ PaymentSourceExpiredContent &
201
+ CustomerMovedOutContent &
202
+ SubscriptionEntitlementsUpdatedContent &
203
+ OmnichannelSubscriptionItemDunningExpiredContent &
204
+ HierarchyCreatedContent &
205
+ AttachedItemDeletedContent &
206
+ OmnichannelSubscriptionItemScheduledCancellationRemovedContent &
207
+ ItemUpdatedContent &
208
+ CouponSetCreatedContent &
209
+ PaymentIntentUpdatedContent &
210
+ OrderResentContent &
211
+ OmnichannelSubscriptionCreatedContent &
212
+ TaxWithheldRecordedContent &
213
+ PriceVariantCreatedContent &
214
+ DifferentialPriceDeletedContent &
215
+ SubscriptionItemsRenewedContent &
216
+ RuleCreatedContent &
217
+ ContractTermCancelledContent &
218
+ ContractTermRenewedContent &
219
+ InvoiceDeletedContent &
220
+ ItemPriceEntitlementsRemovedContent &
221
+ SalesOrderUpdatedContent &
222
+ OmnichannelSubscriptionItemDunningStartedContent &
223
+ OmnichannelSubscriptionItemChangeScheduledContent &
224
+ PendingInvoiceUpdatedContent &
225
+ QuoteUpdatedContent &
226
+ AttachedItemUpdatedContent &
227
+ PaymentSourceUpdatedContent &
228
+ BusinessEntityDeletedContent &
229
+ AuthorizationVoidedContent &
230
+ SubscriptionRampDeletedContent;
24
231
  origin_user?: string;
25
232
  }
26
233
 
@@ -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;
@@ -28,7 +29,7 @@ declare module 'chargebee' {
28
29
  embed: boolean;
29
30
  created_at?: number;
30
31
  expires_at?: number;
31
- content: any;
32
+ content: Content;
32
33
  updated_at?: number;
33
34
  resource_version?: number;
34
35
  checkout_info?: any;
@@ -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;
@@ -3,6 +3,7 @@
3
3
  ///<reference path='./filter.d.ts'/>
4
4
  declare module 'chargebee' {
5
5
  export interface Invoice {
6
+ [key: string]: unknown;
6
7
  id: string;
7
8
  customer_id: string;
8
9
  payment_owner?: string;
@@ -776,7 +777,6 @@ declare module 'chargebee' {
776
777
  country?: string;
777
778
  zip?: string;
778
779
  validation_status?: ValidationStatusEnum;
779
- index: number;
780
780
  }
781
781
  export interface BillingAddress {
782
782
  first_name?: string;
@@ -880,6 +880,7 @@ declare module 'chargebee' {
880
880
  notes_to_remove?: NotesToRemoveCreateForChargeItemsAndChargesInputParam[];
881
881
  tax_providers_fields?: TaxProvidersFieldsCreateForChargeItemsAndChargesInputParam[];
882
882
  discounts?: DiscountsCreateForChargeItemsAndChargesInputParam[];
883
+ [key: `cf_${string}`]: unknown;
883
884
  }
884
885
  export interface ChargeInputParam {
885
886
  customer_id?: string;
@@ -985,6 +986,7 @@ declare module 'chargebee' {
985
986
  payments?: PaymentsImportInvoiceInputParam[];
986
987
  notes?: NotesImportInvoiceInputParam[];
987
988
  line_item_addresses?: LineItemAddressesImportInvoiceInputParam[];
989
+ [key: `cf_${string}`]: unknown;
988
990
  }
989
991
  export interface ApplyPaymentsInputParam {
990
992
  comment?: string;
@@ -1083,6 +1085,7 @@ declare module 'chargebee' {
1083
1085
  remove_general_note?: boolean;
1084
1086
  invoice_date?: number;
1085
1087
  notes_to_remove?: NotesToRemoveCloseInputParam[];
1088
+ [key: `cf_${string}`]: unknown;
1086
1089
  }
1087
1090
  export interface CollectPaymentInputParam {
1088
1091
  amount?: number;
@@ -1137,6 +1140,7 @@ declare module 'chargebee' {
1137
1140
  billing_address?: BillingAddressUpdateDetailsInputParam;
1138
1141
  shipping_address?: ShippingAddressUpdateDetailsInputParam;
1139
1142
  statement_descriptor?: StatementDescriptorUpdateDetailsInputParam;
1143
+ [key: `cf_${string}`]: unknown;
1140
1144
  }
1141
1145
  export interface ApplyPaymentScheduleSchemeInputParam {
1142
1146
  scheme_id: string;
@@ -12,15 +12,15 @@ declare module 'chargebee' {
12
12
  amount_paid?: number;
13
13
  amount_due?: number;
14
14
  line_items?: InvoiceEstimate.LineItem[];
15
- discounts?: InvoiceEstimate.Discount[];
16
- taxes?: InvoiceEstimate.Tax[];
17
- line_item_taxes?: InvoiceEstimate.LineItemTax[];
18
15
  line_item_tiers?: InvoiceEstimate.LineItemTier[];
19
- line_item_credits?: InvoiceEstimate.LineItemCredit[];
20
16
  line_item_discounts?: InvoiceEstimate.LineItemDiscount[];
17
+ line_item_taxes?: InvoiceEstimate.LineItemTax[];
18
+ line_item_credits?: InvoiceEstimate.LineItemCredit[];
19
+ line_item_addresses?: InvoiceEstimate.LineItemAddress[];
20
+ discounts?: InvoiceEstimate.Discount[];
21
+ taxes?: InvoiceEstimate.Tax[];
21
22
  round_off_amount?: number;
22
23
  customer_id?: string;
23
- line_item_addresses?: InvoiceEstimate.LineItemAddress[];
24
24
  }
25
25
 
26
26
  export namespace InvoiceEstimate {
@@ -73,24 +73,31 @@ declare module 'chargebee' {
73
73
  entity_id?: string;
74
74
  customer_id?: string;
75
75
  }
76
- export interface Discount {
77
- amount: number;
78
- description?: string;
79
- entity_type:
76
+ export interface LineItemTier {
77
+ line_item_id?: string;
78
+ starting_unit: number;
79
+ ending_unit?: number;
80
+ quantity_used: number;
81
+ unit_amount: number;
82
+ starting_unit_in_decimal?: string;
83
+ ending_unit_in_decimal?: string;
84
+ quantity_used_in_decimal?: string;
85
+ unit_amount_in_decimal?: string;
86
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
87
+ package_size?: number;
88
+ }
89
+ export interface LineItemDiscount {
90
+ line_item_id: string;
91
+ discount_type:
80
92
  | 'item_level_coupon'
81
93
  | 'document_level_coupon'
82
94
  | 'promotional_credits'
83
95
  | 'prorated_credits'
84
96
  | 'item_level_discount'
85
97
  | 'document_level_discount';
86
- discount_type?: 'fixed_amount' | 'percentage';
98
+ coupon_id?: string;
87
99
  entity_id?: string;
88
- coupon_set_code?: string;
89
- }
90
- export interface Tax {
91
- name: string;
92
- amount: number;
93
- description?: string;
100
+ discount_amount: number;
94
101
  }
95
102
  export interface LineItemTax {
96
103
  line_item_id?: string;
@@ -117,37 +124,11 @@ declare module 'chargebee' {
117
124
  tax_amount_in_local_currency?: number;
118
125
  local_currency_code?: string;
119
126
  }
120
- export interface LineItemTier {
121
- line_item_id?: string;
122
- starting_unit: number;
123
- ending_unit?: number;
124
- quantity_used: number;
125
- unit_amount: number;
126
- starting_unit_in_decimal?: string;
127
- ending_unit_in_decimal?: string;
128
- quantity_used_in_decimal?: string;
129
- unit_amount_in_decimal?: string;
130
- pricing_type?: 'per_unit' | 'flat_fee' | 'package';
131
- package_size?: number;
132
- }
133
127
  export interface LineItemCredit {
134
128
  cn_id: string;
135
129
  applied_amount: number;
136
130
  line_item_id?: string;
137
131
  }
138
- export interface LineItemDiscount {
139
- line_item_id: string;
140
- discount_type:
141
- | 'item_level_coupon'
142
- | 'document_level_coupon'
143
- | 'promotional_credits'
144
- | 'prorated_credits'
145
- | 'item_level_discount'
146
- | 'document_level_discount';
147
- coupon_id?: string;
148
- entity_id?: string;
149
- discount_amount: number;
150
- }
151
132
  export interface LineItemAddress {
152
133
  line_item_id?: string;
153
134
  first_name?: string;
@@ -169,6 +150,25 @@ declare module 'chargebee' {
169
150
  | 'partially_valid'
170
151
  | 'invalid';
171
152
  }
153
+ export interface Discount {
154
+ amount: number;
155
+ description?: string;
156
+ entity_type:
157
+ | 'item_level_coupon'
158
+ | 'document_level_coupon'
159
+ | 'promotional_credits'
160
+ | 'prorated_credits'
161
+ | 'item_level_discount'
162
+ | 'document_level_discount';
163
+ discount_type?: 'fixed_amount' | 'percentage';
164
+ entity_id?: string;
165
+ coupon_set_code?: string;
166
+ }
167
+ export interface Tax {
168
+ name: string;
169
+ amount: number;
170
+ description?: string;
171
+ }
172
172
  // REQUEST PARAMS
173
173
  //---------------
174
174
  }
@@ -0,0 +1,25 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface OfferEvent {}
6
+
7
+ export namespace OfferEvent {
8
+ export class OfferEventResource {
9
+ offerEvents(
10
+ input: OfferEventsInputParam,
11
+ headers?: ChargebeeRequestHeader,
12
+ ): Promise<ChargebeeResponse<OfferEventsResponse>>;
13
+ }
14
+
15
+ export interface OfferEventsResponse {}
16
+
17
+ // REQUEST PARAMS
18
+ //---------------
19
+
20
+ export interface OfferEventsInputParam {
21
+ personalized_offer_id: string;
22
+ type: 'viewed' | 'dismissed';
23
+ }
24
+ }
25
+ }