chargebee 2.26.0 → 2.26.1
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.
- package/CHANGELOG.md +4 -0
- package/lib/chargebee.js +1 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +245 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +305 -13
- package/types/resources/Card.d.ts +485 -13
- package/types/resources/Comment.d.ts +177 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +665 -20
- package/types/resources/CouponCode.d.ts +56 -5
- package/types/resources/CouponSet.d.ts +224 -17
- package/types/resources/CreditNote.d.ts +1202 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +2132 -73
- package/types/resources/DifferentialPrice.d.ts +266 -15
- package/types/resources/Discount.d.ts +107 -0
- package/types/resources/Download.d.ts +18 -0
- package/types/resources/EntitlementOverride.d.ts +101 -7
- package/types/resources/Estimate.d.ts +1181 -27
- package/types/resources/Event.d.ts +145 -8
- package/types/resources/Export.d.ts +703 -32
- package/types/resources/Feature.d.ts +356 -22
- package/types/resources/Gift.d.ts +351 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1212 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +636 -9
- package/types/resources/Invoice.d.ts +2293 -93
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +542 -16
- package/types/resources/ItemEntitlement.d.ts +172 -13
- package/types/resources/ItemFamily.d.ts +173 -15
- package/types/resources/ItemPrice.d.ts +971 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +51 -3
- package/types/resources/Order.d.ts +1224 -32
- package/types/resources/PaymentIntent.d.ts +318 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +1259 -55
- package/types/resources/PaymentVoucher.d.ts +262 -14
- package/types/resources/PortalSession.d.ts +187 -10
- package/types/resources/PromotionalCredit.d.ts +351 -16
- package/types/resources/Purchase.d.ts +274 -5
- package/types/resources/Quote.d.ts +1595 -62
- package/types/resources/QuoteLineGroup.d.ts +134 -5
- package/types/resources/QuotedCharge.d.ts +63 -5
- package/types/resources/QuotedSubscription.d.ts +192 -5
- package/types/resources/ResourceMigration.d.ts +73 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +3462 -137
- package/types/resources/SubscriptionEntitlement.d.ts +116 -8
- package/types/resources/SubscriptionEstimate.d.ts +36 -2
- package/types/resources/TaxWithheld.d.ts +32 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
- package/types/resources/TimeMachine.d.ts +99 -7
- package/types/resources/Token.d.ts +179 -7
- package/types/resources/Transaction.d.ts +597 -25
- package/types/resources/UnbilledCharge.d.ts +355 -14
- package/types/resources/Usage.d.ts +259 -13
- package/types/resources/VirtualBankAccount.d.ts +255 -17
|
@@ -1,82 +1,211 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface QuoteLineGroup {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description Version of the quote line group.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
version?:number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description Uniquely identifies a quote line group.
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
id?:string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description Subtotal in cents.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
sub_total:number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description Total in cents.
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
total?:number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description Credits (in cents) applied to this quote line group.
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
8
38
|
credits_applied?:number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @description Existing outstanding payments (in cents) if any, applied to this quote line group.
|
|
42
|
+
|
|
43
|
+
*/
|
|
44
|
+
|
|
9
45
|
amount_paid?:number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description Amount due in cents
|
|
49
|
+
|
|
50
|
+
*/
|
|
51
|
+
|
|
10
52
|
amount_due?:number;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @description Describes the time in the subscription lifecycle when the charge is to occur. \* subscription_creation - Subscription Creation \* trial_start - Trial Start \* subscription_renewal - Subscription Renewal \* subscription_change - Subscription Change \* subscription_cancel - Subscription Cancel \* immediate - Immediate
|
|
56
|
+
|
|
57
|
+
*/
|
|
58
|
+
|
|
11
59
|
charge_event?:'subscription_cancel' | 'immediate' | 'subscription_creation' | 'trial_start' | 'subscription_renewal' | 'subscription_change';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @description The serial number of the billing cycle of which the quote line group is a part.
|
|
63
|
+
|
|
64
|
+
*/
|
|
65
|
+
|
|
12
66
|
billing_cycle_number?:number;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @description The list of items in this quote line group.
|
|
70
|
+
|
|
71
|
+
*/
|
|
72
|
+
|
|
13
73
|
line_items?:QuoteLineGroup.LineItem[];
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @description The list of discounts applied to this quote line group.
|
|
77
|
+
|
|
78
|
+
*/
|
|
79
|
+
|
|
14
80
|
discounts?:QuoteLineGroup.Discount[];
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @description The list of discount(s) applied for line items in this quote line group.
|
|
84
|
+
|
|
85
|
+
*/
|
|
86
|
+
|
|
15
87
|
line_item_discounts?:QuoteLineGroup.LineItemDiscount[];
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @description The list of taxes applied to this quote line group.
|
|
91
|
+
|
|
92
|
+
*/
|
|
93
|
+
|
|
16
94
|
taxes?:QuoteLineGroup.Tax[];
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @description The list of taxes applied on line items in this quote line group.
|
|
98
|
+
|
|
99
|
+
*/
|
|
100
|
+
|
|
17
101
|
line_item_taxes?:QuoteLineGroup.LineItemTax[];
|
|
18
102
|
}
|
|
19
103
|
export namespace QuoteLineGroup {
|
|
20
104
|
|
|
21
105
|
|
|
22
|
-
export interface LineItem {
|
|
106
|
+
export interface LineItem {
|
|
23
107
|
id?:string;
|
|
108
|
+
|
|
24
109
|
subscription_id?:string;
|
|
110
|
+
|
|
25
111
|
date_from?:number;
|
|
112
|
+
|
|
26
113
|
date_to?:number;
|
|
114
|
+
|
|
27
115
|
unit_amount?:number;
|
|
116
|
+
|
|
28
117
|
quantity?:number;
|
|
118
|
+
|
|
29
119
|
amount?:number;
|
|
120
|
+
|
|
30
121
|
pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
|
|
122
|
+
|
|
31
123
|
is_taxed?:boolean;
|
|
124
|
+
|
|
32
125
|
tax_amount?:number;
|
|
126
|
+
|
|
33
127
|
tax_rate?:number;
|
|
128
|
+
|
|
34
129
|
unit_amount_in_decimal?:string;
|
|
130
|
+
|
|
35
131
|
quantity_in_decimal?:string;
|
|
132
|
+
|
|
36
133
|
amount_in_decimal?:string;
|
|
134
|
+
|
|
37
135
|
discount_amount?:number;
|
|
136
|
+
|
|
38
137
|
item_level_discount_amount?:number;
|
|
138
|
+
|
|
39
139
|
reference_line_item_id?:string;
|
|
140
|
+
|
|
40
141
|
description?:string;
|
|
142
|
+
|
|
41
143
|
entity_description?:string;
|
|
144
|
+
|
|
42
145
|
entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
|
|
146
|
+
|
|
43
147
|
tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
|
|
148
|
+
|
|
44
149
|
entity_id?:string;
|
|
150
|
+
|
|
45
151
|
customer_id?:string;
|
|
46
152
|
}
|
|
47
|
-
export interface Discount {
|
|
153
|
+
export interface Discount {
|
|
48
154
|
amount?:number;
|
|
155
|
+
|
|
49
156
|
description?:string;
|
|
157
|
+
|
|
50
158
|
line_item_id?:string;
|
|
159
|
+
|
|
51
160
|
entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
161
|
+
|
|
52
162
|
discount_type?:'fixed_amount' | 'percentage';
|
|
163
|
+
|
|
53
164
|
entity_id?:string;
|
|
165
|
+
|
|
54
166
|
coupon_set_code?:string;
|
|
55
167
|
}
|
|
56
|
-
export interface LineItemDiscount {
|
|
168
|
+
export interface LineItemDiscount {
|
|
57
169
|
line_item_id?:string;
|
|
170
|
+
|
|
58
171
|
discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
|
|
172
|
+
|
|
59
173
|
coupon_id?:string;
|
|
174
|
+
|
|
60
175
|
entity_id?:string;
|
|
176
|
+
|
|
61
177
|
discount_amount?:number;
|
|
62
178
|
}
|
|
63
|
-
export interface Tax {
|
|
179
|
+
export interface Tax {
|
|
64
180
|
name?:string;
|
|
181
|
+
|
|
65
182
|
amount?:number;
|
|
183
|
+
|
|
66
184
|
description?:string;
|
|
67
185
|
}
|
|
68
|
-
export interface LineItemTax {
|
|
186
|
+
export interface LineItemTax {
|
|
69
187
|
line_item_id?:string;
|
|
188
|
+
|
|
70
189
|
tax_name?:string;
|
|
190
|
+
|
|
71
191
|
tax_rate?:number;
|
|
192
|
+
|
|
72
193
|
is_partial_tax_applied?:boolean;
|
|
194
|
+
|
|
73
195
|
is_non_compliance_tax?:boolean;
|
|
196
|
+
|
|
74
197
|
taxable_amount?:number;
|
|
198
|
+
|
|
75
199
|
tax_amount?:number;
|
|
200
|
+
|
|
76
201
|
tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
|
|
202
|
+
|
|
77
203
|
tax_juris_name?:string;
|
|
204
|
+
|
|
78
205
|
tax_juris_code?:string;
|
|
206
|
+
|
|
79
207
|
tax_amount_in_local_currency?:number;
|
|
208
|
+
|
|
80
209
|
local_currency_code?:string;
|
|
81
210
|
}
|
|
82
211
|
}
|
|
@@ -1,56 +1,114 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface QuotedCharge {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description Provides details of all the ad-hoc charges [added to the quote](/docs/api/quotes?prod_cat_ver=2#create_a_quote_for_charge_and_charge_items).
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
charges?:QuotedCharge.Charge[];
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description Details of individual [item prices](/docs/api/item_prices?prod_cat_ver=2) that are part of this subscription
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
invoice_items?:QuotedCharge.ItemPrice[];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description The pricing details of `subscription_items` which have `pricing_model` as `tiered`, `volume` or `stairstep`. [Learn more](https://www.chargebee.com/docs/plans.html#pricing-models) about pricing models.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
item_tiers?:QuotedCharge.ItemTier[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description List of coupons for this charge
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
coupons?:QuotedCharge.Coupon[];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description List of discounts for the charges in this quote.
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
8
38
|
discounts?:QuotedCharge.Discount[];
|
|
9
39
|
}
|
|
10
40
|
export namespace QuotedCharge {
|
|
11
41
|
|
|
12
42
|
|
|
13
|
-
export interface Charge {
|
|
43
|
+
export interface Charge {
|
|
14
44
|
amount?:number;
|
|
45
|
+
|
|
15
46
|
amount_in_decimal?:string;
|
|
47
|
+
|
|
16
48
|
description?:string;
|
|
49
|
+
|
|
17
50
|
service_period_in_days?:number;
|
|
51
|
+
|
|
18
52
|
avalara_sale_type?:'consumed' | 'wholesale' | 'vendor_use' | 'retail';
|
|
53
|
+
|
|
19
54
|
avalara_transaction_type?:number;
|
|
55
|
+
|
|
20
56
|
avalara_service_type?:number;
|
|
21
57
|
}
|
|
22
|
-
export interface ItemPrice {
|
|
58
|
+
export interface ItemPrice {
|
|
23
59
|
item_price_id?:string;
|
|
60
|
+
|
|
24
61
|
quantity?:number;
|
|
62
|
+
|
|
25
63
|
quantity_in_decimal?:string;
|
|
64
|
+
|
|
26
65
|
unit_price?:number;
|
|
66
|
+
|
|
27
67
|
unit_price_in_decimal?:string;
|
|
68
|
+
|
|
28
69
|
service_period_days?:number;
|
|
29
70
|
}
|
|
30
|
-
export interface ItemTier {
|
|
71
|
+
export interface ItemTier {
|
|
31
72
|
item_price_id?:string;
|
|
73
|
+
|
|
32
74
|
starting_unit?:number;
|
|
75
|
+
|
|
33
76
|
ending_unit?:number;
|
|
77
|
+
|
|
34
78
|
price?:number;
|
|
79
|
+
|
|
35
80
|
starting_unit_in_decimal?:string;
|
|
81
|
+
|
|
36
82
|
ending_unit_in_decimal?:string;
|
|
83
|
+
|
|
37
84
|
price_in_decimal?:string;
|
|
85
|
+
|
|
38
86
|
index?:number;
|
|
39
87
|
}
|
|
40
|
-
export interface Coupon {
|
|
88
|
+
export interface Coupon {
|
|
41
89
|
coupon_id?:string;
|
|
42
90
|
}
|
|
43
|
-
export interface Discount {
|
|
91
|
+
export interface Discount {
|
|
44
92
|
id?:string;
|
|
93
|
+
|
|
45
94
|
invoice_name?:string;
|
|
95
|
+
|
|
46
96
|
type?:'fixed_amount' | 'percentage';
|
|
97
|
+
|
|
47
98
|
percentage?:number;
|
|
99
|
+
|
|
48
100
|
amount?:number;
|
|
101
|
+
|
|
49
102
|
currency_code?:string;
|
|
103
|
+
|
|
50
104
|
apply_on?:'specific_item_price' | 'invoice_amount';
|
|
105
|
+
|
|
51
106
|
item_price_id?:string;
|
|
107
|
+
|
|
52
108
|
created_at?:number;
|
|
109
|
+
|
|
53
110
|
coupon_id?:string;
|
|
111
|
+
|
|
54
112
|
index?:number;
|
|
55
113
|
}
|
|
56
114
|
}
|
|
@@ -1,81 +1,268 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface QuotedSubscription {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
id:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description Applicable only when `operation_type` of the quote is `create_subscription_for_customer`. For subscriptions in the `future` `status`, this is the date/time when the subscription is set to start. The quote can be converted on a date/time after this date. This is called backdating the subscription creation. Backdating is performed when the subscription has already been provisioned but the conversion action has been delayed. Backdating is allowed only when the following prerequisites are met:
|
|
14
|
+
|
|
15
|
+
* Backdating is enabled for subscription creation operations.
|
|
16
|
+
* The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is typically the day of the month by which the accounting for the previous month must be closed.
|
|
17
|
+
* The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription's plan is 2 months and today is 14th April, the `start_date` cannot be earlier than 14th February.
|
|
18
|
+
|
|
19
|
+
*/
|
|
20
|
+
|
|
5
21
|
start_date?:number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @description End of the trial period for the subscription. Presence of this value for 'future' subscription implies the subscription will go into 'in_trial' state when it starts.
|
|
25
|
+
|
|
26
|
+
*/
|
|
27
|
+
|
|
6
28
|
trial_end?:number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @description * When the subscription is not on a contract term: this value is the number of billing cycles remaining after the current cycle, at the end of which, the subscription cancels.
|
|
32
|
+
* When the subscription is on a [contract term](contract_terms): this value is the number of billing cycles remaining in the contract term after the current billing cycle.
|
|
33
|
+
|
|
34
|
+
*/
|
|
35
|
+
|
|
7
36
|
remaining_billing_cycles?:number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @description Purchase order number for this subscription.
|
|
40
|
+
|
|
41
|
+
*/
|
|
42
|
+
|
|
8
43
|
po_number?:string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @description The decimal representation of the quantity of the plan purchased. Returned for quantity-based plans when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
47
|
+
|
|
48
|
+
*/
|
|
49
|
+
|
|
9
50
|
plan_quantity_in_decimal?:string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @description The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
54
|
+
|
|
55
|
+
*/
|
|
56
|
+
|
|
10
57
|
plan_unit_price_in_decimal?:string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @description Applicable only when `operation_type` of the quote is `change_subscription`. When `change_option` is set to `specific_date`, then this is the date/time at which the subscription change is scheduled to occur. The quote can be converted on a date/time after this date. This is called backdating the subscription change and performed when the subscription change has already been provisioned but the conversion action has been delayed. Backdating is allowed only when the following prerequisites are met:
|
|
61
|
+
|
|
62
|
+
* Backdating must be enabled for subscription change operations.
|
|
63
|
+
* Only the following changes can be backdated:
|
|
64
|
+
* Changes in the recurring items or their prices.
|
|
65
|
+
* Addition of non-recurring items.
|
|
66
|
+
* Subscription `status` is `active`, `cancelled`, or `non_renewing`.
|
|
67
|
+
* The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
|
|
68
|
+
* The date is on or after `current_term_start`.
|
|
69
|
+
* The date is on or after the last date/time any of the following changes were made:
|
|
70
|
+
* Changes in the recurring items or their prices.
|
|
71
|
+
* Addition of non-recurring items.
|
|
72
|
+
* The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription's plan is 2 months and today is 14th April, `changes_scheduled_at` cannot be earlier than 14th February.
|
|
73
|
+
|
|
74
|
+
*/
|
|
75
|
+
|
|
11
76
|
changes_scheduled_at?:number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @description Applicable only when `operation_type` of the quote is `change_subscription`. When the quote is converted, this attribute determines the date/time as of when the subscription change is to be carried out. \* end_of_term - The change is scheduled to be carried out at the end of the billing cycle of the subscription. \* specific_date - The change is carried out as of `changes_scheduled_at`. \* immediately - The change is carried out immediately upon quote conversion.
|
|
80
|
+
|
|
81
|
+
*/
|
|
82
|
+
|
|
12
83
|
change_option?:'end_of_term' | 'immediately' | 'specific_date';
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @description Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as `billing_cycles` or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
|
|
87
|
+
|
|
88
|
+
*/
|
|
89
|
+
|
|
13
90
|
contract_term_billing_cycle_on_renewal?:number;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @description List of coupons for this subscription
|
|
94
|
+
|
|
95
|
+
*/
|
|
96
|
+
|
|
14
97
|
coupons?:QuotedSubscription.Coupon[];
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @description List of discounts for this quoted subscription.
|
|
101
|
+
|
|
102
|
+
*/
|
|
103
|
+
|
|
15
104
|
discounts?:QuotedSubscription.Discount[];
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @description Details of individual [item prices](/docs/api/item_prices?prod_cat_ver=2) that are part of this subscription
|
|
108
|
+
|
|
109
|
+
*/
|
|
110
|
+
|
|
16
111
|
subscription_items?:QuotedSubscription.SubscriptionItem[];
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @description List of item tier.
|
|
115
|
+
|
|
116
|
+
*/
|
|
117
|
+
|
|
17
118
|
item_tiers?:QuotedSubscription.ItemTier[];
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @description The details of the contract term to be created when this quote is invoiced.
|
|
122
|
+
|
|
123
|
+
*/
|
|
124
|
+
|
|
18
125
|
quoted_contract_term?:QuotedSubscription.QuotedContractTerm;
|
|
19
126
|
}
|
|
20
127
|
export namespace QuotedSubscription {
|
|
21
128
|
|
|
22
129
|
|
|
23
|
-
export interface Coupon {
|
|
130
|
+
export interface Coupon {
|
|
24
131
|
coupon_id?:string;
|
|
25
132
|
}
|
|
26
|
-
export interface Discount {
|
|
133
|
+
export interface Discount {
|
|
27
134
|
id?:string;
|
|
135
|
+
|
|
28
136
|
invoice_name?:string;
|
|
137
|
+
|
|
29
138
|
type?:'fixed_amount' | 'percentage';
|
|
139
|
+
|
|
30
140
|
percentage?:number;
|
|
141
|
+
|
|
31
142
|
amount?:number;
|
|
143
|
+
|
|
32
144
|
currency_code?:string;
|
|
145
|
+
|
|
33
146
|
duration_type?:'limited_period' | 'one_time' | 'forever';
|
|
147
|
+
|
|
34
148
|
period?:number;
|
|
149
|
+
|
|
35
150
|
period_unit?:'week' | 'month' | 'year' | 'day';
|
|
151
|
+
|
|
36
152
|
included_in_mrr?:boolean;
|
|
153
|
+
|
|
37
154
|
apply_on?:'specific_item_price' | 'invoice_amount';
|
|
155
|
+
|
|
38
156
|
item_price_id?:string;
|
|
157
|
+
|
|
39
158
|
created_at?:number;
|
|
159
|
+
|
|
40
160
|
apply_till?:number;
|
|
161
|
+
|
|
41
162
|
applied_count?:number;
|
|
163
|
+
|
|
42
164
|
coupon_id?:string;
|
|
165
|
+
|
|
43
166
|
index?:number;
|
|
44
167
|
}
|
|
45
|
-
export interface SubscriptionItem {
|
|
168
|
+
export interface SubscriptionItem {
|
|
46
169
|
item_price_id?:string;
|
|
170
|
+
|
|
47
171
|
item_type?:'charge' | 'addon' | 'plan';
|
|
172
|
+
|
|
48
173
|
quantity?:number;
|
|
174
|
+
|
|
49
175
|
quantity_in_decimal?:string;
|
|
176
|
+
|
|
50
177
|
unit_price?:number;
|
|
178
|
+
|
|
51
179
|
unit_price_in_decimal?:string;
|
|
180
|
+
|
|
52
181
|
amount?:number;
|
|
182
|
+
|
|
53
183
|
amount_in_decimal?:string;
|
|
184
|
+
|
|
54
185
|
free_quantity?:number;
|
|
186
|
+
|
|
55
187
|
free_quantity_in_decimal?:string;
|
|
188
|
+
|
|
56
189
|
trial_end?:number;
|
|
190
|
+
|
|
57
191
|
billing_cycles?:number;
|
|
192
|
+
|
|
58
193
|
service_period_days?:number;
|
|
194
|
+
|
|
59
195
|
charge_on_event?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation';
|
|
196
|
+
|
|
60
197
|
charge_once?:boolean;
|
|
198
|
+
|
|
61
199
|
charge_on_option?:'on_event' | 'immediately';
|
|
62
200
|
}
|
|
63
|
-
export interface ItemTier {
|
|
201
|
+
export interface ItemTier {
|
|
64
202
|
item_price_id?:string;
|
|
203
|
+
|
|
65
204
|
starting_unit?:number;
|
|
205
|
+
|
|
66
206
|
ending_unit?:number;
|
|
207
|
+
|
|
67
208
|
price?:number;
|
|
209
|
+
|
|
68
210
|
starting_unit_in_decimal?:string;
|
|
211
|
+
|
|
69
212
|
ending_unit_in_decimal?:string;
|
|
213
|
+
|
|
70
214
|
price_in_decimal?:string;
|
|
215
|
+
|
|
71
216
|
index?:number;
|
|
72
217
|
}
|
|
73
|
-
export interface QuotedContractTerm {
|
|
218
|
+
export interface QuotedContractTerm {
|
|
219
|
+
/**
|
|
220
|
+
* @description The start date of the contract term
|
|
221
|
+
|
|
222
|
+
*/
|
|
223
|
+
|
|
74
224
|
contract_start?:number;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @description The end date of the contract term
|
|
228
|
+
|
|
229
|
+
*/
|
|
230
|
+
|
|
75
231
|
contract_end?:number;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @description The number of billing cycles of the subscription that the contract term is for.
|
|
235
|
+
|
|
236
|
+
*/
|
|
237
|
+
|
|
76
238
|
billing_cycle?:number;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* @description Action to be taken when the contract term completes. \* renew -
|
|
242
|
+
* Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
|
|
243
|
+
* The `action_at_term_end` for the new contract term is set to `renew`.
|
|
244
|
+
\* renew_once - Used when you want to renew the contract term just once. Does the following:
|
|
245
|
+
* Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
|
|
246
|
+
* The `action_at_term_end` for the new contract term is set to `cancel`.
|
|
247
|
+
\* cancel - Contract term completes and subscription is canceled. \* evergreen - Contract term completes and the subscription renews.
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
*/
|
|
251
|
+
|
|
77
252
|
action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen';
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @description The sum of the [totals](invoices#invoice_total) of all the invoices raised as part of the contract term. For `active` contract terms, this is a predicted value. The value depends on the [type of currency](./#handling_currency_units). If the subscription was [imported](#import_a_subscription) with the contract term, then this value includes the value passed for `total_amount_raised`.
|
|
256
|
+
|
|
257
|
+
*/
|
|
258
|
+
|
|
78
259
|
total_contract_value?:number;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @description The number of days before [`contract_end`](contract_terms#contract_term_contract_end), during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure
|
|
263
|
+
|
|
264
|
+
*/
|
|
265
|
+
|
|
79
266
|
cancellation_cutoff_period?:number;
|
|
80
267
|
}
|
|
81
268
|
}
|
|
@@ -1,24 +1,94 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface ResourceMigration {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description Domain name to which the item is moved.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
from_site:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description Type of the entity this record is stored for \* customer - Entity that represents a customer
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
entity_type:'customer';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description Handle of the customer in the current site.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
entity_id:string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description Status of the copy customer process. \* failed - Failed \* succeeded - Succeeded \* scheduled - Scheduled
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
status:'scheduled' | 'failed' | 'succeeded';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description Filled only if the copy operation gets failed
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
8
38
|
errors?:string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @description Time the log is created
|
|
42
|
+
|
|
43
|
+
*/
|
|
44
|
+
|
|
9
45
|
created_at:number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description Time the log is updated
|
|
49
|
+
|
|
50
|
+
*/
|
|
51
|
+
|
|
10
52
|
updated_at:number;
|
|
11
53
|
}
|
|
12
54
|
export namespace ResourceMigration {
|
|
13
|
-
export class ResourceMigrationResource {
|
|
55
|
+
export class ResourceMigrationResource {
|
|
56
|
+
/**
|
|
57
|
+
* @description Gets the last migration details.
|
|
58
|
+
|
|
59
|
+
*/
|
|
60
|
+
|
|
14
61
|
retrieve_latest(input:RetrieveLatestInputParam):ChargebeeRequest<RetrieveLatestResponse>;
|
|
15
62
|
}
|
|
16
|
-
export interface RetrieveLatestResponse {
|
|
17
|
-
|
|
63
|
+
export interface RetrieveLatestResponse {
|
|
64
|
+
/**
|
|
65
|
+
* @description Gets the last migration details.
|
|
66
|
+
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
resource_migration:ResourceMigration;
|
|
18
70
|
}
|
|
19
71
|
export interface RetrieveLatestInputParam {
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @description Gets the last migration details.
|
|
75
|
+
|
|
76
|
+
*/
|
|
77
|
+
|
|
20
78
|
from_site:string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @description Gets the last migration details.
|
|
82
|
+
|
|
83
|
+
*/
|
|
84
|
+
|
|
21
85
|
entity_type:'customer';
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @description Gets the last migration details.
|
|
89
|
+
|
|
90
|
+
*/
|
|
91
|
+
|
|
22
92
|
entity_id:string;
|
|
23
93
|
}
|
|
24
94
|
|