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
@@ -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;
@@ -60,6 +61,7 @@ declare module 'chargebee' {
60
61
  taxes?: Invoice.Tax[];
61
62
  tax_origin?: Invoice.TaxOrigin;
62
63
  linked_payments?: Invoice.LinkedPayment[];
64
+ reference_transactions?: Invoice.ReferenceTransaction[];
63
65
  dunning_attempts?: Invoice.DunningAttempt[];
64
66
  applied_credits?: Invoice.AppliedCredit[];
65
67
  adjustment_credit_notes?: Invoice.AdjustmentCreditNote[];
@@ -613,6 +615,7 @@ declare module 'chargebee' {
613
615
  export interface Discount {
614
616
  amount: number;
615
617
  description?: string;
618
+ line_item_id?: string;
616
619
  entity_type:
617
620
  | 'item_level_coupon'
618
621
  | 'document_level_coupon'
@@ -648,6 +651,27 @@ declare module 'chargebee' {
648
651
  txn_date?: number;
649
652
  txn_amount?: number;
650
653
  }
654
+ export interface ReferenceTransaction {
655
+ applied_amount: number;
656
+ applied_at: number;
657
+ txn_id: string;
658
+ txn_status?:
659
+ | 'in_progress'
660
+ | 'success'
661
+ | 'voided'
662
+ | 'failure'
663
+ | 'timeout'
664
+ | 'needs_attention'
665
+ | 'late_failure';
666
+ txn_date?: number;
667
+ txn_amount?: number;
668
+ txn_type: 'authorization' | 'payment' | 'refund' | 'payment_reversal';
669
+ amount_capturable: number;
670
+ authorization_reason?:
671
+ | 'verification'
672
+ | 'blocking_funds'
673
+ | 'scheduled_capture';
674
+ }
651
675
  export interface DunningAttempt {
652
676
  attempt: number;
653
677
  transaction_id?: string;
@@ -776,7 +800,6 @@ declare module 'chargebee' {
776
800
  country?: string;
777
801
  zip?: string;
778
802
  validation_status?: ValidationStatusEnum;
779
- index: number;
780
803
  }
781
804
  export interface BillingAddress {
782
805
  first_name?: string;
@@ -880,6 +903,7 @@ declare module 'chargebee' {
880
903
  notes_to_remove?: NotesToRemoveCreateForChargeItemsAndChargesInputParam[];
881
904
  tax_providers_fields?: TaxProvidersFieldsCreateForChargeItemsAndChargesInputParam[];
882
905
  discounts?: DiscountsCreateForChargeItemsAndChargesInputParam[];
906
+ [key: `cf_${string}`]: unknown;
883
907
  }
884
908
  export interface ChargeInputParam {
885
909
  customer_id?: string;
@@ -985,6 +1009,7 @@ declare module 'chargebee' {
985
1009
  payments?: PaymentsImportInvoiceInputParam[];
986
1010
  notes?: NotesImportInvoiceInputParam[];
987
1011
  line_item_addresses?: LineItemAddressesImportInvoiceInputParam[];
1012
+ [key: `cf_${string}`]: unknown;
988
1013
  }
989
1014
  export interface ApplyPaymentsInputParam {
990
1015
  comment?: string;
@@ -1083,6 +1108,7 @@ declare module 'chargebee' {
1083
1108
  remove_general_note?: boolean;
1084
1109
  invoice_date?: number;
1085
1110
  notes_to_remove?: NotesToRemoveCloseInputParam[];
1111
+ [key: `cf_${string}`]: unknown;
1086
1112
  }
1087
1113
  export interface CollectPaymentInputParam {
1088
1114
  amount?: number;
@@ -1137,6 +1163,7 @@ declare module 'chargebee' {
1137
1163
  billing_address?: BillingAddressUpdateDetailsInputParam;
1138
1164
  shipping_address?: ShippingAddressUpdateDetailsInputParam;
1139
1165
  statement_descriptor?: StatementDescriptorUpdateDetailsInputParam;
1166
+ [key: `cf_${string}`]: unknown;
1140
1167
  }
1141
1168
  export interface ApplyPaymentScheduleSchemeInputParam {
1142
1169
  scheme_id: string;
@@ -1532,6 +1559,7 @@ declare module 'chargebee' {
1532
1559
  note?: string;
1533
1560
  }
1534
1561
  export interface DiscountsImportInvoiceInputParam {
1562
+ line_item_id?: string;
1535
1563
  entity_type:
1536
1564
  | 'item_level_coupon'
1537
1565
  | 'document_level_coupon'
@@ -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,26 @@ declare module 'chargebee' {
169
150
  | 'partially_valid'
170
151
  | 'invalid';
171
152
  }
153
+ export interface Discount {
154
+ amount: number;
155
+ description?: string;
156
+ line_item_id?: string;
157
+ entity_type:
158
+ | 'item_level_coupon'
159
+ | 'document_level_coupon'
160
+ | 'promotional_credits'
161
+ | 'prorated_credits'
162
+ | 'item_level_discount'
163
+ | 'document_level_discount';
164
+ discount_type?: 'fixed_amount' | 'percentage';
165
+ entity_id?: string;
166
+ coupon_set_code?: string;
167
+ }
168
+ export interface Tax {
169
+ name: string;
170
+ amount: number;
171
+ description?: string;
172
+ }
172
173
  // REQUEST PARAMS
173
174
  //---------------
174
175
  }
@@ -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
+ }
@@ -0,0 +1,77 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface OfferFulfillment {
6
+ id: string;
7
+ personalized_offer_id: string;
8
+ option_id: string;
9
+ processing_type:
10
+ | 'billing_update'
11
+ | 'checkout'
12
+ | 'url_redirect'
13
+ | 'webhook'
14
+ | 'email';
15
+ status: 'in_progress' | 'completed' | 'failed';
16
+ redirect_url?: string;
17
+ failed_at?: number;
18
+ created_at: number;
19
+ completed_at?: number;
20
+ error?: OfferFulfillment.Error;
21
+ }
22
+
23
+ export namespace OfferFulfillment {
24
+ export class OfferFulfillmentResource {
25
+ offerFulfillments(
26
+ input: OfferFulfillmentsInputParam,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<OfferFulfillmentsResponse>>;
29
+
30
+ offerFulfillmentsGet(
31
+ offer_fulfillment_id: string,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<OfferFulfillmentsGetResponse>>;
34
+
35
+ offerFulfillmentsUpdate(
36
+ offer_fulfillment_id: string,
37
+ input: OfferFulfillmentsUpdateInputParam,
38
+ headers?: ChargebeeRequestHeader,
39
+ ): Promise<ChargebeeResponse<OfferFulfillmentsUpdateResponse>>;
40
+ }
41
+
42
+ export interface OfferFulfillmentsResponse {
43
+ offer_fulfillment: OfferFulfillment;
44
+ hosted_page?: HostedPage;
45
+ }
46
+
47
+ export interface OfferFulfillmentsGetResponse {
48
+ offer_fulfillment: OfferFulfillment;
49
+ }
50
+
51
+ export interface OfferFulfillmentsUpdateResponse {
52
+ offer_fulfillment: OfferFulfillment;
53
+ }
54
+
55
+ export interface Error {
56
+ code:
57
+ | 'billing_update_failed'
58
+ | 'checkout_abandoned'
59
+ | 'external_fulfillment_failed'
60
+ | 'internal_error'
61
+ | 'fulfillment_expired';
62
+ message: string;
63
+ }
64
+ // REQUEST PARAMS
65
+ //---------------
66
+
67
+ export interface OfferFulfillmentsInputParam {
68
+ personalized_offer_id: string;
69
+ option_id: string;
70
+ }
71
+ export interface OfferFulfillmentsUpdateInputParam {
72
+ id: string;
73
+ status: 'completed' | 'failed';
74
+ failure_reason?: string;
75
+ }
76
+ }
77
+ }
@@ -12,7 +12,7 @@ declare module 'chargebee' {
12
12
  created_at: number;
13
13
  resource_version?: number;
14
14
  omnichannel_one_time_order_items: OmnichannelOneTimeOrderItem[];
15
- purchase_transaction?: OmnichannelOneTimeOrder.OmnichannelTransaction;
15
+ purchase_transaction?: OmnichannelTransaction;
16
16
  }
17
17
 
18
18
  export namespace OmnichannelOneTimeOrder {
@@ -37,18 +37,6 @@ declare module 'chargebee' {
37
37
  next_offset?: string;
38
38
  }
39
39
 
40
- export interface OmnichannelTransaction {
41
- id: string;
42
- id_at_source: string;
43
- app_id: string;
44
- price_currency?: string;
45
- price_units?: number;
46
- price_nanos?: number;
47
- type: 'purchase' | 'renewal';
48
- transacted_at?: number;
49
- created_at: number;
50
- resource_version?: number;
51
- }
52
40
  // REQUEST PARAMS
53
41
  //---------------
54
42
 
@@ -11,7 +11,7 @@ declare module 'chargebee' {
11
11
  created_at: number;
12
12
  resource_version?: number;
13
13
  omnichannel_subscription_items: OmnichannelSubscriptionItem[];
14
- initial_purchase_transaction?: OmnichannelSubscription.OmnichannelTransaction;
14
+ initial_purchase_transaction?: OmnichannelTransaction;
15
15
  }
16
16
 
17
17
  export namespace OmnichannelSubscription {
@@ -33,6 +33,12 @@ declare module 'chargebee' {
33
33
  ): Promise<
34
34
  ChargebeeResponse<OmnichannelTransactionsForOmnichannelSubscriptionResponse>
35
35
  >;
36
+
37
+ move(
38
+ omnichannel_subscription_id: string,
39
+ input: MoveInputParam,
40
+ headers?: ChargebeeRequestHeader,
41
+ ): Promise<ChargebeeResponse<MoveResponse>>;
36
42
  }
37
43
 
38
44
  export interface RetrieveResponse {
@@ -49,18 +55,10 @@ declare module 'chargebee' {
49
55
  next_offset?: string;
50
56
  }
51
57
 
52
- export interface OmnichannelTransaction {
53
- id: string;
54
- id_at_source: string;
55
- app_id: string;
56
- price_currency?: string;
57
- price_units?: number;
58
- price_nanos?: number;
59
- type: 'purchase' | 'renewal';
60
- transacted_at?: number;
61
- created_at: number;
62
- resource_version?: number;
58
+ export interface MoveResponse {
59
+ omnichannel_subscription: OmnichannelSubscription;
63
60
  }
61
+
64
62
  // REQUEST PARAMS
65
63
  //---------------
66
64
 
@@ -74,5 +72,8 @@ declare module 'chargebee' {
74
72
  limit?: number;
75
73
  offset?: string;
76
74
  }
75
+ export interface MoveInputParam {
76
+ to_customer_id: string;
77
+ }
77
78
  }
78
79
  }
@@ -29,6 +29,7 @@ declare module 'chargebee' {
29
29
  resumes_at?: number;
30
30
  has_scheduled_changes: boolean;
31
31
  resource_version?: number;
32
+ omnichannel_subscription_item_offers?: OmnichannelSubscriptionItemOffer[];
32
33
  upcoming_renewal?: OmnichannelSubscriptionItem.UpcomingRenewal;
33
34
  linked_item?: OmnichannelSubscriptionItem.LinkedItem;
34
35
  }
@@ -0,0 +1,22 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface OmnichannelSubscriptionItemOffer {
6
+ id: string;
7
+ offer_id_at_source?: string;
8
+ category: CategoryEnum;
9
+ category_at_source?: string;
10
+ type: TypeEnum;
11
+ type_at_source?: string;
12
+ discount_type?: DiscountTypeEnum;
13
+ duration: string;
14
+ percentage?: number;
15
+ price_currency?: string;
16
+ price_units?: number;
17
+ price_nanos?: number;
18
+ offer_term_start?: number;
19
+ offer_term_end?: number;
20
+ resource_version?: number;
21
+ }
22
+ }
@@ -13,5 +13,18 @@ declare module 'chargebee' {
13
13
  transacted_at?: number;
14
14
  created_at: number;
15
15
  resource_version?: number;
16
+ linked_omnichannel_subscriptions?: OmnichannelTransaction.LinkedOmnichannelSubscription[];
17
+ linked_omnichannel_one_time_orders?: OmnichannelTransaction.LinkedOmnichannelOneTimeOrder[];
18
+ }
19
+
20
+ export namespace OmnichannelTransaction {
21
+ export interface LinkedOmnichannelSubscription {
22
+ omnichannel_subscription_id?: string;
23
+ }
24
+ export interface LinkedOmnichannelOneTimeOrder {
25
+ omnichannel_one_time_order_id?: string;
26
+ }
27
+ // REQUEST PARAMS
28
+ //---------------
16
29
  }
17
30
  }
@@ -258,7 +258,6 @@ declare module 'chargebee' {
258
258
  country?: string;
259
259
  zip?: string;
260
260
  validation_status?: ValidationStatusEnum;
261
- index: number;
262
261
  }
263
262
  export interface BillingAddress {
264
263
  first_name?: string;
@@ -41,6 +41,7 @@ declare module 'chargebee' {
41
41
  customer_id: string;
42
42
  gateway?: string;
43
43
  active_payment_attempt?: PaymentIntent.PaymentAttempt;
44
+ payment_attempts?: PaymentIntent.PaymentAttempt[];
44
45
  business_entity_id?: string;
45
46
  }
46
47
 
@@ -110,6 +111,47 @@ declare module 'chargebee' {
110
111
  id_at_gateway?: string;
111
112
  error_code?: string;
112
113
  error_text?: string;
114
+ checkout_details?: string;
115
+ created_at: number;
116
+ modified_at: number;
117
+ error_detail?: GatewayErrorDetail;
118
+ }
119
+ export interface PaymentAttempt {
120
+ id?: string;
121
+ status:
122
+ | 'inited'
123
+ | 'requires_identification'
124
+ | 'requires_challenge'
125
+ | 'requires_redirection'
126
+ | 'authorized'
127
+ | 'refused'
128
+ | 'pending_authorization';
129
+ payment_method_type?:
130
+ | 'card'
131
+ | 'ideal'
132
+ | 'sofort'
133
+ | 'bancontact'
134
+ | 'google_pay'
135
+ | 'dotpay'
136
+ | 'giropay'
137
+ | 'apple_pay'
138
+ | 'upi'
139
+ | 'netbanking_emandates'
140
+ | 'paypal_express_checkout'
141
+ | 'direct_debit'
142
+ | 'boleto'
143
+ | 'venmo'
144
+ | 'amazon_payments'
145
+ | 'pay_to'
146
+ | 'faster_payments'
147
+ | 'sepa_instant_transfer'
148
+ | 'klarna_pay_now'
149
+ | 'online_banking_poland'
150
+ | 'payconiq_by_bancontact';
151
+ id_at_gateway?: string;
152
+ error_code?: string;
153
+ error_text?: string;
154
+ checkout_details?: string;
113
155
  created_at: number;
114
156
  modified_at: number;
115
157
  error_detail?: GatewayErrorDetail;
@@ -0,0 +1,64 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface PersonalizedOffer {
6
+ id: string;
7
+ offer_id: string;
8
+ content: PersonalizedOffer.Content;
9
+ options: PersonalizedOffer.Option[];
10
+ }
11
+
12
+ export namespace PersonalizedOffer {
13
+ export class PersonalizedOfferResource {
14
+ personalizedOffers(
15
+ input: PersonalizedOffersInputParam,
16
+ headers?: ChargebeeRequestHeader,
17
+ ): Promise<ChargebeeResponse<PersonalizedOffersResponse>>;
18
+ }
19
+
20
+ export interface PersonalizedOffersResponse {
21
+ personalized_offers: PersonalizedOffer[];
22
+ brand?: Brand;
23
+ expires_at: number;
24
+ }
25
+
26
+ export interface Content {
27
+ title: string;
28
+ description: string;
29
+ }
30
+ export interface Option {
31
+ id: string;
32
+ label: string;
33
+ processing_type:
34
+ | 'billing_update'
35
+ | 'checkout'
36
+ | 'url_redirect'
37
+ | 'webhook'
38
+ | 'email';
39
+ processing_layout: 'in_app' | 'full_page';
40
+ redirect_url: string;
41
+ }
42
+ // REQUEST PARAMS
43
+ //---------------
44
+
45
+ export interface PersonalizedOffersInputParam {
46
+ first_name?: string;
47
+ last_name?: string;
48
+ email?: string;
49
+ roles?: string[];
50
+ external_user_id?: string;
51
+ subscription_id?: string;
52
+ customer_id: string;
53
+ custom?: any;
54
+ request_context?: RequestContextPersonalizedOffersInputParam;
55
+ }
56
+ export interface RequestContextPersonalizedOffersInputParam {
57
+ user_agent?: string;
58
+ locale?: string;
59
+ timezone?: string;
60
+ url?: string;
61
+ referrer_url?: string;
62
+ }
63
+ }
64
+ }