chargebee 2.41.0 → 3.0.0-beta.2
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 +11 -15
- package/LICENSE +1 -1
- package/README.md +90 -170
- package/cjs/RequestWrapper.js +84 -0
- package/cjs/asyncApiSupport.js +39 -0
- package/cjs/chargebee.cjs.js +13 -0
- package/cjs/chargebee.cjs.worker.js +9 -0
- package/cjs/chargebeeError.js +17 -0
- package/cjs/coreCommon.js +72 -0
- package/cjs/createChargebee.js +92 -0
- package/cjs/environment.js +18 -0
- package/cjs/filter.js +1 -0
- package/cjs/net/ClientInterface.js +40 -0
- package/cjs/net/FetchClient.js +86 -0
- package/cjs/net/NodeClient.js +61 -0
- package/cjs/package.json +1 -0
- package/cjs/resources/api_endpoints.js +1086 -0
- package/cjs/util.js +218 -0
- package/esm/RequestWrapper.js +80 -0
- package/esm/asyncApiSupport.js +35 -0
- package/esm/chargebee.esm.js +9 -0
- package/esm/chargebee.esm.worker.js +5 -0
- package/esm/chargebeeError.js +13 -0
- package/esm/coreCommon.js +67 -0
- package/esm/createChargebee.js +88 -0
- package/esm/environment.js +15 -0
- package/esm/filter.js +1 -0
- package/esm/net/ClientInterface.js +35 -0
- package/esm/net/FetchClient.js +81 -0
- package/esm/net/NodeClient.js +56 -0
- package/esm/package.json +1 -0
- package/esm/resources/api_endpoints.js +1083 -0
- package/esm/util.js +202 -0
- package/package.json +69 -38
- package/types/core.d.ts +558 -89
- package/types/index.d.ts +90 -55
- package/types/resources/Address.d.ts +57 -272
- package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
- package/types/resources/AttachedItem.d.ts +91 -329
- package/types/resources/Attribute.d.ts +5 -5
- package/types/resources/BusinessEntity.d.ts +49 -69
- package/types/resources/BusinessEntityTransfer.d.ts +11 -17
- package/types/resources/Card.d.ts +146 -424
- package/types/resources/Comment.d.ts +72 -189
- package/types/resources/Contact.d.ts +12 -64
- package/types/resources/ContractTerm.d.ts +15 -96
- package/types/resources/Coupon.d.ts +282 -758
- package/types/resources/CouponCode.d.ts +56 -52
- package/types/resources/CouponSet.d.ts +92 -234
- package/types/resources/CreditNote.d.ts +588 -1758
- package/types/resources/CreditNoteEstimate.d.ts +131 -157
- package/types/resources/Currency.d.ts +75 -62
- package/types/resources/Customer.d.ts +892 -835
- package/types/resources/CustomerEntitlement.d.ts +24 -35
- package/types/resources/DifferentialPrice.d.ts +116 -314
- package/types/resources/Discount.d.ts +20 -125
- package/types/resources/Download.d.ts +6 -22
- package/types/resources/Entitlement.d.ts +51 -160
- package/types/resources/EntitlementOverride.d.ts +58 -139
- package/types/resources/Estimate.d.ts +1178 -527
- package/types/resources/Event.d.ts +67 -178
- package/types/resources/Export.d.ts +563 -723
- package/types/resources/Feature.d.ts +117 -433
- package/types/resources/GatewayErrorDetail.d.ts +16 -72
- package/types/resources/Gift.d.ts +265 -432
- package/types/resources/Hierarchy.d.ts +8 -36
- package/types/resources/HostedPage.d.ts +1017 -1153
- package/types/resources/ImpactedItem.d.ts +13 -50
- package/types/resources/ImpactedItemPrice.d.ts +13 -15
- package/types/resources/ImpactedSubscription.d.ts +13 -45
- package/types/resources/InAppSubscription.d.ts +93 -389
- package/types/resources/Installment.d.ts +35 -110
- package/types/resources/InstallmentConfig.d.ts +54 -155
- package/types/resources/InstallmentDetail.d.ts +19 -27
- package/types/resources/Invoice.d.ts +1574 -3157
- package/types/resources/InvoiceEstimate.d.ts +131 -161
- package/types/resources/Item.d.ts +133 -611
- package/types/resources/ItemEntitlement.d.ts +78 -215
- package/types/resources/ItemFamily.d.ts +69 -178
- package/types/resources/ItemPrice.d.ts +291 -1203
- package/types/resources/Metadata.d.ts +3 -5
- package/types/resources/Order.d.ts +538 -1471
- package/types/resources/PaymentIntent.d.ts +163 -347
- package/types/resources/PaymentReferenceNumber.d.ts +7 -29
- package/types/resources/PaymentSource.d.ts +476 -1272
- package/types/resources/PaymentVoucher.d.ts +87 -306
- package/types/resources/PortalSession.d.ts +71 -207
- package/types/resources/PriceVariant.d.ts +91 -279
- package/types/resources/PricingPageSession.d.ts +92 -41
- package/types/resources/PromotionalCredit.d.ts +90 -346
- package/types/resources/Purchase.d.ts +185 -315
- package/types/resources/Quote.d.ts +1406 -887
- package/types/resources/QuoteLineGroup.d.ts +125 -452
- package/types/resources/QuotedCharge.d.ts +45 -274
- package/types/resources/QuotedSubscription.d.ts +100 -488
- package/types/resources/Ramp.d.ts +230 -747
- package/types/resources/ResourceMigration.d.ts +25 -80
- package/types/resources/SiteMigrationDetail.d.ts +34 -112
- package/types/resources/Subscription.d.ts +2390 -4336
- package/types/resources/SubscriptionEntitlement.d.ts +59 -160
- package/types/resources/SubscriptionEstimate.d.ts +51 -75
- package/types/resources/TaxWithheld.d.ts +15 -40
- package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
- package/types/resources/TimeMachine.d.ts +43 -97
- package/types/resources/Token.d.ts +15 -85
- package/types/resources/Transaction.d.ts +276 -911
- package/types/resources/UnbilledCharge.d.ts +189 -164
- package/types/resources/Usage.d.ts +89 -279
- package/types/resources/VirtualBankAccount.d.ts +103 -255
- package/types/resources/filter.d.ts +52 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
- package/.github/ISSUE_TEMPLATE/config.yml +0 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/lib/chargebee.js +0 -512
- package/lib/resources/api_endpoints.js +0 -2935
- package/types/resources/NonSubscription.d.ts +0 -30
- package/types/resources/Session.d.ts +0 -41
|
@@ -1,47 +1,36 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
3
4
|
declare module 'chargebee' {
|
|
4
5
|
export interface CustomerEntitlement {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
feature_id?:string;
|
|
12
|
-
|
|
13
|
-
value?:string;
|
|
14
|
-
|
|
15
|
-
name?:string;
|
|
16
|
-
|
|
17
|
-
is_enabled:boolean;
|
|
18
|
-
|
|
6
|
+
customer_id: string;
|
|
7
|
+
subscription_id?: string;
|
|
8
|
+
feature_id?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
is_enabled: boolean;
|
|
19
12
|
}
|
|
13
|
+
|
|
20
14
|
export namespace CustomerEntitlement {
|
|
21
|
-
export class CustomerEntitlementResource {
|
|
22
|
-
|
|
15
|
+
export class CustomerEntitlementResource {
|
|
16
|
+
entitlementsForCustomer(
|
|
17
|
+
customer_id: string,
|
|
18
|
+
input?: EntitlementsForCustomerInputParam,
|
|
19
|
+
headers?: ChargebeeRequestHeader,
|
|
20
|
+
): Promise<ChargebeeResponse<EntitlementsForCustomerResponse>>;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
|
|
23
|
+
export interface EntitlementsForCustomerResponse {
|
|
24
|
+
list: { customer_entitlement: CustomerEntitlement }[];
|
|
25
|
+
next_offset?: string;
|
|
28
26
|
}
|
|
29
|
-
export interface EntitlementsForCustomerInputParam {
|
|
30
|
-
[key : string]: any;
|
|
31
|
-
/**
|
|
32
|
-
* @description The number of resources to be returned.
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
limit?:number;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @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.
|
|
28
|
+
// REQUEST PARAMS
|
|
29
|
+
//---------------
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
offset?:string;
|
|
31
|
+
export interface EntitlementsForCustomerInputParam {
|
|
32
|
+
limit?: number;
|
|
33
|
+
offset?: string;
|
|
44
34
|
}
|
|
45
|
-
|
|
46
35
|
}
|
|
47
|
-
}
|
|
36
|
+
}
|
|
@@ -1,340 +1,142 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
2
4
|
declare module 'chargebee' {
|
|
3
5
|
export interface DifferentialPrice {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
item_price_id:string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description The ID of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the *Standard* or *Enterprise* plans-items mentioned in the [examples above](./differential_prices?prod_cat_ver=2).
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
parent_item_id:string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description The differential price. If the pricing model of the `item_price_id` is `tiered`, `volume`, or `stairstep`, pass `tiers` instead of this.
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
price?:number;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description The price of the item when the pricing_model is `flat_fee`. When the pricing model is `per_unit`, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
price_in_decimal?:string;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description The item family state. \* active - New items can be created with the item family. \* deleted - No items allowed for the item family.
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
status?:'deleted' | 'active';
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
resource_version?:number;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description Timestamp when this differential price was last updated.
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
updated_at?:number;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @description Timestamp at which this differential price was created.
|
|
63
|
-
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
created_at:number;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @description Timestamp at which this differential price was last modified.
|
|
70
|
-
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
modified_at:number;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @description The currency code (ISO 4217 format) of the plan
|
|
77
|
-
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
currency_code:string;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description List of quantity-based pricing tiers for the differential price. Applicable only for `tiered`, `volume`, and `stairstep` `pricing_model` s. The tiers are exactly the same as those set for the item price. Only the `price` attribute for the various tiers can be overridden for the differential price.
|
|
84
|
-
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
tiers?:DifferentialPrice.Tier[];
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @description When `item_price_id` is a charge-item, you can specify the plan period for which the price applies. Although an array, currently you can specify only one period. In other words, only index `0` is allowed. Create another differential price to specify another period. Is permitted only when `item_price_id` is a charge-item.
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
parent_periods?:DifferentialPrice.ParentPeriod[];
|
|
6
|
+
id: string;
|
|
7
|
+
item_price_id: string;
|
|
8
|
+
parent_item_id: string;
|
|
9
|
+
price?: number;
|
|
10
|
+
price_in_decimal?: string;
|
|
11
|
+
status?: 'active' | 'deleted';
|
|
12
|
+
resource_version?: number;
|
|
13
|
+
updated_at?: number;
|
|
14
|
+
created_at: number;
|
|
15
|
+
modified_at: number;
|
|
16
|
+
tiers?: DifferentialPrice.Tier[];
|
|
17
|
+
currency_code: string;
|
|
18
|
+
parent_periods?: DifferentialPrice.ParentPeriod[];
|
|
95
19
|
}
|
|
96
|
-
export namespace DifferentialPrice {
|
|
97
|
-
export class DifferentialPriceResource {
|
|
98
|
-
/**
|
|
99
|
-
* @description Create a differential price for addon item price, addon item price with tiered pricing, or charge item price.
|
|
100
|
-
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
create(item_price_id:string, input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @description Retrieve a differential price using a `differential_price_id` and `item_price_id`.
|
|
107
|
-
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
retrieve(differential_price_id:string, input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @description Update a differential price using a `differential_price_id` and `item_price_id`.
|
|
114
|
-
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
update(differential_price_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* @description Delete a differential price using a `differential_price_id` and `item_price_id`.
|
|
121
20
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
21
|
+
export namespace DifferentialPrice {
|
|
22
|
+
export class DifferentialPriceResource {
|
|
23
|
+
create(
|
|
24
|
+
item_price_id: string,
|
|
25
|
+
input: CreateInputParam,
|
|
26
|
+
headers?: ChargebeeRequestHeader,
|
|
27
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
28
|
+
|
|
29
|
+
retrieve(
|
|
30
|
+
differential_price_id: string,
|
|
31
|
+
input: RetrieveInputParam,
|
|
32
|
+
headers?: ChargebeeRequestHeader,
|
|
33
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
34
|
+
|
|
35
|
+
update(
|
|
36
|
+
differential_price_id: string,
|
|
37
|
+
input: UpdateInputParam,
|
|
38
|
+
headers?: ChargebeeRequestHeader,
|
|
39
|
+
): Promise<ChargebeeResponse<UpdateResponse>>;
|
|
40
|
+
|
|
41
|
+
delete(
|
|
42
|
+
differential_price_id: string,
|
|
43
|
+
input: DeleteInputParam,
|
|
44
|
+
headers?: ChargebeeRequestHeader,
|
|
45
|
+
): Promise<ChargebeeResponse<DeleteResponse>>;
|
|
46
|
+
|
|
47
|
+
list(
|
|
48
|
+
input?: ListInputParam,
|
|
49
|
+
headers?: ChargebeeRequestHeader,
|
|
50
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
132
51
|
}
|
|
133
|
-
|
|
134
|
-
|
|
52
|
+
|
|
53
|
+
export interface CreateResponse {
|
|
54
|
+
differential_price: DifferentialPrice;
|
|
135
55
|
}
|
|
136
|
-
export interface CreateInputParam {
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @description The id of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the *Standard* or *Enterprise* plans-items mentioned in the [examples above](./differential_prices?prod_cat_ver=2).
|
|
140
56
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @description The differential price. If the pricing model of the `item_price_id` is `tiered`, `volume`, or `stairstep`, pass `tiers` instead of this.
|
|
57
|
+
export interface RetrieveResponse {
|
|
58
|
+
differential_price: DifferentialPrice;
|
|
59
|
+
}
|
|
147
60
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @description The price of the item when the pricing_model is `flat_fee`. When the pricing model is `per_unit`, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
61
|
+
export interface UpdateResponse {
|
|
62
|
+
differential_price: DifferentialPrice;
|
|
63
|
+
}
|
|
154
64
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* @description Parameters for parent_periods
|
|
65
|
+
export interface DeleteResponse {
|
|
66
|
+
differential_price: DifferentialPrice;
|
|
67
|
+
}
|
|
161
68
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* @description Parameters for tiers
|
|
69
|
+
export interface ListResponse {
|
|
70
|
+
list: { differential_price: DifferentialPrice }[];
|
|
71
|
+
next_offset?: string;
|
|
72
|
+
}
|
|
168
73
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
74
|
+
export interface Tier {
|
|
75
|
+
starting_unit: number;
|
|
76
|
+
ending_unit?: number;
|
|
77
|
+
price: number;
|
|
78
|
+
starting_unit_in_decimal?: string;
|
|
79
|
+
ending_unit_in_decimal?: string;
|
|
80
|
+
price_in_decimal?: string;
|
|
172
81
|
}
|
|
173
|
-
export interface
|
|
174
|
-
|
|
82
|
+
export interface ParentPeriod {
|
|
83
|
+
period_unit: 'day' | 'week' | 'month' | 'year';
|
|
84
|
+
period?: any[];
|
|
175
85
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @description Retrieve a differential price using a `differential_price_id` and `item_price_id`.
|
|
86
|
+
// REQUEST PARAMS
|
|
87
|
+
//---------------
|
|
180
88
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
89
|
+
export interface CreateInputParam {
|
|
90
|
+
parent_item_id: string;
|
|
91
|
+
price?: number;
|
|
92
|
+
price_in_decimal?: string;
|
|
93
|
+
parent_periods?: ParentPeriodsCreateInputParam[];
|
|
94
|
+
tiers?: TiersCreateInputParam[];
|
|
184
95
|
}
|
|
185
|
-
export interface
|
|
186
|
-
|
|
96
|
+
export interface RetrieveInputParam {
|
|
97
|
+
item_price_id: string;
|
|
187
98
|
}
|
|
188
99
|
export interface UpdateInputParam {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
item_price_id:string;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @description The differential price. If the pricing model of the `item_price_id` is `tiered`, `volume`, or `stairstep`, pass `tiers` instead of this.
|
|
199
|
-
|
|
200
|
-
*/
|
|
201
|
-
|
|
202
|
-
price?:number;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* @description The price of the item when the pricing_model is `flat_fee`. When the pricing model is `per_unit`, it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
206
|
-
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
price_in_decimal?:string;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @description Parameters for parent_periods
|
|
213
|
-
|
|
214
|
-
*/
|
|
215
|
-
|
|
216
|
-
parent_periods?:{period?:any[],period_unit:'week' | 'month' | 'year' | 'day'}[];
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @description Parameters for tiers
|
|
220
|
-
|
|
221
|
-
*/
|
|
222
|
-
|
|
223
|
-
tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
|
|
224
|
-
}
|
|
225
|
-
export interface DeleteResponse {
|
|
226
|
-
differential_price:DifferentialPrice;
|
|
100
|
+
item_price_id: string;
|
|
101
|
+
price?: number;
|
|
102
|
+
price_in_decimal?: string;
|
|
103
|
+
parent_periods?: ParentPeriodsUpdateInputParam[];
|
|
104
|
+
tiers?: TiersUpdateInputParam[];
|
|
227
105
|
}
|
|
228
106
|
export interface DeleteInputParam {
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @description The id of the item price (`addon` or `charge`) whose price should change according to the plan-item it is applied to.
|
|
232
|
-
|
|
233
|
-
*/
|
|
234
|
-
|
|
235
|
-
item_price_id:string;
|
|
236
|
-
}
|
|
237
|
-
export interface ListResponse {
|
|
238
|
-
/**
|
|
239
|
-
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
240
|
-
|
|
241
|
-
*/
|
|
242
|
-
|
|
243
|
-
list:{differential_price:DifferentialPrice}[];
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
247
|
-
|
|
248
|
-
*/
|
|
249
|
-
|
|
250
|
-
next_offset?:string;
|
|
107
|
+
item_price_id: string;
|
|
251
108
|
}
|
|
252
109
|
export interface ListInputParam {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
limit?:number;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
263
|
-
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
|
-
offset?:string;
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
270
|
-
|
|
271
|
-
*/
|
|
272
|
-
|
|
273
|
-
item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
277
|
-
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
284
|
-
|
|
285
|
-
*/
|
|
286
|
-
|
|
287
|
-
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* @description Returns a list of differential prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).
|
|
291
|
-
|
|
292
|
-
*/
|
|
293
|
-
|
|
294
|
-
parent_item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
110
|
+
limit?: number;
|
|
111
|
+
offset?: string;
|
|
112
|
+
item_price_id?: filter.String;
|
|
113
|
+
item_id?: filter.String;
|
|
114
|
+
id?: filter.String;
|
|
115
|
+
parent_item_id?: filter.String;
|
|
295
116
|
}
|
|
296
|
-
export interface
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* @description The upper limit of a range of units for the tier
|
|
306
|
-
|
|
307
|
-
*/
|
|
308
|
-
|
|
309
|
-
ending_unit?:number;
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* @description The per-unit price for the tier when the `pricing_model` is `tiered` or `volume`; the total cost for the item price when the `pricing_model` is `stairstep`. The value is in the [minor unit of the currency](https://apidocs.chargebee.com/docs/api#handling_currency_units).
|
|
313
|
-
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
|
-
price:number;
|
|
317
|
-
|
|
318
|
-
starting_unit_in_decimal?:string;
|
|
319
|
-
|
|
320
|
-
ending_unit_in_decimal?:string;
|
|
321
|
-
|
|
322
|
-
price_in_decimal?:string;
|
|
117
|
+
export interface TiersCreateInputParam {
|
|
118
|
+
starting_unit?: number;
|
|
119
|
+
ending_unit?: number;
|
|
120
|
+
price?: number;
|
|
121
|
+
starting_unit_in_decimal?: string;
|
|
122
|
+
ending_unit_in_decimal?: string;
|
|
123
|
+
price_in_decimal?: string;
|
|
323
124
|
}
|
|
324
|
-
export interface
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
125
|
+
export interface ParentPeriodsCreateInputParam {
|
|
126
|
+
period_unit: 'day' | 'week' | 'month' | 'year';
|
|
127
|
+
period?: any;
|
|
128
|
+
}
|
|
129
|
+
export interface TiersUpdateInputParam {
|
|
130
|
+
starting_unit?: number;
|
|
131
|
+
ending_unit?: number;
|
|
132
|
+
price?: number;
|
|
133
|
+
starting_unit_in_decimal?: string;
|
|
134
|
+
ending_unit_in_decimal?: string;
|
|
135
|
+
price_in_decimal?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface ParentPeriodsUpdateInputParam {
|
|
138
|
+
period_unit: 'day' | 'week' | 'month' | 'year';
|
|
139
|
+
period?: any;
|
|
338
140
|
}
|
|
339
141
|
}
|
|
340
|
-
}
|
|
142
|
+
}
|
|
@@ -1,129 +1,24 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
2
4
|
declare module 'chargebee' {
|
|
3
5
|
export interface Discount {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
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
|
-
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
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
|
-
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
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
|
-
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
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
|
-
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
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
|
-
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
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
|
-
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
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
|
-
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
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
|
-
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
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
|
-
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
item_price_id?:string;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @description Timestamp indicating when this discount is created.
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
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
|
-
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
apply_till?:number;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @description Specifies the number of times the discount has been applied.
|
|
105
|
-
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
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
|
-
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
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
|
-
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
|
-
index:number;
|
|
6
|
+
id: string;
|
|
7
|
+
invoice_name?: string;
|
|
8
|
+
type: 'fixed_amount' | 'percentage';
|
|
9
|
+
percentage?: number;
|
|
10
|
+
amount?: number;
|
|
11
|
+
currency_code?: string;
|
|
12
|
+
duration_type: DurationType;
|
|
13
|
+
period?: number;
|
|
14
|
+
period_unit?: PeriodUnit;
|
|
15
|
+
included_in_mrr: boolean;
|
|
16
|
+
apply_on: ApplyOn;
|
|
17
|
+
item_price_id?: string;
|
|
18
|
+
created_at: number;
|
|
19
|
+
apply_till?: number;
|
|
20
|
+
applied_count?: number;
|
|
21
|
+
coupon_id: string;
|
|
22
|
+
index: number;
|
|
128
23
|
}
|
|
129
|
-
}
|
|
24
|
+
}
|