chargebee 3.12.0 → 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.
@@ -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
+ }
@@ -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
+ }