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,224 +1,88 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
2
4
|
declare module 'chargebee' {
|
|
3
5
|
export interface PortalSession {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
access_url:string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description URL to redirect when the user logs out from the portal.
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
redirect_url?:string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description Indicates the current status of the portal session. \* created - Indicates that the portal session is just created and not yet accessed by the user. \* logged_out - Indicates that the portal session is logged out either by user or via API. \* not_yet_activated - Indicates that the portal session is created and not yet activated for the customer to allow access to your website. This is applicable when you use Chargebee's authentication for your website \* activated - Indicates that the portal session is activated for the customer to allow access to your website. This is applicable when you use Chargebee's authentication for your website. \* logged_in - Indicates that the portal session URL has been accessed by the user and the session is active.
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
status:'not_yet_activated' | 'created' | 'logged_in' | 'logged_out' | 'activated';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description Timestamp indicating when this portal session was generated.
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
created_at:number;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description Timestamp indicating when the access URL will expire. Once expired, the URL cannot be used to login into the portal.
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
expires_at?:number;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description Identifier of the customer.
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
customer_id:string;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @description Timestamp indicating when this portal session URL was accessed by the user.
|
|
63
|
-
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
login_at?:number;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @description Timestamp indicating when this portal session was logged out either by user or via API.
|
|
70
|
-
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
logout_at?:number;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @description IP Address from which the portal session URL was accessed.
|
|
77
|
-
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
login_ipaddress?:string;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description IP Address from which the portal session was logged out either by user or via API.
|
|
84
|
-
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
logout_ipaddress?:string;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @description The list of customers for this session
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
linked_customers?:PortalSession.LinkedCustomer[];
|
|
6
|
+
id: string;
|
|
7
|
+
token: string;
|
|
8
|
+
access_url: string;
|
|
9
|
+
redirect_url?: string;
|
|
10
|
+
status:
|
|
11
|
+
| 'created'
|
|
12
|
+
| 'logged_in'
|
|
13
|
+
| 'logged_out'
|
|
14
|
+
| 'not_yet_activated'
|
|
15
|
+
| 'activated';
|
|
16
|
+
created_at: number;
|
|
17
|
+
expires_at?: number;
|
|
18
|
+
customer_id: string;
|
|
19
|
+
login_at?: number;
|
|
20
|
+
logout_at?: number;
|
|
21
|
+
login_ipaddress?: string;
|
|
22
|
+
logout_ipaddress?: string;
|
|
23
|
+
linked_customers?: PortalSession.LinkedCustomer[];
|
|
95
24
|
}
|
|
96
|
-
export namespace PortalSession {
|
|
97
|
-
export class PortalSessionResource {
|
|
98
|
-
/**
|
|
99
|
-
* @description Creates a portal session for a customer. The session resource in the response contains the access URL. Forward the customer to that access URL. If you would like to logout the customer later via API call, you need to store the id of the portal session resource returned by this API. While creating a session, you also need to pass the redirect URL to which your customers will be sent to upon logout from the portal UI.
|
|
100
|
-
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @description This API retrieves a portal session using `portal_session_id` as a path parameter.
|
|
107
|
-
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
retrieve(portal_session_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @description Logs out the portal session. Typically this should be called when customers logout of your application.
|
|
114
|
-
|
|
115
|
-
If this API is called for a Portal Session that currently is in :
|
|
116
|
-
|
|
117
|
-
* "created" status, the session status will be marked as "logged_out" and the access URL will become invalid.
|
|
118
|
-
* "logged_in" status, the session status will be marked as "logged_out" and customer will not be able to use that session.
|
|
119
|
-
* "logged_out" status, this will return normally without changing any attribute of this resource.
|
|
120
|
-
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
logout(portal_session_id:string):ChargebeeRequest<LogoutResponse>;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @description When an user is sent back to your return URL with session details, you should validate that information by calling this API. The details passed to the **return_url** should be sent as below:
|
|
127
25
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
26
|
+
export namespace PortalSession {
|
|
27
|
+
export class PortalSessionResource {
|
|
28
|
+
create(
|
|
29
|
+
input: CreateInputParam,
|
|
30
|
+
headers?: ChargebeeRequestHeader,
|
|
31
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
32
|
+
|
|
33
|
+
retrieve(
|
|
34
|
+
portal_session_id: string,
|
|
35
|
+
headers?: ChargebeeRequestHeader,
|
|
36
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
37
|
+
|
|
38
|
+
logout(
|
|
39
|
+
portal_session_id: string,
|
|
40
|
+
headers?: ChargebeeRequestHeader,
|
|
41
|
+
): Promise<ChargebeeResponse<LogoutResponse>>;
|
|
42
|
+
|
|
43
|
+
activate(
|
|
44
|
+
portal_session_id: string,
|
|
45
|
+
input: ActivateInputParam,
|
|
46
|
+
headers?: ChargebeeRequestHeader,
|
|
47
|
+
): Promise<ChargebeeResponse<ActivateResponse>>;
|
|
141
48
|
}
|
|
142
|
-
export interface CreateInputParam {
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @description URL to redirect when the user logs out from the portal.
|
|
146
|
-
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
redirect_url?:string;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* @description By default access_url redirects the customer to the portal home page. If you would like to redirect the customer to a different URL, you can use this parameter to do so.
|
|
153
49
|
|
|
154
|
-
|
|
50
|
+
export interface CreateResponse {
|
|
51
|
+
portal_session: PortalSession;
|
|
52
|
+
}
|
|
155
53
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* @description Parameters for customer
|
|
54
|
+
export interface RetrieveResponse {
|
|
55
|
+
portal_session: PortalSession;
|
|
56
|
+
}
|
|
162
57
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
customer:{id:string};
|
|
58
|
+
export interface LogoutResponse {
|
|
59
|
+
portal_session: PortalSession;
|
|
166
60
|
}
|
|
167
|
-
|
|
168
|
-
|
|
61
|
+
|
|
62
|
+
export interface ActivateResponse {
|
|
63
|
+
portal_session: PortalSession;
|
|
169
64
|
}
|
|
170
|
-
|
|
171
|
-
export interface
|
|
172
|
-
|
|
65
|
+
|
|
66
|
+
export interface LinkedCustomer {
|
|
67
|
+
customer_id: string;
|
|
68
|
+
email?: string;
|
|
69
|
+
has_billing_address: boolean;
|
|
70
|
+
has_payment_method: boolean;
|
|
71
|
+
has_active_subscription: boolean;
|
|
173
72
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
73
|
+
// REQUEST PARAMS
|
|
74
|
+
//---------------
|
|
75
|
+
|
|
76
|
+
export interface CreateInputParam {
|
|
77
|
+
redirect_url?: string;
|
|
78
|
+
forward_url?: string;
|
|
79
|
+
customer?: CustomerCreateInputParam;
|
|
177
80
|
}
|
|
178
81
|
export interface ActivateInputParam {
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* @description Unique pre-authenticated portal session token to access customer portal directly.
|
|
182
|
-
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
token:string;
|
|
82
|
+
token: string;
|
|
186
83
|
}
|
|
187
|
-
export interface
|
|
188
|
-
|
|
189
|
-
* @description Identifier of the customer.
|
|
190
|
-
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
customer_id:string;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* @description Email of the customer. Configured email notifications will be sent to this email.
|
|
197
|
-
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
email?:string;
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* @description The customer has billing address.
|
|
204
|
-
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
has_billing_address:boolean;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* @description The customer has payment method.
|
|
211
|
-
|
|
212
|
-
*/
|
|
213
|
-
|
|
214
|
-
has_payment_method:boolean;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* @description The customer has atleast one active subscription.
|
|
218
|
-
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
has_active_subscription:boolean;
|
|
84
|
+
export interface CustomerCreateInputParam {
|
|
85
|
+
id: string;
|
|
222
86
|
}
|
|
223
87
|
}
|
|
224
|
-
}
|
|
88
|
+
}
|
|
@@ -1,300 +1,112 @@
|
|
|
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 PriceVariant {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
name:string;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @description A unique display name for the price variant.
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
external_name?:string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @description Description of the price variant.
|
|
29
|
-
|
|
30
|
-
*/
|
|
31
|
-
variant_group?:string;
|
|
32
|
-
description?:string;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @description Status of a price variant. \* active - Active price variant. This price variant can be attached to [item prices](https://apidocs.chargebee.com/docs/api/item_prices?lang=curl). \* deleted - Deleted price variant. The `id` and `name` of the deleted price variant can be reused. \* archived - Archived price variant. This price variant is no longer `active` and cannot be attached to new [item prices](https://apidocs.chargebee.com/docs/api/item_prices?lang=curl). Existing item prices that already have this price variant attached will continue to remain as is.
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
status?:'active' | 'archived' | 'deleted';
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @description Timestamp indicating when this price variant is created.
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
created_at:number;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @description The version number of this resource. For every change made to the resource, `resource_version` is updated with a new timestamp in milliseconds.
|
|
50
|
-
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
resource_version?:number;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @description Timestamp indicating when this price variant was last updated.
|
|
57
|
-
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
updated_at?:number;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @description Timestamp indicating when this price variant was archived.
|
|
64
|
-
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
archived_at?:number;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* @description The list of price variant attribute values.
|
|
71
|
-
|
|
72
|
-
Attributes can be used to store additional information about the price variant. For example, for a price variant called 'Germany', the attributes can be 'Country':'Germany', 'City':'Berlin' and so on.
|
|
73
|
-
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
attributes?:PriceVariant.Attribute[];
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
external_name?: string;
|
|
9
|
+
variant_group?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
status?: 'active' | 'archived' | 'deleted';
|
|
12
|
+
created_at: number;
|
|
13
|
+
resource_version?: number;
|
|
14
|
+
updated_at?: number;
|
|
15
|
+
archived_at?: number;
|
|
16
|
+
attributes?: PriceVariant.Attribute[];
|
|
77
17
|
}
|
|
78
|
-
export namespace PriceVariant {
|
|
79
|
-
export class PriceVariantResource {
|
|
80
|
-
/**
|
|
81
|
-
* @description This endpoint allows the creation of a new price variant that can be attached to [item prices](https://apidocs.chargebee.com/docs/api/item_prices?lang=curl).
|
|
82
|
-
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @description This endpoint retrieves the details of a specific price variant using its unique identifier.
|
|
89
18
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
list(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
19
|
+
export namespace PriceVariant {
|
|
20
|
+
export class PriceVariantResource {
|
|
21
|
+
create(
|
|
22
|
+
input: CreateInputParam,
|
|
23
|
+
headers?: ChargebeeRequestHeader,
|
|
24
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
25
|
+
|
|
26
|
+
retrieve(
|
|
27
|
+
price_variant_id: string,
|
|
28
|
+
headers?: ChargebeeRequestHeader,
|
|
29
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
30
|
+
|
|
31
|
+
update(
|
|
32
|
+
price_variant_id: string,
|
|
33
|
+
input: UpdateInputParam,
|
|
34
|
+
headers?: ChargebeeRequestHeader,
|
|
35
|
+
): Promise<ChargebeeResponse<UpdateResponse>>;
|
|
36
|
+
|
|
37
|
+
delete(
|
|
38
|
+
price_variant_id: string,
|
|
39
|
+
headers?: ChargebeeRequestHeader,
|
|
40
|
+
): Promise<ChargebeeResponse<DeleteResponse>>;
|
|
41
|
+
|
|
42
|
+
list(
|
|
43
|
+
input?: ListInputParam,
|
|
44
|
+
headers?: ChargebeeRequestHeader,
|
|
45
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
117
46
|
}
|
|
118
|
-
export interface CreateInputParam {
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* @description The unique and immutable identifier of the price variant.
|
|
122
|
-
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
id:string;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* @description A unique name of the price variant.
|
|
129
|
-
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
name:string;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* @description A unique display name for the price variant.
|
|
136
|
-
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
external_name?:string;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @description Description of the price variant.
|
|
143
|
-
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
|
-
description?:string;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @description The list of price variant attribute values.
|
|
150
|
-
|
|
151
|
-
Attributes can be used to store additional information about the price variant. For example, for a price variant called 'Germany', the attributes can be 'Country':'Germany', 'City':'Berlin' and so on.
|
|
152
|
-
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
attributes:{name:string,value:string}[];
|
|
156
47
|
|
|
157
|
-
|
|
48
|
+
export interface CreateResponse {
|
|
49
|
+
price_variant: PriceVariant;
|
|
158
50
|
}
|
|
159
|
-
export interface RetrieveResponse {
|
|
160
|
-
price_variant:PriceVariant;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export interface UpdateResponse {
|
|
164
|
-
price_variant:PriceVariant;
|
|
165
|
-
}
|
|
166
|
-
export interface UpdateInputParam {
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* @description A unique name of the price variant.
|
|
170
|
-
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
name?:string;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* @description A unique display name for the price variant.
|
|
177
|
-
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
|
-
external_name?:string;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* @description Description of the price variant.
|
|
184
|
-
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
description?:string;
|
|
188
|
-
|
|
189
|
-
variant_group?:string;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* @description Status of a price variant. \* active - Active price variant. This price variant can be attached to [item prices](https://apidocs.chargebee.com/docs/api/item_prices?lang=curl). \* deleted - Deleted price variant. The `id` and `name` of the deleted price variant can be reused. \* archived - Archived price variant. This price variant is no longer `active` and cannot be attached to new [item prices](https://apidocs.chargebee.com/docs/api/item_prices?lang=curl). Existing item prices that already have this price variant attached will continue to remain as is.
|
|
193
51
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* @description The list of price variant attribute values.
|
|
52
|
+
export interface RetrieveResponse {
|
|
53
|
+
price_variant: PriceVariant;
|
|
54
|
+
}
|
|
200
55
|
|
|
201
|
-
|
|
56
|
+
export interface UpdateResponse {
|
|
57
|
+
price_variant: PriceVariant;
|
|
58
|
+
}
|
|
202
59
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
attributes:{name:string,value:string}[];
|
|
60
|
+
export interface DeleteResponse {
|
|
61
|
+
price_variant: PriceVariant;
|
|
206
62
|
}
|
|
207
|
-
|
|
208
|
-
|
|
63
|
+
|
|
64
|
+
export interface ListResponse {
|
|
65
|
+
list: { price_variant: PriceVariant }[];
|
|
66
|
+
next_offset?: string;
|
|
209
67
|
}
|
|
210
|
-
|
|
211
|
-
export interface ListResponse {
|
|
212
|
-
/**
|
|
213
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
214
68
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
69
|
+
export interface Attribute {
|
|
70
|
+
name: string;
|
|
71
|
+
value: string;
|
|
72
|
+
}
|
|
73
|
+
// REQUEST PARAMS
|
|
74
|
+
//---------------
|
|
221
75
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
76
|
+
export interface CreateInputParam {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
external_name?: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
variant_group?: string;
|
|
82
|
+
attributes?: AttributesCreateInputParam[];
|
|
83
|
+
}
|
|
84
|
+
export interface UpdateInputParam {
|
|
85
|
+
name?: string;
|
|
86
|
+
external_name?: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
variant_group?: string;
|
|
89
|
+
status?: 'active' | 'archived';
|
|
90
|
+
attributes?: AttributesUpdateInputParam[];
|
|
225
91
|
}
|
|
226
92
|
export interface ListInputParam {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
237
|
-
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
offset?:string;
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
244
|
-
|
|
245
|
-
*/
|
|
246
|
-
|
|
247
|
-
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
251
|
-
|
|
252
|
-
*/
|
|
253
|
-
|
|
254
|
-
name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
258
|
-
|
|
259
|
-
*/
|
|
260
|
-
|
|
261
|
-
status?:{in?:string,is?:'active' | 'archived',is_not?:'active' | 'archived',not_in?:string};
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
265
|
-
|
|
266
|
-
*/
|
|
267
|
-
|
|
268
|
-
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
272
|
-
|
|
273
|
-
*/
|
|
274
|
-
|
|
275
|
-
created_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* @description This endpoint is used to retrieve a list of price variants.
|
|
279
|
-
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
|
-
sort_by?:{asc?:'name' | 'id' | 'status' | 'created_at' | 'updated_at',desc?:'name' | 'id' | 'status' | 'created_at' | 'updated_at'};
|
|
93
|
+
limit?: number;
|
|
94
|
+
offset?: string;
|
|
95
|
+
id?: filter.String;
|
|
96
|
+
name?: filter.String;
|
|
97
|
+
status?: filter.Enum;
|
|
98
|
+
updated_at?: filter.Timestamp;
|
|
99
|
+
created_at?: filter.Timestamp;
|
|
100
|
+
'sort_by[asc]'?: string;
|
|
101
|
+
'sort_by[desc]'?: string;
|
|
283
102
|
}
|
|
284
|
-
export interface
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* @description Attribute value
|
|
294
|
-
|
|
295
|
-
*/
|
|
296
|
-
|
|
297
|
-
value:string;
|
|
103
|
+
export interface AttributesCreateInputParam {
|
|
104
|
+
name: string;
|
|
105
|
+
value: string;
|
|
106
|
+
}
|
|
107
|
+
export interface AttributesUpdateInputParam {
|
|
108
|
+
name: string;
|
|
109
|
+
value: string;
|
|
298
110
|
}
|
|
299
111
|
}
|
|
300
|
-
}
|
|
112
|
+
}
|