chargebee 2.26.0 → 2.27.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/chargebee.js +1 -1
  3. package/lib/resources/api_endpoints.js +8 -1
  4. package/package.json +1 -1
  5. package/types/core.d.ts +1 -0
  6. package/types/resources/Address.d.ts +235 -5
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  8. package/types/resources/AttachedItem.d.ts +285 -13
  9. package/types/resources/Card.d.ts +375 -13
  10. package/types/resources/Comment.d.ts +160 -11
  11. package/types/resources/Contact.d.ts +54 -0
  12. package/types/resources/ContractTerm.d.ts +83 -0
  13. package/types/resources/Coupon.d.ts +628 -20
  14. package/types/resources/CouponCode.d.ts +46 -5
  15. package/types/resources/CouponSet.d.ts +194 -17
  16. package/types/resources/CreditNote.d.ts +1100 -44
  17. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  18. package/types/resources/Customer.d.ts +1819 -73
  19. package/types/resources/DifferentialPrice.d.ts +246 -15
  20. package/types/resources/Discount.d.ts +107 -0
  21. package/types/resources/Download.d.ts +18 -0
  22. package/types/resources/EntitlementOverride.d.ts +101 -7
  23. package/types/resources/Estimate.d.ts +1021 -27
  24. package/types/resources/Event.d.ts +138 -8
  25. package/types/resources/Export.d.ts +622 -32
  26. package/types/resources/Feature.d.ts +287 -22
  27. package/types/resources/Gift.d.ts +296 -24
  28. package/types/resources/Hierarchy.d.ts +30 -0
  29. package/types/resources/HostedPage.d.ts +1046 -37
  30. package/types/resources/ImpactedItem.d.ts +41 -1
  31. package/types/resources/ImpactedSubscription.d.ts +36 -1
  32. package/types/resources/InAppSubscription.d.ts +369 -9
  33. package/types/resources/Invoice.d.ts +1942 -92
  34. package/types/resources/InvoiceEstimate.d.ts +75 -6
  35. package/types/resources/Item.d.ts +522 -16
  36. package/types/resources/ItemEntitlement.d.ts +162 -13
  37. package/types/resources/ItemFamily.d.ts +153 -15
  38. package/types/resources/ItemPrice.d.ts +951 -26
  39. package/types/resources/Media.d.ts +24 -0
  40. package/types/resources/NonSubscription.d.ts +46 -3
  41. package/types/resources/Order.d.ts +1172 -32
  42. package/types/resources/PaymentIntent.d.ts +293 -8
  43. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  44. package/types/resources/PaymentSource.d.ts +984 -55
  45. package/types/resources/PaymentVoucher.d.ts +252 -14
  46. package/types/resources/PortalSession.d.ts +154 -10
  47. package/types/resources/PromotionalCredit.d.ts +300 -16
  48. package/types/resources/Purchase.d.ts +206 -5
  49. package/types/resources/Quote.d.ts +1430 -62
  50. package/types/resources/QuoteLineGroup.d.ts +134 -5
  51. package/types/resources/QuotedCharge.d.ts +63 -5
  52. package/types/resources/QuotedSubscription.d.ts +192 -5
  53. package/types/resources/ResourceMigration.d.ts +68 -3
  54. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  55. package/types/resources/Subscription.d.ts +2564 -137
  56. package/types/resources/SubscriptionEntitlement.d.ts +116 -8
  57. package/types/resources/SubscriptionEstimate.d.ts +36 -2
  58. package/types/resources/TaxWithheld.d.ts +32 -0
  59. package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
  60. package/types/resources/TimeMachine.d.ts +82 -7
  61. package/types/resources/Token.d.ts +164 -7
  62. package/types/resources/Transaction.d.ts +567 -25
  63. package/types/resources/UnbilledCharge.d.ts +309 -14
  64. package/types/resources/Usage.d.ts +237 -13
  65. package/types/resources/VirtualBankAccount.d.ts +220 -17
@@ -1,72 +1,310 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface PaymentVoucher {
4
+
5
+ /**
6
+ * @description Uniquely identifies the payment voucher.
7
+
8
+ */
9
+
4
10
  id:string;
11
+
12
+ /**
13
+ * @description The id with which this voucher is referred in gateway.
14
+
15
+ */
16
+
5
17
  id_at_gateway?:string;
18
+
19
+ /**
20
+ * @description Type of the payment source. \* boleto - Boleto
21
+
22
+ */
23
+
6
24
  payment_voucher_type:PaymentVoucherType;
25
+
26
+ /**
27
+ * @description Timestamp indicating when the Voucher will expire if left unconsumed.
28
+
29
+ */
30
+
7
31
  expires_at?:number;
32
+
33
+ /**
34
+ * @description Current status of the payment voucher. \* consumed - Consumed for a transaction and cannot be used again \* expired - Expired before consumed and cannot be used again \* active - Active and ready to be consumed \* failure - Failed to create the voucher due to gateway rejection
35
+
36
+ */
37
+
8
38
  status?:'consumed' | 'expired' | 'failure' | 'active';
39
+
40
+ /**
41
+ * @description Identifier of the subscription for which this payment voucher is made.
42
+
43
+ */
44
+
9
45
  subscription_id?:string;
46
+
47
+ /**
48
+ * @description The currency code (ISO 4217 format) for the voucher.
49
+
50
+ */
51
+
10
52
  currency_code:string;
53
+
54
+ /**
55
+ * @description Amount for this payment voucher.
56
+
57
+ */
58
+
11
59
  amount?:number;
60
+
61
+ /**
62
+ * @description The gateway account used for this voucher
63
+
64
+ */
65
+
12
66
  gateway_account_id?:string;
67
+
68
+ /**
69
+ * @description Identifier of the payment source for which this payment voucher is created
70
+
71
+ */
72
+
13
73
  payment_source_id?:string;
74
+
75
+ /**
76
+ * @description The gateway through which this payment voucher was created.
77
+ **Note** : Note: Currently, &#x60;stripe&#x60; is the only supported gateway through which you can create the payment voucher. \* ecentric - Ecentric provides a seamless payment processing service in South Africa specializing on omnichannel capabilities. \* bluesnap - BlueSnap is a payment gateway. \* tco - 2Checkout is a payment gateway. \* first_data_global - First Data Global Gateway Virtual Terminal Account \* exact - Exact Payments is a payment gateway. \* bluepay - BluePay is a payment gateway. \* paypal_express_checkout - PayPal Express Checkout is a payment gateway. \* eway - eWAY Account is a payment gateway. \* paypal_payflow_pro - PayPal Payflow Pro is a payment gateway. \* razorpay - Razorpay is a fast growing payment service provider in India working with all leading banks and support for major local payment methods including Netbanking, UPI etc. \* global_payments - Global Payments is a payment service provider. \* amazon_payments - Amazon Payments is a payment service provider. \* not_applicable - Indicates that payment gateway is not applicable for this resource. \* checkout_com - Checkout.com is a payment gateway. \* adyen - Adyen is a payment gateway. \* braintree - Braintree is a payment gateway. \* nmi - NMI is a payment gateway. \* quickbooks - Intuit QuickBooks Payments gateway \* wepay - WePay is a payment gateway. \* worldpay - WorldPay is a payment gateway \* wirecard - WireCard Account is a payment service provider. \* chargebee_payments - Chargebee Payments gateway \* sage_pay - Sage Pay is a payment gateway. \* moneris_us - Moneris USA is a payment gateway. \* pin - Pin is a payment gateway \* authorize_net - Authorize.net is a payment gateway \* elavon - Elavon Virtual Merchant is a payment solution. \* paypal_pro - PayPal Pro Account is a payment gateway. \* orbital - Chase Paymentech(Orbital) is a payment gateway. \* paypal - PayPal Commerce is a payment gateway. \* beanstream - Bambora(formerly known as Beanstream) is a payment gateway. \* hdfc - HDFC Account is a payment gateway. \* ingenico_direct - Worldline Online Payments is a payment gateway. \* ogone - Ingenico ePayments (formerly known as Ogone) is a payment gateway. \* migs - MasterCard Internet Gateway Service payment gateway. \* stripe - Stripe is a payment gateway. \* vantiv - Vantiv is a payment gateway. \* moneris - Moneris is a payment gateway. \* bank_of_america - Bank of America Gateway \* chargebee - Chargebee test gateway. \* eway_rapid - eWAY Rapid is a payment gateway. \* gocardless - GoCardless is a payment service provider. \* mollie - Mollie is a payment gateway. \* paymill - PAYMILL is a payment gateway. \* balanced_payments - Balanced is a payment gateway \* cybersource - CyberSource is a payment gateway.
78
+
79
+ */
80
+
14
81
  gateway:Gateway;
82
+
83
+ /**
84
+ * @description Payload from the gateway response with voucher details
85
+
86
+ */
87
+
15
88
  payload?:string;
89
+
90
+ /**
91
+ * @description Error code received from the payment gateway on failure.
92
+
93
+ */
94
+
16
95
  error_code?:string;
96
+
97
+ /**
98
+ * @description Error message received from the payment gateway on failure.
99
+
100
+ */
101
+
17
102
  error_text?:string;
103
+
104
+ /**
105
+ * @description Chargebee Hosted Page url for payment voucher
106
+
107
+ */
108
+
18
109
  url?:string;
110
+
111
+ /**
112
+ * @description Indicates when this payment voucher occurred date.
113
+
114
+ */
115
+
19
116
  date?:number;
117
+
118
+ /**
119
+ * @description Version number of this resource. The &#x60;resource_version&#x60; 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.
120
+
121
+ */
122
+
20
123
  resource_version?:number;
124
+
125
+ /**
126
+ * @description Timestamp indicating when this voucher was last updated.
127
+
128
+ */
129
+
21
130
  updated_at?:number;
131
+
132
+ /**
133
+ * @description The unique identifier of the customer.
134
+
135
+ */
136
+
22
137
  customer_id:string;
138
+
139
+ /**
140
+ * @description Invoices related to the generated voucher
141
+
142
+ */
143
+
23
144
  linked_invoices?:PaymentVoucher.InvoicePaymentVoucher[];
24
145
  }
25
146
  export namespace PaymentVoucher {
26
- export class PaymentVoucherResource {
147
+ export class PaymentVoucherResource {
148
+ /**
149
+ * @description Retrieves vouchers for a customer in reverse chronological order.
150
+
151
+ */
152
+
27
153
  payment_vouchers_for_customer(customer_id:string, input?:Payment_vouchersForCustomerInputParam):ChargebeeRequest<Payment_vouchersForCustomerResponse>;
154
+
155
+ /**
156
+ * @description Retrieves vouchers for an invoice in reverse chronological order.
157
+
158
+ */
159
+
28
160
  payment_vouchers_for_invoice(invoice_id:string, input?:Payment_vouchersForInvoiceInputParam):ChargebeeRequest<Payment_vouchersForInvoiceResponse>;
161
+
162
+ /**
163
+ * @description Retrieves a voucher using the unique &#x60;payment_voucher_id&#x60;.
164
+
165
+ */
166
+
29
167
  retrieve(payment_voucher_id:string):ChargebeeRequest<RetrieveResponse>;
168
+
169
+ /**
170
+ * @description Creates a voucher type payment source. If you create this voucher type payment source using customer details, like tax ID, you can then generate a voucher with that payment source.
171
+
172
+ */
173
+
30
174
  create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
31
175
  }
32
- export interface Payment_vouchersForCustomerResponse {
33
- list:{payment_voucher:PaymentVoucher}[];
34
- next_offset?:string;
176
+ export interface Payment_vouchersForCustomerResponse {
177
+ /**
178
+ * @description Retrieves vouchers for a customer in reverse chronological order.
179
+
180
+ */
181
+
182
+ list:{payment_voucher:PaymentVoucher}[];
183
+
184
+ /**
185
+ * @description Retrieves vouchers for a customer in reverse chronological order.
186
+
187
+ */
188
+
189
+ next_offset?:string;
35
190
  }
36
191
  export interface Payment_vouchersForCustomerInputParam {
37
- [key : string]: any;
192
+ [key : string]: any;
193
+ /**
194
+ * @description The number of resources to be returned.
195
+
196
+ */
197
+
38
198
  limit?:number;
199
+
200
+ /**
201
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
202
+
203
+ */
204
+
39
205
  offset?:string;
206
+
207
+ /**
208
+ * @description Current status of Payment Voucher.
209
+
210
+ */
211
+
40
212
  status?:{in?:string,is?:'consumed' | 'expired' | 'failure' | 'active',is_not?:'consumed' | 'expired' | 'failure' | 'active',not_in?:string};
213
+
214
+ /**
215
+ * @description Retrieves vouchers for a customer in reverse chronological order.
216
+
217
+ */
218
+
41
219
  sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
42
220
  }
43
- export interface Payment_vouchersForInvoiceResponse {
44
- list:{payment_voucher:PaymentVoucher}[];
45
- next_offset?:string;
221
+ export interface Payment_vouchersForInvoiceResponse {
222
+ /**
223
+ * @description Retrieves vouchers for an invoice in reverse chronological order.
224
+
225
+ */
226
+
227
+ list:{payment_voucher:PaymentVoucher}[];
228
+
229
+ /**
230
+ * @description Retrieves vouchers for an invoice in reverse chronological order.
231
+
232
+ */
233
+
234
+ next_offset?:string;
46
235
  }
47
236
  export interface Payment_vouchersForInvoiceInputParam {
48
- [key : string]: any;
237
+ [key : string]: any;
238
+ /**
239
+ * @description The number of resources to be returned.
240
+
241
+ */
242
+
49
243
  limit?:number;
244
+
245
+ /**
246
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
247
+
248
+ */
249
+
50
250
  offset?:string;
251
+
252
+ /**
253
+ * @description Current status of Payment Voucher.
254
+
255
+ */
256
+
51
257
  status?:{in?:string,is?:'consumed' | 'expired' | 'failure' | 'active',is_not?:'consumed' | 'expired' | 'failure' | 'active',not_in?:string};
258
+
259
+ /**
260
+ * @description Retrieves vouchers for an invoice in reverse chronological order.
261
+
262
+ */
263
+
52
264
  sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
53
265
  }
54
- export interface RetrieveResponse {
55
- payment_voucher:PaymentVoucher;
266
+ export interface RetrieveResponse {
267
+ payment_voucher:PaymentVoucher;
56
268
  }
57
269
 
58
- export interface CreateResponse {
59
- payment_voucher:PaymentVoucher;
270
+ export interface CreateResponse {
271
+ payment_voucher:PaymentVoucher;
60
272
  }
61
273
  export interface CreateInputParam {
274
+
275
+ /**
276
+ * @description The unique identifier of the customer for whom you want to create the voucher.
277
+
278
+ */
279
+
62
280
  customer_id:string;
281
+
282
+ /**
283
+ * @description The identifier of the payment source used for generating the voucher.
284
+
285
+ */
286
+
63
287
  payment_source_id?:string;
288
+
289
+ /**
290
+ * @description Parameters for voucher_payment_source
291
+
292
+ */
293
+
64
294
  voucher_payment_source?:{voucher_type:VoucherType};
295
+
296
+ /**
297
+ * @description Parameters for &#x60;invoice_allocations&#x60;
298
+
299
+ */
300
+
65
301
  invoice_allocations?:{invoice_id:string}[];
66
302
  }
67
- export interface InvoicePaymentVoucher {
303
+ export interface InvoicePaymentVoucher {
68
304
  invoice_id?:string;
305
+
69
306
  txn_id?:string;
307
+
70
308
  applied_at?:number;
71
309
  }
72
310
  }
@@ -1,54 +1,198 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface PortalSession {
4
+
5
+ /**
6
+ * @description Unique identifier for the portal session.
7
+
8
+ */
9
+
4
10
  id:string;
11
+
12
+ /**
13
+ * @description Unique pre-authenticated portal session token to access customer portal directly.
14
+
15
+ */
16
+
5
17
  token:string;
18
+
19
+ /**
20
+ * @description Unique URL for accessing the customer portal. Once accessed, this cannot be reused.
21
+
22
+ */
23
+
6
24
  access_url:string;
25
+
26
+ /**
27
+ * @description URL to redirect when the user logs out from the portal.
28
+
29
+ */
30
+
7
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&#x27;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&#x27;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
+
8
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
+
9
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
+
10
52
  expires_at?:number;
53
+
54
+ /**
55
+ * @description Identifier of the customer.
56
+
57
+ */
58
+
11
59
  customer_id:string;
60
+
61
+ /**
62
+ * @description Timestamp indicating when this portal session URL was accessed by the user.
63
+
64
+ */
65
+
12
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
+
13
73
  logout_at?:number;
74
+
75
+ /**
76
+ * @description IP Address from which the portal session URL was accessed.
77
+
78
+ */
79
+
14
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
+
15
87
  logout_ipaddress?:string;
88
+
89
+ /**
90
+ * @description The list of customers for this session
91
+
92
+ */
93
+
16
94
  linked_customers?:PortalSession.LinkedCustomer[];
17
95
  }
18
96
  export namespace PortalSession {
19
- export class PortalSessionResource {
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
+
20
103
  create(input?:CreateInputParam):ChargebeeRequest<CreateResponse>;
104
+
105
+ /**
106
+ * @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:
107
+
108
+ * **auth_session_id** - this should be sent as part of the endpoint.
109
+ * **auth_session_token** - this should be sent as value for the input parameter **token**.
110
+
111
+
112
+
113
+ **Note:** This API is not applicable for [in-app](https://www.chargebee.com/docs/v3-self-serve-portal.html) portal.
114
+
115
+ */
116
+
21
117
  activate(portal_session_id:string, input:ActivateInputParam):ChargebeeRequest<ActivateResponse>;
118
+
119
+ /**
120
+ * @description Logs out the portal session. Typically this should be called when customers logout of your application.
121
+
122
+ If this API is called for a Portal Session that currently is in :
123
+
124
+ * &quot;created&quot; status, the session status will be marked as &quot;logged_out&quot; and the access URL will become invalid.
125
+ * &quot;logged_in&quot; status, the session status will be marked as &quot;logged_out&quot; and customer will not be able to use that session.
126
+ * &quot;logged_out&quot; status, this will return normally without changing any attribute of this resource.
127
+
128
+ */
129
+
22
130
  logout(portal_session_id:string):ChargebeeRequest<LogoutResponse>;
131
+
132
+ /**
133
+ * @description This API retrieves a portal session using &#x60;portal_session_id&#x60; as a path parameter.
134
+
135
+ */
136
+
23
137
  retrieve(portal_session_id:string):ChargebeeRequest<RetrieveResponse>;
24
138
  }
25
- export interface CreateResponse {
26
- portal_session:PortalSession;
139
+ export interface CreateResponse {
140
+ portal_session:PortalSession;
27
141
  }
28
142
  export interface CreateInputParam {
143
+
144
+ /**
145
+ * @description URL to redirect when the user logs out from the portal.
146
+
147
+ */
148
+
29
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
+
154
+ **Note:** This parameter is not applicable for [in-app](https://www.chargebee.com/docs/v3-self-serve-portal.html) portal.
155
+
156
+ */
157
+
30
158
  forward_url?:string;
159
+
160
+ /**
161
+ * @description Parameters for customer
162
+
163
+ */
164
+
31
165
  customer?:{id:string};
32
166
  }
33
- export interface ActivateResponse {
34
- portal_session:PortalSession;
167
+ export interface ActivateResponse {
168
+ portal_session:PortalSession;
35
169
  }
36
170
  export interface ActivateInputParam {
171
+
172
+ /**
173
+ * @description Unique pre-authenticated portal session token to access customer portal directly.
174
+
175
+ */
176
+
37
177
  token:string;
38
178
  }
39
- export interface LogoutResponse {
40
- portal_session:PortalSession;
179
+ export interface LogoutResponse {
180
+ portal_session:PortalSession;
41
181
  }
42
182
 
43
- export interface RetrieveResponse {
44
- portal_session:PortalSession;
183
+ export interface RetrieveResponse {
184
+ portal_session:PortalSession;
45
185
  }
46
186
 
47
- export interface LinkedCustomer {
187
+ export interface LinkedCustomer {
48
188
  customer_id?:string;
189
+
49
190
  email?:string;
191
+
50
192
  has_billing_address?:boolean;
193
+
51
194
  has_payment_method?:boolean;
195
+
52
196
  has_active_subscription?:boolean;
53
197
  }
54
198
  }