chargebee 2.51.0 → 2.52.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.
- package/CHANGELOG.md +27 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +14 -1
- package/package.json +1 -1
- package/types/core.d.ts +4 -4
- package/types/index.d.ts +2 -0
- package/types/resources/Address.d.ts +2 -194
- package/types/resources/AdvanceInvoiceSchedule.d.ts +5 -67
- package/types/resources/Attribute.d.ts +4 -1
- package/types/resources/BillingConfiguration.d.ts +21 -0
- package/types/resources/Brand.d.ts +12 -0
- package/types/resources/BusinessEntity.d.ts +8 -6
- package/types/resources/BusinessEntityTransfer.d.ts +10 -7
- package/types/resources/Card.d.ts +11 -311
- package/types/resources/Comment.d.ts +7 -124
- package/types/resources/Contact.d.ts +2 -44
- package/types/resources/ContractTerm.d.ts +4 -72
- package/types/resources/Coupon.d.ts +0 -37
- package/types/resources/CouponCode.d.ts +67 -35
- package/types/resources/CouponSet.d.ts +12 -121
- package/types/resources/CreditNote.d.ts +0 -6
- package/types/resources/Currency.d.ts +8 -5
- package/types/resources/Customer.d.ts +90 -89
- package/types/resources/Discount.d.ts +2 -89
- package/types/resources/Download.d.ts +2 -14
- package/types/resources/Entitlement.d.ts +15 -103
- package/types/resources/EntitlementOverride.d.ts +4 -89
- package/types/resources/Estimate.d.ts +2 -10
- package/types/resources/Event.d.ts +23 -108
- package/types/resources/Export.d.ts +116 -432
- package/types/resources/Feature.d.ts +17 -319
- package/types/resources/GatewayErrorDetail.d.ts +6 -48
- package/types/resources/Gift.d.ts +34 -294
- package/types/resources/Hierarchy.d.ts +4 -24
- package/types/resources/ImpactedItem.d.ts +4 -36
- package/types/resources/ImpactedItemPrice.d.ts +5 -2
- package/types/resources/ImpactedSubscription.d.ts +3 -30
- package/types/resources/InAppSubscription.d.ts +13 -355
- package/types/resources/Invoice.d.ts +2 -16
- package/types/resources/InvoiceEstimate.d.ts +1 -1
- package/types/resources/Item.d.ts +0 -7
- package/types/resources/ItemEntitlement.d.ts +15 -155
- package/types/resources/NonSubscription.d.ts +9 -6
- package/types/resources/PaymentIntent.d.ts +9 -255
- package/types/resources/PaymentReferenceNumber.d.ts +3 -20
- package/types/resources/PaymentSource.d.ts +2 -2
- package/types/resources/PaymentVoucher.d.ts +20 -203
- package/types/resources/PortalSession.d.ts +4 -146
- package/types/resources/PromotionalCredit.d.ts +10 -215
- package/types/resources/Purchase.d.ts +3 -1
- package/types/resources/Quote.d.ts +19 -1
- package/types/resources/QuotedRamp.d.ts +11 -16
- package/types/resources/RecordedPurchase.d.ts +2 -0
- package/types/resources/ResourceMigration.d.ts +2 -54
- package/types/resources/SiteMigrationDetail.d.ts +13 -55
- package/types/resources/Subscription.d.ts +11 -9
- package/types/resources/SubscriptionEntitlement.d.ts +6 -106
- package/types/resources/SubscriptionEstimate.d.ts +14 -11
- package/types/resources/TaxWithheld.d.ts +14 -26
- package/types/resources/ThirdPartyPaymentMethod.d.ts +2 -19
- package/types/resources/TimeMachine.d.ts +3 -64
- package/types/resources/Token.d.ts +3 -60
- package/types/resources/Transaction.d.ts +2 -2
- package/types/resources/Usage.d.ts +21 -165
|
@@ -3,157 +3,139 @@
|
|
|
3
3
|
declare module 'chargebee' {
|
|
4
4
|
export interface Customer {
|
|
5
5
|
[key : string] : any;
|
|
6
|
-
/**
|
|
7
|
-
* @description Identifier of the customer.
|
|
8
6
|
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
7
|
id:string;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @description First name of the customer
|
|
15
8
|
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
9
|
first_name?:string;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @description Last name of the customer
|
|
22
10
|
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
11
|
last_name?:string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @description Email of the customer. Configured email notifications will be sent to this email.
|
|
29
12
|
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
13
|
email?:string;
|
|
33
|
-
|
|
14
|
+
|
|
34
15
|
phone?:string;
|
|
35
|
-
|
|
16
|
+
|
|
36
17
|
company?:string;
|
|
37
|
-
|
|
18
|
+
|
|
38
19
|
vat_number?:string;
|
|
39
|
-
|
|
20
|
+
|
|
40
21
|
auto_collection:AutoCollection;
|
|
41
|
-
|
|
22
|
+
|
|
42
23
|
offline_payment_method?:OfflinePaymentMethod;
|
|
43
|
-
|
|
24
|
+
|
|
44
25
|
net_term_days:number;
|
|
45
|
-
|
|
26
|
+
|
|
46
27
|
vat_number_validated_time?:number;
|
|
47
|
-
|
|
28
|
+
|
|
48
29
|
vat_number_status?:'valid' | 'invalid' | 'not_validated' | 'undetermined';
|
|
49
|
-
|
|
30
|
+
|
|
50
31
|
allow_direct_debit:boolean;
|
|
51
|
-
|
|
32
|
+
|
|
52
33
|
is_location_valid?:boolean;
|
|
53
|
-
|
|
34
|
+
|
|
54
35
|
created_at:number;
|
|
55
|
-
|
|
36
|
+
|
|
56
37
|
created_from_ip?:string;
|
|
57
|
-
|
|
38
|
+
|
|
58
39
|
exemption_details?:any[];
|
|
59
|
-
|
|
40
|
+
|
|
60
41
|
taxability?:Taxability;
|
|
61
|
-
|
|
42
|
+
|
|
62
43
|
entity_code?:EntityCode;
|
|
63
|
-
|
|
44
|
+
|
|
64
45
|
exempt_number?:string;
|
|
65
|
-
|
|
46
|
+
|
|
66
47
|
resource_version?:number;
|
|
67
|
-
|
|
48
|
+
|
|
68
49
|
updated_at?:number;
|
|
69
|
-
|
|
50
|
+
|
|
70
51
|
locale?:string;
|
|
71
|
-
|
|
52
|
+
|
|
72
53
|
billing_date?:number;
|
|
73
|
-
|
|
54
|
+
|
|
74
55
|
billing_month?:number;
|
|
75
|
-
|
|
56
|
+
|
|
76
57
|
billing_date_mode?:BillingDateMode;
|
|
77
|
-
|
|
58
|
+
|
|
78
59
|
billing_day_of_week?:'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
|
|
79
|
-
|
|
60
|
+
|
|
80
61
|
billing_day_of_week_mode?:BillingDayOfWeekMode;
|
|
81
|
-
|
|
62
|
+
|
|
82
63
|
pii_cleared?:'active' | 'scheduled_for_clear' | 'cleared';
|
|
83
|
-
|
|
64
|
+
|
|
84
65
|
auto_close_invoices?:boolean;
|
|
85
|
-
|
|
66
|
+
|
|
86
67
|
channel?:Channel;
|
|
87
|
-
|
|
68
|
+
|
|
88
69
|
active_id?:string;
|
|
89
|
-
|
|
70
|
+
|
|
90
71
|
card_status?:'no_card' | 'valid' | 'expiring' | 'expired' | 'pending_verification' | 'invalid';
|
|
91
|
-
|
|
72
|
+
|
|
92
73
|
fraud_flag?:'safe' | 'suspicious' | 'fraudulent';
|
|
93
|
-
|
|
74
|
+
|
|
94
75
|
primary_payment_source_id?:string;
|
|
95
|
-
|
|
76
|
+
|
|
96
77
|
backup_payment_source_id?:string;
|
|
97
|
-
|
|
78
|
+
|
|
98
79
|
billing_address?:Customer.BillingAddress;
|
|
99
|
-
|
|
80
|
+
|
|
100
81
|
referral_urls?:Customer.ReferralUrl[];
|
|
101
|
-
|
|
82
|
+
|
|
102
83
|
contacts?:Customer.Contact[];
|
|
103
|
-
|
|
84
|
+
|
|
104
85
|
payment_method?:Customer.PaymentMethod;
|
|
105
|
-
|
|
86
|
+
|
|
106
87
|
invoice_notes?:string;
|
|
107
|
-
|
|
88
|
+
|
|
108
89
|
business_entity_id?:string;
|
|
109
|
-
|
|
90
|
+
|
|
110
91
|
preferred_currency_code?:string;
|
|
111
|
-
|
|
92
|
+
|
|
112
93
|
promotional_credits:number;
|
|
113
|
-
|
|
94
|
+
|
|
114
95
|
unbilled_charges:number;
|
|
115
|
-
|
|
96
|
+
|
|
116
97
|
refundable_credits:number;
|
|
117
|
-
|
|
98
|
+
|
|
118
99
|
excess_payments:number;
|
|
119
|
-
|
|
100
|
+
|
|
120
101
|
balances?:Customer.Balance[];
|
|
121
|
-
|
|
102
|
+
|
|
122
103
|
entity_identifiers?:Customer.EntityIdentifier[];
|
|
123
|
-
|
|
104
|
+
|
|
124
105
|
tax_providers_fields?:Customer.TaxProvidersField[];
|
|
125
|
-
|
|
106
|
+
|
|
126
107
|
is_einvoice_enabled?:boolean;
|
|
127
|
-
|
|
108
|
+
|
|
128
109
|
einvoicing_method?:EinvoicingMethod;
|
|
129
|
-
|
|
110
|
+
|
|
130
111
|
meta_data?:object;
|
|
131
|
-
|
|
112
|
+
|
|
132
113
|
deleted:boolean;
|
|
133
|
-
|
|
114
|
+
|
|
134
115
|
registered_for_gst?:boolean;
|
|
135
|
-
|
|
116
|
+
|
|
136
117
|
consolidated_invoicing?:boolean;
|
|
137
|
-
|
|
118
|
+
|
|
138
119
|
customer_type?:CustomerType;
|
|
139
|
-
|
|
120
|
+
|
|
140
121
|
business_customer_without_vat_number?:boolean;
|
|
141
|
-
|
|
122
|
+
|
|
142
123
|
client_profile_id?:string;
|
|
143
|
-
|
|
124
|
+
|
|
144
125
|
relationship?:Customer.Relationship;
|
|
145
|
-
|
|
126
|
+
|
|
146
127
|
use_default_hierarchy_settings?:boolean;
|
|
147
|
-
|
|
128
|
+
|
|
148
129
|
parent_account_access?:Customer.ParentAccountAccess;
|
|
149
|
-
|
|
130
|
+
|
|
150
131
|
child_account_access?:Customer.ChildAccountAccess;
|
|
151
|
-
|
|
132
|
+
|
|
152
133
|
vat_number_prefix?:string;
|
|
153
|
-
|
|
134
|
+
|
|
154
135
|
entity_identifier_scheme?:string;
|
|
155
|
-
|
|
136
|
+
|
|
156
137
|
entity_identifier_standard?:string;
|
|
138
|
+
|
|
157
139
|
}
|
|
158
140
|
export namespace Customer {
|
|
159
141
|
export class CustomerResource {
|
|
@@ -205,6 +187,8 @@ declare module 'chargebee' {
|
|
|
205
187
|
|
|
206
188
|
hierarchy(customer_id:string, input:HierarchyInputParam):ChargebeeRequest<HierarchyResponse>;
|
|
207
189
|
|
|
190
|
+
list_hierarchy_detail(customer_id:string, input:ListHierarchyDetailInputParam):ChargebeeRequest<ListHierarchyDetailResponse>;
|
|
191
|
+
|
|
208
192
|
update_hierarchy_settings(customer_id:string, input?:UpdateHierarchySettingsInputParam):ChargebeeRequest<UpdateHierarchySettingsResponse>;
|
|
209
193
|
}
|
|
210
194
|
export interface CreateResponse {
|
|
@@ -220,7 +204,7 @@ declare module 'chargebee' {
|
|
|
220
204
|
|
|
221
205
|
payment_method?:{additional_information?:object,gateway?:Gateway,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
|
|
222
206
|
|
|
223
|
-
payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland',reference_id?:string};
|
|
207
|
+
payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland' | 'payconiq_by_bancontact',reference_id?:string};
|
|
224
208
|
|
|
225
209
|
billing_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
|
|
226
210
|
|
|
@@ -331,8 +315,6 @@ declare module 'chargebee' {
|
|
|
331
315
|
|
|
332
316
|
include_deleted?:boolean;
|
|
333
317
|
|
|
334
|
-
include_deprecated?:boolean;
|
|
335
|
-
|
|
336
318
|
/**
|
|
337
319
|
* @description Identifier of the customer.
|
|
338
320
|
|
|
@@ -662,7 +644,7 @@ The ID of the business entity created for the site. For Product Catalog 1.0, all
|
|
|
662
644
|
|
|
663
645
|
card?:{additional_information?:object,billing_addr1?:string,billing_addr2?:string,billing_city?:string,billing_country?:string,billing_state?:string,billing_state_code?:string,billing_zip?:string,cvv?:string,expiry_month?:number,expiry_year?:number,first_name?:string,gateway_account_id?:string,last_name?:string,number?:string,preferred_scheme?:'cartes_bancaires' | 'mastercard' | 'visa'};
|
|
664
646
|
|
|
665
|
-
payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland',reference_id?:string};
|
|
647
|
+
payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland' | 'payconiq_by_bancontact',reference_id?:string};
|
|
666
648
|
|
|
667
649
|
invoice_allocations:{allocation_amount?:number,invoice_id:string}[];
|
|
668
650
|
|
|
@@ -692,8 +674,6 @@ The ID of the business entity created for the site. For Product Catalog 1.0, all
|
|
|
692
674
|
}
|
|
693
675
|
export interface MoveInputParam {
|
|
694
676
|
|
|
695
|
-
tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
|
|
696
|
-
|
|
697
677
|
id_at_from_site:string;
|
|
698
678
|
|
|
699
679
|
from_site:string;
|
|
@@ -718,8 +698,6 @@ The ID of the business entity created for the site. For Product Catalog 1.0, all
|
|
|
718
698
|
}
|
|
719
699
|
export interface MergeInputParam {
|
|
720
700
|
|
|
721
|
-
tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
|
|
722
|
-
|
|
723
701
|
from_customer_id:string;
|
|
724
702
|
|
|
725
703
|
to_customer_id:string;
|
|
@@ -756,6 +734,29 @@ The ID of the business entity created for the site. For Product Catalog 1.0, all
|
|
|
756
734
|
|
|
757
735
|
hierarchy_operation_type:'complete_hierarchy' | 'subordinates' | 'path_to_root';
|
|
758
736
|
}
|
|
737
|
+
export interface ListHierarchyDetailResponse {
|
|
738
|
+
list:{hierarchies:any[]}[];
|
|
739
|
+
|
|
740
|
+
next_offset?:string;
|
|
741
|
+
}
|
|
742
|
+
export interface ListHierarchyDetailInputParam {
|
|
743
|
+
[key : string]: any;
|
|
744
|
+
/**
|
|
745
|
+
* @description The number of resources to be returned.
|
|
746
|
+
|
|
747
|
+
*/
|
|
748
|
+
|
|
749
|
+
limit?:number;
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
|
|
753
|
+
|
|
754
|
+
*/
|
|
755
|
+
|
|
756
|
+
offset?:string;
|
|
757
|
+
|
|
758
|
+
hierarchy_operation_type:'complete_hierarchy' | 'subordinates' | 'path_to_root';
|
|
759
|
+
}
|
|
759
760
|
export interface UpdateHierarchySettingsResponse {
|
|
760
761
|
customer:Customer;
|
|
761
762
|
}
|
|
@@ -1,129 +1,42 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface Discount {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description An immutable unique id for the discount. It is always auto-generated.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description The name of the discount as it should appear on customer-facing pages and documents such as [invoices](/docs/api/invoices?prod_cat_ver=2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver=2). This is auto-generated based on the `type`, `amount`, and `currency_code` of the discount. For example, it can be `10% off` or `10$ off`.
|
|
14
8
|
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
invoice_name?:string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description The type of discount. Possible value are: \* percentage - The specified percentage will be given as discount. \* fixed_amount - The specified amount will be given as discount.
|
|
21
10
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
11
|
type:'fixed_amount' | 'percentage';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description The percentage of the original amount that should be deducted from it. Only applicable when `discount.type` is percentage.
|
|
28
12
|
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
13
|
percentage?:number;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description The value of the discount. [The format of this value](https://apidocs.chargebee.com/docs/api?prod_cat_ver=2#currencies) depends on the kind of currency. This is only applicable when `discount.type` is `fixed_amount`.
|
|
35
14
|
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
15
|
amount?:number;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the discount. This is only applicable when `discount.type` is `fixed_amount`.
|
|
42
16
|
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
17
|
currency_code?:string;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description Specifies the time duration for which this discount is attached to the subscription. \* forever - The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions?prod_cat_ver=2#update_subscription_for_items_discounts_operation_type). \* limited_period - The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by `period` and `period_unit`. \* one_time - The discount stays attached to the subscription till it is applied on an invoice **once**. It is removed after that from the subscription.
|
|
49
18
|
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
19
|
duration_type:DurationType;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description The duration of time for which the discount is attached to the subscription, in `period_units`. Applicable only when `duration_type` is `limited_period`.
|
|
56
20
|
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
21
|
period?:number;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @description The unit of time for `period`. Applicable only when `duration_type` is `limited_period`. \* year - A period of 1 calendar year. \* month - A period of 1 calendar month. \* week - A period of 7 days. \* day - A period of 24 hours.
|
|
63
22
|
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
23
|
period_unit?:PeriodUnit;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @description The discount is included in MRR calculations for your site. This attribute is only applicable when `duration_type` is `one_time` and when the [feature is enabled](https://www.chargebee.com/docs/reporting.html#dashboards_flexible-mrr-calculation) in Chargebee. Also, If the [site-level setting](https://www.chargebee.com/docs/reporting.html#chart_flexible-mrr-calculation) is to exclude one-time discounts from MRR calculations, this value is always returned `false`.
|
|
70
24
|
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
25
|
included_in_mrr:boolean;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice `sub_total`. \* specific_item_price - The discount is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id`.
|
|
77
26
|
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
27
|
apply_on:ApplyOn;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description The [id of the item price](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when `apply_on` = `specific_item_price`.
|
|
84
28
|
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
29
|
item_price_id?:string;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @description Timestamp indicating when this discount is created.
|
|
91
30
|
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
31
|
created_at:number;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @description Specifies till when the limited period discount is applicable. This attribute will be sent in the response only for `limited_period` duration type discount.
|
|
98
32
|
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
33
|
apply_till?:number;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @description Specifies the number of times the discount has been applied.
|
|
105
34
|
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
35
|
applied_count?:number;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
112
|
-
**Note:**
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
116
|
-
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
117
36
|
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
37
|
coupon_id:string;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* @description The index number of the subscription to which the item price is added. Provide a unique number between `0` and `4` (inclusive) for each subscription that is to be created.
|
|
124
38
|
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
39
|
index:number;
|
|
40
|
+
|
|
128
41
|
}
|
|
129
42
|
}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface Download {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description The URL at which the file is available for download.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
download_url:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description The time until which the `download_url` is valid.
|
|
14
8
|
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
valid_till:number;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description The [media type](https://en.wikipedia.org/wiki/Media_type) of the file.
|
|
21
10
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
11
|
mime_type?:string;
|
|
12
|
+
|
|
25
13
|
}
|
|
26
14
|
}
|
|
@@ -1,174 +1,86 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface Entitlement {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description A unique identifier for the entitlement. This is auto-generated.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description The unique identifier of the entity being granted entitlement to a specific `feature`.
|
|
14
8
|
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
entity_id?:string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description The type of the entity that holds this entitlement. \* plan -
|
|
21
|
-
|
|
22
|
-
Indicates that the entity is an `item` with [type](items?prod_cat_ver=2#item_type) set to `plan`.
|
|
23
|
-
\* addon -
|
|
24
|
-
|
|
25
|
-
Indicates that the entity is an `item` with [type](items?prod_cat_ver=2#item_type) set to `addon`.
|
|
26
|
-
\* addon_price -
|
|
27
10
|
|
|
28
|
-
|
|
29
|
-
\* charge -
|
|
11
|
+
entity_type?:'plan' | 'addon' | 'charge' | 'plan_price' | 'addon_price';
|
|
30
12
|
|
|
31
|
-
Indicates that the entity is an `item` with [type](items?prod_cat_ver=2#item_type) set to `charge`.
|
|
32
|
-
\* plan_price -
|
|
33
|
-
|
|
34
|
-
Indicates that the entity is an `item_price` associated with an `item` of [type](items?prod_cat_ver=2#item_type) `plan`.
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
entity_type?:'charge' | 'addon' | 'addon_price' | 'plan_price' | 'plan';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description The unique identifier of the `feature` to which the entity gains entitlement.
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
13
|
feature_id?:string;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description The `name` of the feature associated with this entitlement.
|
|
49
14
|
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
15
|
feature_name?:string;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description The level of entitlement that the entity has towards the feature. The possible values depend on the value of `feature.type`:
|
|
56
16
|
|
|
57
|
-
* When `feature.type` is `quantity` and:
|
|
58
|
-
* If `feature.levels[is_unlimited]` is not `true` for any one of `feature.levels[]`, then the value can be any one of `feature.levels[value][]`.
|
|
59
|
-
* If `feature.levels[is_unlimited]` is `true` for one of the `feature.levels[]`, then the value can be:
|
|
60
|
-
* any one of `feature.levels[value][]`
|
|
61
|
-
* or it can be `unlimited` (case-insensitive), indicating unlimited entitlement.
|
|
62
|
-
* When `type` is `range` and:
|
|
63
|
-
* If `feature.levels[is_unlimited]` is not `true` for any one of `feature.levels[]`, then the value can be any whole number between `levels[value][0]` and `levels[value][1]` (inclusive).
|
|
64
|
-
* If `feature.levels[is_unlimited]` is `true` for one of the `feature.levels[]`, then the value can be:
|
|
65
|
-
* any whole number equal to or greater than `levels[value][0]`
|
|
66
|
-
* or it can be `unlimited` (case-insensitive), indicating unlimited entitlement.
|
|
67
|
-
* When `type` is `custom`, then the value can be any one of `feature.levels[value][]`.
|
|
68
|
-
* When `type` is `switch`, then the value is set as `available` or `true`.
|
|
69
|
-
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
17
|
value?:string;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @description The display name for the entitlement level. The value is automatically generated based on `feature.type`:
|
|
76
18
|
|
|
77
|
-
* When `feature.type` is `quantity` or `range`, the `name` is the space-separated concatenation of `value` and the plural form of `feature.unit`. For instance, if `value` is `20` and `feature.unit` is `user`, the `name` will be `20 users`.
|
|
78
|
-
* When `feature.type` is `custom`, the `name` matches the `value`.
|
|
79
|
-
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
19
|
name?:string;
|
|
20
|
+
|
|
83
21
|
}
|
|
84
22
|
export namespace Entitlement {
|
|
85
23
|
export class EntitlementResource {
|
|
86
|
-
/**
|
|
87
|
-
* @description Retrieves a list of all the `entitlement`s associated with the specified `feature`.
|
|
88
|
-
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
24
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
92
25
|
|
|
93
|
-
/**
|
|
94
|
-
* @description Create, update, or remove a set of `entitlement`s for a feature.
|
|
95
|
-
|
|
96
|
-
The behavior depends on the specified `action`. It tries to create, update, or delete `entitlement` objects. If any of the entitlement objects fail to process, the entire operation stops with an error, and no entitlements are processed. In essence, the request processes either all the provided entitlements or none of them.
|
|
97
|
-
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
26
|
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
101
27
|
}
|
|
102
28
|
export interface ListResponse {
|
|
103
|
-
/**
|
|
104
|
-
* @description Retrieves a list of all the `entitlement`s associated with the specified `feature`.
|
|
105
|
-
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
29
|
list:{entitlement:Entitlement}[];
|
|
109
30
|
|
|
110
|
-
/**
|
|
111
|
-
* @description Retrieves a list of all the `entitlement`s associated with the specified `feature`.
|
|
112
|
-
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
31
|
next_offset?:string;
|
|
116
32
|
}
|
|
117
33
|
export interface ListInputParam {
|
|
118
34
|
[key : string]: any;
|
|
119
35
|
/**
|
|
120
|
-
* @description
|
|
36
|
+
* @description The number of resources to be returned.
|
|
121
37
|
|
|
122
38
|
*/
|
|
123
39
|
|
|
124
40
|
limit?:number;
|
|
125
41
|
|
|
126
42
|
/**
|
|
127
|
-
* @description
|
|
43
|
+
* @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
|
|
128
44
|
|
|
129
45
|
*/
|
|
130
46
|
|
|
131
47
|
offset?:string;
|
|
132
48
|
|
|
133
49
|
/**
|
|
134
|
-
* @description
|
|
50
|
+
* @description The `id` of the feature towards which this entitlement has been granted.
|
|
135
51
|
|
|
136
52
|
*/
|
|
137
53
|
|
|
138
54
|
feature_id?:{in?:string,is?:string};
|
|
139
55
|
|
|
140
56
|
/**
|
|
141
|
-
* @description
|
|
57
|
+
* @description The `type` of the `entity` to which this entitlement belongs.
|
|
142
58
|
|
|
143
59
|
*/
|
|
144
60
|
|
|
145
|
-
entity_type?:{in?:string,is?:'
|
|
61
|
+
entity_type?:{in?:string,is?:'plan' | 'addon' | 'charge' | 'plan_price' | 'addon_price'};
|
|
146
62
|
|
|
147
63
|
/**
|
|
148
|
-
* @description
|
|
64
|
+
* @description The `id` of the `entity` to which this entitlement belongs.
|
|
149
65
|
|
|
150
66
|
*/
|
|
151
67
|
|
|
152
68
|
entity_id?:{in?:string,is?:string};
|
|
69
|
+
|
|
70
|
+
include_drafts?:boolean;
|
|
71
|
+
|
|
72
|
+
embed?:string;
|
|
153
73
|
}
|
|
154
74
|
export interface CreateResponse {
|
|
155
75
|
entitlement:Entitlement;
|
|
156
76
|
}
|
|
157
77
|
export interface CreateInputParam {
|
|
158
78
|
|
|
159
|
-
|
|
160
|
-
* @description The specific action to be performed for each `entitlement` specified. \* upsert - If the `entitlement` already exists for the `feature_id` and `entity_id` combination, the `value` of the `entitlement` is updated. If it doesn't exist, a new `entitlement` is created. \* remove - Deletes the `entitlement` for the `feature_id` and `entity_id` combination, if it exists.
|
|
161
|
-
|
|
162
|
-
*/
|
|
79
|
+
entitlements:{apply_grandfathering?:boolean,entity_id:string,entity_type?:'plan' | 'addon' | 'charge' | 'plan_price' | 'addon_price',feature_id:string,value?:string}[];
|
|
163
80
|
|
|
164
81
|
action:Action;
|
|
165
82
|
|
|
166
|
-
|
|
167
|
-
* @description Parameters for entitlements
|
|
168
|
-
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
entitlements:{entity_id:string,entity_type?:'charge' | 'addon' | 'addon_price' | 'plan_price' | 'plan',feature_id:string,value?:string}[];
|
|
83
|
+
change_reason?:string;
|
|
172
84
|
}
|
|
173
85
|
|
|
174
86
|
}
|