chargebee 3.12.0-beta.1 → 3.13.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 (40) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +30 -1
  3. package/cjs/environment.js +1 -1
  4. package/cjs/resources/api_endpoints.js +75 -4
  5. package/esm/environment.js +1 -1
  6. package/esm/resources/api_endpoints.js +75 -4
  7. package/package.json +2 -2
  8. package/types/core.d.ts +8 -1
  9. package/types/index.d.ts +17 -0
  10. package/types/resources/BusinessEntityChange.d.ts +16 -0
  11. package/types/resources/Comment.d.ts +4 -0
  12. package/types/resources/Content.d.ts +106 -0
  13. package/types/resources/CreditNote.d.ts +83 -76
  14. package/types/resources/Customer.d.ts +1 -0
  15. package/types/resources/CustomerEntitlement.d.ts +1 -0
  16. package/types/resources/Discount.d.ts +2 -1
  17. package/types/resources/Estimate.d.ts +4 -0
  18. package/types/resources/Event.d.ts +206 -1
  19. package/types/resources/HostedPage.d.ts +4 -1
  20. package/types/resources/ImpactedCustomer.d.ts +19 -0
  21. package/types/resources/Invoice.d.ts +86 -79
  22. package/types/resources/OmnichannelOneTimeOrder.d.ts +62 -0
  23. package/types/resources/OmnichannelOneTimeOrderItem.d.ts +20 -0
  24. package/types/resources/OmnichannelSubscriptionItemScheduledChange.d.ts +1 -1
  25. package/types/resources/PricingPageSession.d.ts +2 -0
  26. package/types/resources/Product.d.ts +135 -0
  27. package/types/resources/PromotionalCredit.d.ts +1 -0
  28. package/types/resources/Purchase.d.ts +2 -0
  29. package/types/resources/Quote.d.ts +6 -0
  30. package/types/resources/QuotedCharge.d.ts +5 -0
  31. package/types/resources/RecordedPurchase.d.ts +6 -0
  32. package/types/resources/SalesOrder.d.ts +143 -0
  33. package/types/resources/Subscription.d.ts +9 -2
  34. package/types/resources/SubscriptionEntitlementsCreatedDetail.d.ts +9 -0
  35. package/types/resources/SubscriptionEntitlementsUpdatedDetail.d.ts +9 -0
  36. package/types/resources/UsageFile.d.ts +8 -8
  37. package/types/resources/UsageReminderInfo.d.ts +9 -0
  38. package/types/resources/Variant.d.ts +116 -0
  39. package/types/resources/WebhookEndpoint.d.ts +98 -0
  40. package/types/resources/WebhookEvent.d.ts +1607 -0
@@ -0,0 +1,143 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface SalesOrder {
6
+ id: string;
7
+ version: number;
8
+ renewed_from_order_id?: string;
9
+ updated_at?: number;
10
+ created_at: number;
11
+ po_number?: string;
12
+ meta_data?: string;
13
+ quote_id?: string;
14
+ effective_date: number;
15
+ end_date?: number;
16
+ business_entity_id?: string;
17
+ customer_id: string;
18
+ currency_code: string;
19
+ line_items?: SalesOrder.LineItem[];
20
+ billing_addresses?: SalesOrder.BillingAddress[];
21
+ discounts?: SalesOrder.Discount[];
22
+ shipping_addresses?: SalesOrder.ShippingAddress[];
23
+ subscription_ids?: string[];
24
+ line_item_tiers?: SalesOrder.LineItemTier[];
25
+ payment_configuration?: SalesOrder.PaymentConfiguration;
26
+ billing_configuration?: SalesOrder.BillingConfiguration;
27
+ renewal_term?: SalesOrder.RenewalTerm;
28
+ status: 'active' | 'completed';
29
+ }
30
+
31
+ export namespace SalesOrder {
32
+ export interface LineItem {
33
+ id: string;
34
+ association_id?: string;
35
+ item_price_id: string;
36
+ name?: string;
37
+ quantity: string;
38
+ unit_price: string;
39
+ billing_period?: number;
40
+ billing_period_unit?: 'day' | 'week' | 'month' | 'year';
41
+ service_period_days?: number;
42
+ charge_on_event?:
43
+ | 'subscription_creation'
44
+ | 'subscription_trial_start'
45
+ | 'plan_activation'
46
+ | 'subscription_activation'
47
+ | 'contract_termination';
48
+ charge_once?: boolean;
49
+ billing_cycles?: number;
50
+ billing_type: 'recurring' | 'one_time' | 'event_based';
51
+ start_date: number;
52
+ end_date?: number;
53
+ trial_end?: number;
54
+ }
55
+ export interface BillingAddress {
56
+ first_name?: string;
57
+ last_name?: string;
58
+ email?: string;
59
+ company?: string;
60
+ phone?: string;
61
+ line1?: string;
62
+ line2?: string;
63
+ line3?: string;
64
+ city?: string;
65
+ state_code?: string;
66
+ state?: string;
67
+ country?: string;
68
+ zip?: string;
69
+ validation_status?:
70
+ | 'not_validated'
71
+ | 'valid'
72
+ | 'partially_valid'
73
+ | 'invalid';
74
+ }
75
+ export interface Discount {
76
+ id: string;
77
+ invoice_name?: string;
78
+ type: 'fixed_amount' | 'percentage';
79
+ apply_on: 'invoice_amount' | 'specific_item_price';
80
+ duration_type: 'one_time' | 'forever' | 'limited_period';
81
+ percentage?: number;
82
+ amount?: string;
83
+ coupon_id?: string;
84
+ period?: number;
85
+ period_unit?: 'day' | 'week' | 'month' | 'year';
86
+ item_price_id?: string;
87
+ start_date: number;
88
+ end_date?: number;
89
+ }
90
+ export interface ShippingAddress {
91
+ first_name?: string;
92
+ last_name?: string;
93
+ email?: string;
94
+ company?: string;
95
+ phone?: string;
96
+ line1?: string;
97
+ line2?: string;
98
+ line3?: string;
99
+ city?: string;
100
+ state_code?: string;
101
+ state?: string;
102
+ country?: string;
103
+ zip?: string;
104
+ validation_status?:
105
+ | 'not_validated'
106
+ | 'valid'
107
+ | 'partially_valid'
108
+ | 'invalid';
109
+ index: number;
110
+ }
111
+ export interface LineItemTier {
112
+ starting_unit: string;
113
+ ending_unit?: string;
114
+ price: string;
115
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
116
+ package_size?: number;
117
+ line_item_association_id?: string;
118
+ }
119
+ export interface PaymentConfiguration {
120
+ auto_collection?: AutoCollectionEnum;
121
+ payment_source_id?: string;
122
+ payment_intent_id?: string;
123
+ offline_payment_method?: OfflinePaymentMethodEnum;
124
+ }
125
+ export interface BillingConfiguration {
126
+ create_pending_invoices?: boolean;
127
+ invoice_immediately?: boolean;
128
+ first_invoice_pending?: boolean;
129
+ invoice_usages?: boolean;
130
+ net_term_days?: number;
131
+ invoice_date?: number;
132
+ billing_cycles_to_invoice?: number;
133
+ billing_alignment_mode?: BillingAlignmentModeEnum;
134
+ }
135
+ export interface RenewalTerm {
136
+ end_of_term_action: 'renew' | 'cancel' | 'evergreen';
137
+ cancellation_cutoff_period?: number;
138
+ renewal_billing_cycles?: number;
139
+ }
140
+ // REQUEST PARAMS
141
+ //---------------
142
+ }
143
+ }
@@ -689,9 +689,10 @@ declare module 'chargebee' {
689
689
  export interface Discount {
690
690
  id: string;
691
691
  invoice_name?: string;
692
- type: 'fixed_amount' | 'percentage';
692
+ type: 'fixed_amount' | 'percentage' | 'offer_quantity';
693
693
  percentage?: number;
694
694
  amount?: number;
695
+ quantity?: number;
695
696
  currency_code?: string;
696
697
  duration_type: 'one_time' | 'forever' | 'limited_period';
697
698
  period?: number;
@@ -1659,6 +1660,7 @@ declare module 'chargebee' {
1659
1660
  period_unit?: PeriodUnitEnum;
1660
1661
  included_in_mrr?: boolean;
1661
1662
  item_price_id?: string;
1663
+ quantity?: number;
1662
1664
  }
1663
1665
  export interface CouponsCreateWithItemsInputParam {
1664
1666
  /**
@@ -2003,6 +2005,7 @@ declare module 'chargebee' {
2003
2005
  period_unit?: PeriodUnitEnum;
2004
2006
  included_in_mrr?: boolean;
2005
2007
  item_price_id?: string;
2008
+ quantity?: number;
2006
2009
  operation_type: OperationTypeEnum;
2007
2010
  id?: string;
2008
2011
  }
@@ -2341,7 +2344,10 @@ declare module 'chargebee' {
2341
2344
  | 'adhoc'
2342
2345
  | 'plan_item_price'
2343
2346
  | 'addon_item_price'
2344
- | 'charge_item_price';
2347
+ | 'charge_item_price'
2348
+ | 'plan_setup'
2349
+ | 'plan'
2350
+ | 'addon';
2345
2351
  entity_id?: string;
2346
2352
  description?: string;
2347
2353
  unit_amount?: number;
@@ -2412,6 +2418,7 @@ declare module 'chargebee' {
2412
2418
  period_unit?: PeriodUnitEnum;
2413
2419
  included_in_mrr?: boolean;
2414
2420
  item_price_id?: string;
2421
+ quantity?: number;
2415
2422
  }
2416
2423
  export interface CouponsImportForItemsInputParam {
2417
2424
  /**
@@ -0,0 +1,9 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface SubscriptionEntitlementsCreatedDetail {
6
+ subscription_id?: string;
7
+ has_next: boolean;
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface SubscriptionEntitlementsUpdatedDetail {
6
+ subscription_id?: string;
7
+ has_next: boolean;
8
+ }
9
+ }
@@ -22,22 +22,22 @@ declare module 'chargebee' {
22
22
 
23
23
  export namespace UsageFile {
24
24
  export class UsageFileResource {
25
- upload(
26
- input: UploadInputParam,
25
+ uploadUrl(
26
+ input: UploadUrlInputParam,
27
27
  headers?: ChargebeeRequestHeader,
28
- ): Promise<ChargebeeResponse<UploadResponse>>;
28
+ ): Promise<ChargebeeResponse<UploadUrlResponse>>;
29
29
 
30
- status(
30
+ processingStatus(
31
31
  usage_file_id: string,
32
32
  headers?: ChargebeeRequestHeader,
33
- ): Promise<ChargebeeResponse<StatusResponse>>;
33
+ ): Promise<ChargebeeResponse<ProcessingStatusResponse>>;
34
34
  }
35
35
 
36
- export interface UploadResponse {
36
+ export interface UploadUrlResponse {
37
37
  usage_file: UsageFile;
38
38
  }
39
39
 
40
- export interface StatusResponse {
40
+ export interface ProcessingStatusResponse {
41
41
  usage_file: UsageFile;
42
42
  }
43
43
 
@@ -48,7 +48,7 @@ declare module 'chargebee' {
48
48
  // REQUEST PARAMS
49
49
  //---------------
50
50
 
51
- export interface UploadInputParam {
51
+ export interface UploadUrlInputParam {
52
52
  file_name: string;
53
53
  mime_type: string;
54
54
  }
@@ -0,0 +1,9 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface UsageReminderInfo {
6
+ usage_date_start?: number;
7
+ usage_date_end?: number;
8
+ }
9
+ }
@@ -0,0 +1,116 @@
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 Variant {
6
+ id?: string;
7
+ name: string;
8
+ external_name?: string;
9
+ description?: string;
10
+ sku?: string;
11
+ deleted: boolean;
12
+ product_id: string;
13
+ status?: 'active' | 'inactive';
14
+ created_at: number;
15
+ resource_version?: number;
16
+ updated_at?: number;
17
+ option_values?: Variant.OptionValue[];
18
+ metadata?: any;
19
+ }
20
+
21
+ export namespace Variant {
22
+ export class VariantResource {
23
+ createProductVariant(
24
+ product_id: string,
25
+ input: CreateProductVariantInputParam,
26
+ headers?: ChargebeeRequestHeader,
27
+ ): Promise<ChargebeeResponse<CreateProductVariantResponse>>;
28
+
29
+ retrieve(
30
+ product_variant_id: string,
31
+ headers?: ChargebeeRequestHeader,
32
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
33
+
34
+ update(
35
+ product_variant_id: string,
36
+ input?: UpdateInputParam,
37
+ headers?: ChargebeeRequestHeader,
38
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
39
+
40
+ delete(
41
+ product_variant_id: string,
42
+ headers?: ChargebeeRequestHeader,
43
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
44
+
45
+ listProductVariants(
46
+ product_id: string,
47
+ input?: ListProductVariantsInputParam,
48
+ headers?: ChargebeeRequestHeader,
49
+ ): Promise<ChargebeeResponse<ListProductVariantsResponse>>;
50
+ }
51
+
52
+ export interface CreateProductVariantResponse {
53
+ variant: Variant;
54
+ }
55
+
56
+ export interface RetrieveResponse {
57
+ variant: Variant;
58
+ }
59
+
60
+ export interface UpdateResponse {
61
+ variant: Variant;
62
+ }
63
+
64
+ export interface DeleteResponse {
65
+ variant: Variant;
66
+ }
67
+
68
+ export interface ListProductVariantsResponse {
69
+ list: { variant: Variant }[];
70
+ next_offset?: string;
71
+ }
72
+
73
+ export interface OptionValue {
74
+ name?: string;
75
+ value?: string;
76
+ }
77
+ // REQUEST PARAMS
78
+ //---------------
79
+
80
+ export interface CreateProductVariantInputParam {
81
+ id?: string;
82
+ name: string;
83
+ external_name?: string;
84
+ description?: string;
85
+ sku?: string;
86
+ metadata?: any;
87
+ status?: 'active' | 'inactive';
88
+ option_values?: OptionValuesCreateProductVariantInputParam[];
89
+ }
90
+ export interface UpdateInputParam {
91
+ name?: string;
92
+ description?: string;
93
+ status?: 'active' | 'inactive';
94
+ external_name?: string;
95
+ sku?: string;
96
+ metadata?: any;
97
+ }
98
+ export interface ListProductVariantsInputParam {
99
+ limit?: number;
100
+ offset?: string;
101
+ include_deleted?: boolean;
102
+ id?: filter.String;
103
+ name?: filter.String;
104
+ sku?: filter.String;
105
+ status?: filter.Enum;
106
+ updated_at?: filter.Timestamp;
107
+ created_at?: filter.Timestamp;
108
+ 'sort_by[asc]'?: string;
109
+ 'sort_by[desc]'?: string;
110
+ }
111
+ export interface OptionValuesCreateProductVariantInputParam {
112
+ name: string;
113
+ value: string;
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,98 @@
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 WebhookEndpoint {
6
+ id: string;
7
+ name: string;
8
+ url: string;
9
+ send_card_resource?: boolean;
10
+ disabled: boolean;
11
+ primary_url: boolean;
12
+ api_version: 'v1' | 'v2';
13
+ chargebee_response_schema_type?: ChargebeeResponseSchemaTypeEnum;
14
+ enabled_events?: EventTypeEnum[];
15
+ }
16
+
17
+ export namespace WebhookEndpoint {
18
+ export class WebhookEndpointResource {
19
+ create(
20
+ input: CreateInputParam,
21
+ headers?: ChargebeeRequestHeader,
22
+ ): Promise<ChargebeeResponse<CreateResponse>>;
23
+
24
+ update(
25
+ webhook_endpoint_id: string,
26
+ input?: UpdateInputParam,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
29
+
30
+ retrieve(
31
+ webhook_endpoint_id: string,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
34
+
35
+ delete(
36
+ webhook_endpoint_id: string,
37
+ headers?: ChargebeeRequestHeader,
38
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
39
+
40
+ list(
41
+ input?: ListInputParam,
42
+ headers?: ChargebeeRequestHeader,
43
+ ): Promise<ChargebeeResponse<ListResponse>>;
44
+ }
45
+
46
+ export interface CreateResponse {
47
+ webhook_endpoint: WebhookEndpoint;
48
+ }
49
+
50
+ export interface UpdateResponse {
51
+ webhook_endpoint: WebhookEndpoint;
52
+ }
53
+
54
+ export interface RetrieveResponse {
55
+ webhook_endpoint: WebhookEndpoint;
56
+ }
57
+
58
+ export interface DeleteResponse {
59
+ webhook_endpoint: WebhookEndpoint;
60
+ }
61
+
62
+ export interface ListResponse {
63
+ list: { webhook_endpoint: WebhookEndpoint }[];
64
+ next_offset?: string;
65
+ }
66
+
67
+ // REQUEST PARAMS
68
+ //---------------
69
+
70
+ export interface CreateInputParam {
71
+ name: string;
72
+ api_version?: 'v1' | 'v2';
73
+ url: string;
74
+ primary_url?: boolean;
75
+ disabled?: boolean;
76
+ basic_auth_password?: string;
77
+ basic_auth_username?: string;
78
+ send_card_resource?: boolean;
79
+ chargebee_response_schema_type?: ChargebeeResponseSchemaTypeEnum;
80
+ enabled_events?: EventTypeEnum[];
81
+ }
82
+ export interface UpdateInputParam {
83
+ name?: string;
84
+ api_version?: 'v1' | 'v2';
85
+ url?: string;
86
+ primary_url?: boolean;
87
+ send_card_resource?: boolean;
88
+ basic_auth_password?: string;
89
+ basic_auth_username?: string;
90
+ disabled?: boolean;
91
+ enabled_events?: EventTypeEnum[];
92
+ }
93
+ export interface ListInputParam {
94
+ limit?: number;
95
+ offset?: string;
96
+ }
97
+ }
98
+ }