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,226 +1,1235 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface HostedPage {
4
+
5
+ /**
6
+ * @description Unique identifier generated for each hosted page requested.
7
+
8
+ */
9
+
4
10
  id?:string;
11
+
12
+ /**
13
+ * @description Type of the requested hosted page. \* collect_now - Collect Unpaid Invoices for a Customer \* checkout_gift - Checkout a gift subscription \* checkout_new - Checkout new Subscription \* extend_subscription - To extend a Subscription period \* checkout_one_time - Checkout one time \* update_payment_method - Update Payment Method for a Customer \* view_voucher - View Details of a voucher \* pre_cancel - This hosted page is used to help retain customers when they attempt to cancel their account or subscription. \* manage_payment_sources - Manage Payments for a customer \* checkout_existing - Checkout existing Subscription \* claim_gift - Claim a gift subscription
14
+
15
+ */
16
+
5
17
  type?:'update_payment_method' | 'checkout_one_time' | 'manage_payment_sources' | 'checkout_new' | 'view_voucher' | 'collect_now' | 'checkout_existing' | 'extend_subscription' | 'pre_cancel';
18
+
19
+ /**
20
+ * @description Unique URL for the hosted page that will be included in your website.
21
+
22
+ */
23
+
6
24
  url?:string;
25
+
26
+ /**
27
+ * @description Indicating the current state of the hosted page resource. \* acknowledged - Indicates the succeeded hosted page is acknowledged. \* created - Indicates the hosted page is just created. \* requested - Indicates the hosted page is requested by the website \* cancelled - Indicates the page is cancelled by the end user after requesting it. \* succeeded - Indicates the hosted page is successfully submitted by the user and response is sent to the return url.
28
+
29
+ */
30
+
7
31
  state?:'requested' | 'acknowledged' | 'created' | 'cancelled' | 'succeeded';
32
+
33
+ /**
34
+ * @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
35
+
36
+ */
37
+
8
38
  pass_thru_content?:string;
39
+
40
+ /**
41
+ * @description Indicates when this hosted page url is generated.
42
+
43
+ */
44
+
9
45
  created_at?:number;
46
+
47
+ /**
48
+ * @description Indicates when this hosted page url will expire. After this, the hosted page cannot be accessed.
49
+
50
+ */
51
+
10
52
  expires_at?:number;
53
+
54
+ /**
55
+ * @description This attribute will be returned only during retrieve hosted page API call and also the retrieved hosted page resource state should be either in &quot;succeeded&quot; or &quot;cancelled&quot; state.
56
+ If hosted page state is &quot;succeeded&quot;, then the subscription, customer, card \&amp; invoice(optional) resources during checkout can be obtained.
57
+ If hosted page is state is &quot;cancelled&quot;, then it will be empty i.e no information about checkout.
58
+
59
+ */
60
+
11
61
  content:object;
62
+
63
+ /**
64
+ * @description Timestamp indicating when this hosted page was last updated.
65
+
66
+ */
67
+
12
68
  updated_at?:number;
69
+
70
+ /**
71
+ * @description The version number of this resource. For every change made to the resource, &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds.
72
+
73
+ */
74
+
13
75
  resource_version?:number;
76
+
77
+ /**
78
+ * @description Customer Info (email, first name and last name) given in the checkout page used for tracking abandoned carts.
79
+ [Learn more](https://www.chargebee.com/docs/abandoned-carts.html)
80
+
81
+ */
82
+
14
83
  checkout_info?:object;
84
+
85
+ /**
86
+ * @description The unique ID of the [business entity](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) of this &#x60;hosted_page&#x60;.
87
+
88
+ */
89
+
15
90
  business_entity_id?:string;
16
91
  }
17
92
  export namespace HostedPage {
18
- export class HostedPageResource {
93
+ export class HostedPageResource {
94
+ /**
95
+ * @description Create a Chargebee hosted page to accept payment details from a customer and checkout [charge-items](./items?prod_cat_ver&#x3D;2) and [one-time charges](./invoices?prod_cat_ver&#x3D;2#create_invoice_for_items_and_one-time_charges).
96
+
97
+ The following steps describe how best to use this API:
98
+
99
+ 1. Call this endpoint, providing [item prices](./item_prices?prod_cat_ver&#x3D;2), [charges](./items?prod_cat_ver&#x3D;2), [coupons](./coupons?prod_cat_ver&#x3D;2) and a host of other details such as billing and shipping addresses of the customer, to be prefilled on the checkout page.
100
+ 2. Send the customer to the Checkout &#x60;url&#x60; received in the response.
101
+ 3. Once they complete checkout, the set of charge-items and one-time charges are automatically invoiced against the respective &#x60;customer&#x60; record in Chargebee, and they are redirected to the &#x60;redirect_url&#x60; with the &#x60;id&#x60; and &#x60;state&#x60; attributes passed as query string parameters.
102
+ 4. [Retrieve the hosted page](./hosted_pages?prod_cat_ver&#x3D;2#retrieve_a_hosted_page) at this stage to get the invoice details.
103
+
104
+ #### Customer resource lookup and creation {#customer_lookup1}
105
+
106
+ When [customer[id]](/docs/api/hosted_pages#checkout_charge_items_and_one_time_charges_customer_id) is provided for this operation, it is looked up by Chargebee, and if found, the hosted_page is created for it. If not found, a new customer resource is created with the ID provided, and the hosted_page is created.
107
+
108
+ ##### Multiple business entities
109
+
110
+ If multiple [business entities](/docs/api/advanced-features#mbe) are created for the site, the customer resource lookup and creation happen within the [context](/docs/api/advanced-features#mbe-context) of the business entity [specified](/docs/api/advanced-features#mbe-header-main) in this API call. If no business entity is specified, the customer resource lookup is performed within the [site context](/docs/api/advanced-features#mbe-context) , and if not found, the resource is created for the [default business entity](/docs/api/advanced-features#mbe-default-be) of the site.
111
+
112
+ */
113
+
19
114
  checkout_one_time_for_items(input?:CheckoutOneTimeForItemsInputParam):ChargebeeRequest<CheckoutOneTimeForItemsResponse>;
115
+
116
+ /**
117
+ * @description **Note:** If you&#x27;re using [In-App Checkout](https://www.chargebee.com/docs/2.0/checkout.html), use [Manage Payment Sources API](/docs/api/hosted_pages#manage_payment_sources) to request your customers to update their payment method details or change their payment method.
118
+
119
+ Using this API, you can request your customers to update their payment method details or change their payment method. This is used in scenarios like customers updating their payment methods before the end of trial or customers switching among payment methods.
120
+
121
+ When this API is invoked, it returns a hosted page URL. When the customers are directed to this URL, they will be able to change/update their payment methods.
122
+
123
+ Depending on the payment methods (Card, PayPal Express Checkout, Amazon Payments) that you offer your customers, they will find options to switch among the various methods of payment.
124
+ **Note:**
125
+
126
+ * If the card\[gateway\] parameter is passed, and the customer chooses Card as a payment method, then the card details are stored in the gateway which is passed. However, if the card\[gateway\] parameter is passed and the customer chooses PayPal Express Checkout/Amazon Payments as a payment method, the gateway passed will be ignored.
127
+ * The option of embedding into an iframe is not supported for PayPal Express Checkout and Amazon Payments as customers are redirected to the respective website pages. Hence if you have PayPal Express Checkout/Amazon Payments configured and pass the parameter embed&#x3D;true, this will result in an unsuccessful API request. Also, if you have all the three payment methods (Card, Paypal Express Checkout and Amazon Payments) configured and pass the parameter embed&#x3D;true, the returned hosted page URL will show only Card Payment as a payment method.
128
+
129
+ */
130
+
20
131
  update_payment_method(input?:UpdatePaymentMethodInputParam):ChargebeeRequest<UpdatePaymentMethodResponse>;
132
+
133
+ /**
134
+ * @description This API generates a hosted page URL to extend the billing cycle of a subscription.
135
+
136
+ */
137
+
21
138
  extend_subscription(input?:ExtendSubscriptionInputParam):ChargebeeRequest<ExtendSubscriptionResponse>;
139
+
140
+ /**
141
+ * @description Use this API to notify Chargebee about important events that occur on your web pages, such as subscription cancellations. An event contains data about affected resources and additional details such as when the change occurred.
142
+
143
+ */
144
+
22
145
  events(input:EventsInputParam):ChargebeeRequest<EventsResponse>;
146
+
147
+ /**
148
+ * @description Creates a hosted page for a customer (called the gifter) to gift a subscription to another customer (called the receiver).
149
+
150
+ #### Gifter customer resource lookup and creation {#gifter_lookup}
151
+
152
+ When [gifter[customer_id]](/docs/api/hosted_pages#checkout_gift_subscription_for_items_gifter_customer_id) is provided, it is looked up in Chargebee when the gifter completes the hosted page checkout. If not found, a new customer resource is created with this ID.
153
+
154
+ ##### Multiple business entities
155
+
156
+ If multiple [business entities](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) are created for the site, the lookup and creation of the gifter customer resource happen within the [context](/docs/api/advanced-features#mbe-context) of the business entity specified in this API call. If no business entity is [specified](/docs/api/advanced-features#mbe-header-main), the customer resource lookup is performed within the [site context](/docs/api/advanced-features#mbe-context), and if not found, the resource is created for the [default business entity](/docs/api/advanced-features#mbe-default-be) of the site.
157
+
158
+ #### Gift receiver customer resource lookup and creation {#receiver_lookup}
159
+
160
+ Once the gifter checks out using the hosted page returned by this endpoint, Chargebee checks if a customer resource with the receiver&#x27;s email address exists. The first such customer record is considered the receiver&#x27;s customer resource. A new customer resource is created for the receiver if none are found.
161
+
162
+ ##### Multiple business entities
163
+
164
+ If multiple [business entities](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) are created for the site, the lookup and creation of the gift receiver&#x27;s customer resource happen within the [context](/docs/api/advanced-features#mbe-context) of the business entity of the gifter
165
+
166
+ */
167
+
23
168
  checkout_gift_for_items(input?:CheckoutGiftForItemsInputParam):ChargebeeRequest<CheckoutGiftForItemsResponse>;
169
+
170
+ /**
171
+ * @description This API retrieves the list of hosted page resources.
172
+
173
+ */
174
+
24
175
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
176
+
177
+ /**
178
+ * @description Creates a &#x60;hosted_page&#x60; resource of type, &#x60;view_voucher&#x60;. When your end customers choose the Boleto payment method, you can generate a voucher for their pending invoice. Using this API, you can create a voucher_detail hosted page for your customers and email them a link to this hosted page. Your customers can review the voucher details on the page by clicking the link in the email.
179
+
180
+ */
181
+
25
182
  view_voucher(input?:ViewVoucherInputParam):ChargebeeRequest<ViewVoucherResponse>;
183
+
184
+ /**
185
+ * @description This API generates a hosted page URL to collect due payments for the customer.
186
+
187
+ */
188
+
26
189
  collect_now(input?:CollectNowInputParam):ChargebeeRequest<CollectNowResponse>;
190
+
191
+ /**
192
+ * @description This API generates a hosted page URL for the customer to accept a quote. If the hosted page URL has expired, a new URL will be generated automatically.
193
+
194
+ */
195
+
27
196
  accept_quote(input?:AcceptQuoteInputParam):ChargebeeRequest<AcceptQuoteResponse>;
197
+
198
+ /**
199
+ * @description Create a Chargebee hosted page to accept payment details from a customer and checkout a new subscription.
200
+
201
+ The following steps describe how best to use this API:
202
+
203
+ 1. Call this endpoint, providing [item prices](./item_prices?prod_cat_ver&#x3D;2), [coupons](./coupons?prod_cat_ver&#x3D;2) and a host of other details such as billing and shipping addresses to be prefilled for the customer on the checkout page.
204
+ 2. Send the customer to the Checkout &#x60;url&#x60; received in the response.
205
+ 3. Once they complete checkout, a new subscription is automatically created and the customer is redirected to the &#x60;redirect_url&#x60; with the &#x60;id&#x60; and &#x60;state&#x60; attributes passed as query string parameters.
206
+ Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons. Chargebee recommends listening to appropriate webhooks such as [subscription_created](./events#subscription_created) or [invoice_generated](./events#invoice_generated) to verify a successful checkout.
207
+ 4. [Retrieve the hosted page](./hosted_pages?prod_cat_ver&#x3D;2#retrieve_a_hosted_page) at this stage to get the subscription and invoice details.
208
+
209
+
210
+
211
+ #### Customer resource lookup and creation {#customer_lookup2}
212
+
213
+ When the [customer[id]](/docs/api/hosted_pages#create_checkout_for_a_new_subscription_customer_id) parameter is provided and if a customer resource with the ID is found to be already created in Chargebee, the subscription is created under that customer resource. If not found, then a new customer resource is created with the ID provided and the subscription is created under it.
214
+
215
+ ##### Multiple business entities
216
+
217
+ If multiple [business entities](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) are created for the site, the customer resource lookup and creation happen within the [context](/docs/api/advanced-features#mbe-context) of the business entity [specified](/docs/api/advanced-features#mbe-header-main) in this API call. If no business entity is specified, the customer resource lookup is performed within the [site context](/docs/api/advanced-features#mbe-context), and if not found, the resource is created for the [default business entity](/docs/api/advanced-features#mbe-default-be) of the site.
218
+
219
+ */
220
+
28
221
  checkout_new_for_items(input?:CheckoutNewForItemsInputParam):ChargebeeRequest<CheckoutNewForItemsResponse>;
222
+
223
+ /**
224
+ * @description This API generates a hosted page URL to claim a gifted subscription.
225
+
226
+ */
227
+
29
228
  claim_gift(input?:ClaimGiftInputParam):ChargebeeRequest<ClaimGiftResponse>;
229
+
230
+ /**
231
+ * @description Create a Chargebee hosted page to accept payment details from a customer and checkout to update the subscription.
232
+
233
+ The following steps describe how best to use this API:
234
+
235
+ 1. Provide [item prices](./item_prices?prod_cat_ver&#x3D;2), [coupons](./coupons?prod_cat_ver&#x3D;2) and a host of other details such as billing and shipping addresses to be prefilled for the customer on the checkout page.
236
+ 2. Send the customer to the Checkout &#x60;url&#x60; received in the response. They can now add a payment method or use an existing one, to complete the checkout.
237
+ 3. The subscription is updated and the customer is redirected to the &#x60;redirect_url&#x60; with the &#x60;id&#x60; and &#x60;state&#x60; attributes passed as query string parameters.
238
+ Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons. Chargebee recommends listening to appropriate webhooks such as [subscription_created](./events#subscription_created) or [invoice_generated](./events#invoice_generated) to verify a successful checkout.
239
+ 4. [Retrieve the hosted page](./hosted_pages?prod_cat_ver&#x3D;2#retrieve_a_hosted_page) at this stage to get the subscription and invoice details.
240
+
241
+
242
+
243
+
244
+ */
245
+
30
246
  checkout_existing_for_items(input?:CheckoutExistingForItemsInputParam):ChargebeeRequest<CheckoutExistingForItemsResponse>;
247
+
248
+ /**
249
+ * @description Creates a &#x60;hosted_page&#x60; resource of &#x60;type&#x60; &#x60;pre_cancel&#x60;. Route canceling users to this page to provide them a retention experience and start saving revenue.
250
+ The hosted page is created in accordance with the retention experience [configured in the Chargebee Retention app](https://help.brightback.com/article/239-steps-to-get-brightback-ready-to-launch-for-chargebee-billing-merchants), along with the data provided as input to this endpoint. Call the endpoint before your customer clicks the **Cancel** button, and when they do, route them to the [url](https://apidocs.chargebee.com/docs/api/hosted_pages#hosted_page_url) in the endpoint response.
251
+
252
+ */
253
+
31
254
  pre_cancel(input?:PreCancelInputParam):ChargebeeRequest<PreCancelResponse>;
255
+
256
+ /**
257
+ * @description When a hosted page is successfully completed by the user and processed by Chargebee, its [&#x60;state&#x60;](hosted_pages#hosted_page_state) is automatically changed to &#x60;succeeded&#x60;. Acknowledging a hosted page confirms that you have moved the customer details from Chargebee into your system and are ready to fulfill it. This API is used to acknowledge the hosted page in &#x60;succeeded&#x60; state and change its state to &#x60;acknowledged&#x60;.
258
+
259
+ **Note:** The hosted page status must be succeeded for this API call to be allowed.
260
+
261
+ */
262
+
32
263
  acknowledge(hosted_page_id:string):ChargebeeRequest<AcknowledgeResponse>;
264
+
265
+ /**
266
+ * @description This is applicable only for Direct Debit via SEPA, Bacs, Bg Autogiro, BECS (for both Australia and New Zealand) and PAD. For Direct Debit, the customer needs to accept an agreement that allows the merchant to debit their bank account. This agreement PDF allows you to easily display scheme-rules compliant Direct Debit mandates to your customers.
267
+
268
+ This API retrieves the redirect link to the corresponding agreement for customers. The agreement PDF can be your &quot;Thank You&quot; page or sent by email to customers. Communicating this PDF to your customers is mandatory.
269
+
270
+ Customer locale is used to generate the PDF in the required language. If a customer language is not supported, the PDF is generated in English. Checkout the [list of languages](https://developer.gocardless.com/api-reference/#mandate-pdfs-create-a-mandate-pdf) supported by GoCardless.
271
+
272
+ */
273
+
33
274
  retrieve_agreement_pdf(input:RetrieveAgreementPdfInputParam):ChargebeeRequest<RetrieveAgreementPdfResponse>;
275
+
276
+ /**
277
+ * @description When you retrieve a hosted page whose &#x60;status&#x60; is &#x60;successful&#x60;, the &#x60;content&#x60; attribute has the following objects based on the &#x60;type&#x60; of the hosted page.
278
+
279
+ |---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
280
+ | **&#x60;type&#x60; of hosted page** | **&#x60;content&#x60; attribute constituents** |
281
+ | &#x60;checkout_new&#x60; | * &#x60;customer&#x60;: the object representing the details of the [Customer](/docs/api/customers#customer_attributes) for whom the subscription was created. * &#x60;subscription&#x60;: the new Subscription object created. * &#x60;card&#x60;: the [Card](/docs/api/cards#card_attributes) object if the [payment method](/docs/api/customers#customer_payment_method) &#x60;type&#x60; used was &#x60;card&#x60;. * &#x60;invoice&#x60;: the Invoice object, if an invoice was generated. |
282
+ | &#x60;checkout_existing&#x60; | * &#x60;customer&#x60;: the object representing the details of the [Customer](/docs/api/customers#customer_attributes) whose subscription was changed. * &#x60;subscription&#x60;: the updated Subscription object created. * &#x60;card&#x60;: the [Card](/docs/api/cards#card_attributes) object if the [payment method](/docs/api/customers#customer_payment_method) &#x60;type&#x60; used was &#x60;card&#x60;. * &#x60;invoice&#x60;: the Invoice object, if an invoice was generated for the subscription change. |
283
+ | &#x60;update_payment_method&#x60; | * &#x60;customer&#x60;: the object representing the details of the [Customer](/docs/api/customers#customer_attributes) whose subscription was changed. * &#x60;card&#x60;: the [Card](/docs/api/cards#card_attributes) object if the new [payment method](/docs/api/customers#customer_payment_method) added was of &#x60;type&#x60; &#x60;card&#x60;. |
284
+ | &#x60;pre_cancel&#x60; | &#x60;retention&#x60;: Use the &#x60;bypass&#x60; flag in this object to route the cancellation flow to the merchants&#x27; portal or the Chargebee Retention. * If &#x60;bypass&#x60; flag is &#x60;true&#x60;, you should route the end-customers to your native cancellation flow. * If the &#x60;bypass&#x60; flag is &#x60;false&#x60;, you should route the end-customers to the hosted page URL. **Note:** Retention is currently in &#x60;beta&#x60;. To enable Retention, [Contact Support.](https://support.chargebee.com/support/home) |
285
+ | &#x60;collect_now&#x60; | * &#x60;transactions&#x60;: this object should contain a list of [transactions](/docs/api/transactions#transaction_attributes) triggered from the &#x60;collect_now&#x60; hosted page. Each transaction in the list should be represented as an array that includes relevant information about the transaction, such as transaction ID, customer ID, amount, currency, payment method, and any other relevant details. * &#x60;customer&#x60;: this object should contain the customer record associated with the transaction. The key, &#x60;customer_id&#x60; is used to link the transaction to the corresponding customer record. |
286
+
287
+
288
+ */
289
+
34
290
  retrieve(hosted_page_id:string):ChargebeeRequest<RetrieveResponse>;
291
+
292
+ /**
293
+ * @description This API generates a hosted page URL to add new or update existing payment sources for the customer.
294
+
295
+ */
296
+
35
297
  manage_payment_sources(input?:ManagePaymentSourcesInputParam):ChargebeeRequest<ManagePaymentSourcesResponse>;
36
298
  }
37
- export interface CheckoutOneTimeForItemsResponse {
38
- hosted_page:HostedPage;
299
+ export interface CheckoutOneTimeForItemsResponse {
300
+ hosted_page:HostedPage;
39
301
  }
40
302
  export interface CheckoutOneTimeForItemsInputParam {
303
+
304
+ /**
305
+ * @description Sets the [context]() for this operation to the [business entity](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.
306
+ **Note**
307
+
308
+ An alternative way of passing this parameter is by means of a [custom HTTP header](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe-header-main).
309
+ **See also**
310
+
311
+ [Customer resource lookup and creation.](/docs/api/hosted_pages#customer_lookup1)
312
+
313
+ */
314
+
41
315
  business_entity_id?:string;
316
+
317
+ /**
318
+ * @description Specifies the checkout layout that overrides the default checkout layout configured in the Checkout \&amp; Self-Serve Portal settings. . \* in_app - Indicates in-app checkout version \* full_page - Indicates full page checkout version
319
+
320
+ */
321
+
42
322
  layout?:Layout;
323
+
324
+ /**
325
+ * @description A note for this particular invoice. This, and [all other notes](/docs/api/invoices#invoice_notes) for the invoice are displayed on the PDF invoice sent to the customer.
326
+
327
+ */
328
+
43
329
  invoice_note?:string;
330
+
331
+ /**
332
+ * @description List of Coupons to be added.
333
+
334
+ */
335
+
44
336
  coupon_ids?:string[];
337
+
338
+ /**
339
+ * @description The currency code (ISO 4217 format) of the invoice amount.
340
+
341
+ */
342
+
45
343
  currency_code?:string;
344
+
345
+ /**
346
+ * @description The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
347
+
348
+ **Note** :
349
+
350
+ * Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as [&#x60;subscription_created&#x60;](https://apidocs.chargebee.com/docs/api/events#subscription_created) or [&#x60;invoice_generated&#x60;](https://apidocs.chargebee.com/docs/api/events#invoice_generated)to verify a successful checkout.
351
+ * Redirect URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this redirect URL.
352
+ * *Eg :* *http://yoursite.com?id&#x3D;* *\&lt;hosted_page_id\&gt;\&amp;state&#x3D;succeeded*
353
+ * This parameter is not applicable for iframe messaging.
354
+
355
+ */
356
+
46
357
  redirect_url?:string;
358
+
359
+ /**
360
+ * @description The customers will be redirected to this URL upon canceling checkout. The hosted page id and state will be passed as parameters to this URL.
361
+
362
+ **Note** :
363
+
364
+ * Cancel URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this cancel URL.
365
+ *Eg : http://yoursite.com?id&#x3D;\&lt;hosted_page_id\&gt;\&amp;state&#x3D;cancelled*
366
+ * This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
367
+
368
+ */
369
+
47
370
  cancel_url?:string;
371
+
372
+ /**
373
+ * @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
374
+
375
+ */
376
+
48
377
  pass_thru_content?:string;
378
+
379
+ /**
380
+ * @description Parameters for customer
381
+
382
+ */
383
+
49
384
  customer?:object;
385
+
386
+ /**
387
+ * @description Parameters for invoice
388
+
389
+ */
390
+
50
391
  invoice?:{po_number?:string};
392
+
393
+ /**
394
+ * @description Parameters for card
395
+
396
+ */
397
+
51
398
  card?:{gateway_account_id?:string};
399
+
400
+ /**
401
+ * @description Parameters for billing_address
402
+
403
+ */
404
+
52
405
  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};
406
+
407
+ /**
408
+ * @description Parameters for shipping_address
409
+
410
+ */
411
+
53
412
  shipping_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};
413
+
414
+ /**
415
+ * @description Parameters for item_prices
416
+
417
+ */
418
+
54
419
  item_prices?:{date_from?:number,date_to?:number,item_price_id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
420
+
421
+ /**
422
+ * @description Parameters for item_tiers
423
+
424
+ */
425
+
55
426
  item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
427
+
428
+ /**
429
+ * @description Parameters for charges
430
+
431
+ */
432
+
56
433
  charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
434
+
435
+ /**
436
+ * @description Parameters for discounts
437
+
438
+ */
439
+
57
440
  discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
441
+
442
+ /**
443
+ * @description Parameters for entity_identifiers
444
+
445
+ */
446
+
58
447
  entity_identifiers?:{id?:string,operation?:Operation,scheme?:string,standard?:string,value?:string}[];
59
448
  }
60
- export interface UpdatePaymentMethodResponse {
61
- hosted_page:HostedPage;
449
+ export interface UpdatePaymentMethodResponse {
450
+ hosted_page:HostedPage;
62
451
  }
63
452
  export interface UpdatePaymentMethodInputParam {
453
+
454
+ /**
455
+ * @description The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
456
+
457
+ **Note** :
458
+
459
+ * Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as [&#x60;subscription_created&#x60;](https://apidocs.chargebee.com/docs/api/events#subscription_created) or [&#x60;invoice_generated&#x60;](https://apidocs.chargebee.com/docs/api/events#invoice_generated)to verify a successful checkout.
460
+ * Redirect URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this redirect URL.
461
+ * *Eg :* *http://yoursite.com?id&#x3D;* *\&lt;hosted_page_id\&gt;\&amp;state&#x3D;succeeded*
462
+ * This parameter is not applicable for iframe messaging.
463
+
464
+ */
465
+
64
466
  redirect_url?:string;
467
+
468
+ /**
469
+ * @description The customers will be redirected to this URL upon canceling checkout. The hosted page id and state will be passed as parameters to this URL.
470
+
471
+ **Note** :
472
+
473
+ * Cancel URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this cancel URL.
474
+ *Eg : http://yoursite.com?id&#x3D;\&lt;hosted_page_id\&gt;\&amp;state&#x3D;cancelled*
475
+ * This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
476
+
477
+ */
478
+
65
479
  cancel_url?:string;
480
+
481
+ /**
482
+ * @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
483
+
484
+ */
485
+
66
486
  pass_thru_content?:string;
487
+
488
+ /**
489
+ * @description If true then iframe will communicate with the parent window. Applicable only for embedded(iframe) hosted pages. If you&#x27;re using iframe_messaging you need to implement onSuccess \&amp; onCancel callbacks.
490
+
491
+ **Note** : This parameter is not applicable for [in-app](https://www.chargebee.com/docs/checkout-v3.html) checkout.
492
+
493
+ */
494
+
67
495
  iframe_messaging?:boolean;
496
+
497
+ /**
498
+ * @description Parameters for customer
499
+
500
+ */
501
+
68
502
  customer?:{id:string};
503
+
504
+ /**
505
+ * @description Parameters for card
506
+
507
+ */
508
+
69
509
  card?:{gateway_account_id?:string};
70
510
  }
71
- export interface ExtendSubscriptionResponse {
72
- hosted_page:HostedPage;
511
+ export interface ExtendSubscriptionResponse {
512
+ hosted_page:HostedPage;
73
513
  }
74
514
  export interface ExtendSubscriptionInputParam {
515
+
516
+ /**
517
+ * @description Expiry (in days) for the link generated. No expiry will be set if this is not specified.
518
+
519
+ */
520
+
75
521
  expiry?:number;
522
+
523
+ /**
524
+ * @description Number of billing cycles to extend. If not specified, plan&#x27;s billing cycle will be used.
525
+
526
+ */
527
+
76
528
  billing_cycle?:number;
529
+
530
+ /**
531
+ * @description Parameters for subscription
532
+
533
+ */
534
+
77
535
  subscription?:{id:string};
78
536
  }
79
- export interface EventsResponse {
80
- success:boolean;
537
+ export interface EventsResponse {
538
+ success:boolean;
81
539
  }
82
540
  export interface EventsInputParam {
541
+
542
+ /**
543
+ * @description null
544
+
545
+ */
546
+
83
547
  event_name:EventName;
548
+
549
+ /**
550
+ * @description Timestamp indicating when this event had occurred. .
551
+
552
+ */
553
+
84
554
  occurred_at?:number;
555
+
556
+ /**
557
+ * @description The meta data description of the event in key-value pair. The value is a JSON object with the following keys and their values.
558
+
559
+ * &#x60;subscription_id&#x60;: A unique and immutable identifier for the subscription.
560
+ .
561
+
562
+ */
563
+
85
564
  event_data:object;
86
565
  }
87
- export interface CheckoutGiftForItemsResponse {
88
- hosted_page:HostedPage;
566
+ export interface CheckoutGiftForItemsResponse {
567
+ hosted_page:HostedPage;
89
568
  }
90
569
  export interface CheckoutGiftForItemsInputParam {
570
+
571
+ /**
572
+ * @description Sets the [context]() for this operation to the [business entity](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.
573
+ **Note**
574
+
575
+ An alternative way of passing this parameter is by means of a [custom HTTP header](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe-header-main).
576
+ **See also**
577
+
578
+ Gifter customer resource lookup and creation.
579
+
580
+ */
581
+
91
582
  business_entity_id?:string;
583
+
584
+ /**
585
+ * @description The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
586
+
587
+ **Note** :
588
+
589
+ * Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as [&#x60;subscription_created&#x60;](https://apidocs.chargebee.com/docs/api/events#subscription_created) or [&#x60;invoice_generated&#x60;](https://apidocs.chargebee.com/docs/api/events#invoice_generated)to verify a successful checkout.
590
+ * Redirect URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this redirect URL.
591
+ * *Eg :* *http://yoursite.com?id&#x3D;* *\&lt;hosted_page_id\&gt;\&amp;state&#x3D;succeeded*
592
+ * This parameter is not applicable for iframe messaging.
593
+
594
+ */
595
+
92
596
  redirect_url?:string;
597
+
598
+ /**
599
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or [coupon codes](https://apidocs.chargebee.com/docs/api/coupon_codes).
600
+
601
+ */
602
+
93
603
  coupon_ids?:string[];
604
+
605
+ /**
606
+ * @description Parameters for gifter
607
+
608
+ */
609
+
94
610
  gifter?:{customer_id?:string,locale?:string};
611
+
612
+ /**
613
+ * @description Parameters for subscription_items
614
+
615
+ */
616
+
95
617
  subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string}[];
96
618
  }
97
- export interface ListResponse {
98
- list:{hosted_page:HostedPage}[];
99
- next_offset?:string;
619
+ export interface ListResponse {
620
+ /**
621
+ * @description This API retrieves the list of hosted page resources.
622
+
623
+ */
624
+
625
+ list:{hosted_page:HostedPage}[];
626
+
627
+ /**
628
+ * @description This API retrieves the list of hosted page resources.
629
+
630
+ */
631
+
632
+ next_offset?:string;
100
633
  }
101
634
  export interface ListInputParam {
102
- [key : string]: any;
635
+ [key : string]: any;
636
+ /**
637
+ * @description The number of resources to be returned.
638
+
639
+ */
640
+
103
641
  limit?:number;
642
+
643
+ /**
644
+ * @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.
645
+
646
+ */
647
+
104
648
  offset?:string;
649
+
650
+ /**
651
+ * @description Unique identifier generated for each hosted page requested.
652
+
653
+ */
654
+
105
655
  id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
656
+
657
+ /**
658
+ * @description Type of the requested hosted page.
659
+
660
+ */
661
+
106
662
  type?:{in?:string,is?:'update_payment_method' | 'checkout_one_time' | 'manage_payment_sources' | 'checkout_new' | 'view_voucher' | 'collect_now' | 'checkout_existing' | 'extend_subscription' | 'pre_cancel',is_not?:'update_payment_method' | 'checkout_one_time' | 'manage_payment_sources' | 'checkout_new' | 'view_voucher' | 'collect_now' | 'checkout_existing' | 'extend_subscription' | 'pre_cancel',not_in?:string};
663
+
664
+ /**
665
+ * @description Indicating the current state of the hosted page resource.
666
+
667
+ */
668
+
107
669
  state?:{in?:string,is?:'requested' | 'acknowledged' | 'created' | 'cancelled' | 'succeeded',is_not?:'requested' | 'acknowledged' | 'created' | 'cancelled' | 'succeeded',not_in?:string};
670
+
671
+ /**
672
+ * @description Timestamp indicating when this hosted page was last updated.
673
+
674
+ */
675
+
108
676
  updated_at?:{after?:string,before?:string,between?:string,on?:string};
109
677
  }
110
- export interface ViewVoucherResponse {
111
- hosted_page:HostedPage;
678
+ export interface ViewVoucherResponse {
679
+ hosted_page:HostedPage;
112
680
  }
113
681
  export interface ViewVoucherInputParam {
682
+
683
+ /**
684
+ * @description Parameters for payment_voucher
685
+
686
+ */
687
+
114
688
  payment_voucher?:{id:string};
689
+
690
+ /**
691
+ * @description Parameters for customer
692
+
693
+ */
694
+
115
695
  customer?:{locale?:string};
116
696
  }
117
- export interface CollectNowResponse {
118
- hosted_page:HostedPage;
697
+ export interface CollectNowResponse {
698
+ hosted_page:HostedPage;
119
699
  }
120
700
  export interface CollectNowInputParam {
701
+
702
+ /**
703
+ * @description Used to specify the destination URL to which a user is redirected after invoices are paid. The [transaction ID](/docs/api/transactions#transaction_id) of the transactions made through the Pay Now hosted page will be sent as return variables along with the URL.
704
+
705
+ */
706
+
121
707
  redirect_url?:string;
708
+
709
+ /**
710
+ * @description The currency code (ISO 4217 format) of the specified *credit amount*.
711
+
712
+ */
713
+
122
714
  currency_code?:string;
715
+
716
+ /**
717
+ * @description Parameters for customer
718
+
719
+ */
720
+
123
721
  customer?:{id:string};
722
+
723
+ /**
724
+ * @description Parameters for card
725
+
726
+ */
727
+
124
728
  card?:{gateway_account_id?:string};
125
729
  }
126
- export interface AcceptQuoteResponse {
127
- hosted_page:HostedPage;
730
+ export interface AcceptQuoteResponse {
731
+ hosted_page:HostedPage;
128
732
  }
129
733
  export interface AcceptQuoteInputParam {
734
+
735
+ /**
736
+ * @description The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
737
+
738
+ **Note** :
739
+
740
+ * Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as [&#x60;subscription_created&#x60;](https://apidocs.chargebee.com/docs/api/events#subscription_created) or [&#x60;invoice_generated&#x60;](https://apidocs.chargebee.com/docs/api/events#invoice_generated)to verify a successful checkout.
741
+ * Redirect URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this redirect URL.
742
+ * *Eg :* *http://yoursite.com?id&#x3D;* *\&lt;hosted_page_id\&gt;\&amp;state&#x3D;succeeded*
743
+ * This parameter is not applicable for iframe messaging.
744
+
745
+ */
746
+
130
747
  redirect_url?:string;
748
+
749
+ /**
750
+ * @description Parameters for quote
751
+
752
+ */
753
+
131
754
  quote?:{id:string};
132
755
  }
133
- export interface CheckoutNewForItemsResponse {
134
- hosted_page:HostedPage;
756
+ export interface CheckoutNewForItemsResponse {
757
+ hosted_page:HostedPage;
135
758
  }
136
759
  export interface CheckoutNewForItemsInputParam {
760
+
761
+ /**
762
+ * @description Specifies the checkout layout that overrides the default checkout layout configured in the Checkout \&amp; Self-Serve Portal settings. . \* in_app - Indicates in-app checkout version \* full_page - Indicates full page checkout version
763
+
764
+ */
765
+
137
766
  layout?:Layout;
767
+
768
+ /**
769
+ * @description Sets the [context]() for this operation to the [business entity](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe) specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.
770
+ **Note**
771
+
772
+ An alternative way of passing this parameter is by means of a [custom HTTP header](/docs/api/advanced-features?prod_cat_ver&#x3D;2#mbe-header-main).
773
+ **See also**
774
+
775
+ [Customer resource lookup and creation.](/docs/api/hosted_pages#customer_lookup2)
776
+
777
+ */
778
+
138
779
  business_entity_id?:string;
780
+
781
+ /**
782
+ * @description The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles [set for the plan-item price](https://apidocs.chargebee.com/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_billing_cycles) is used.
783
+
784
+ */
785
+
139
786
  billing_cycles?:number;
787
+
788
+ /**
789
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
790
+
791
+ */
792
+
140
793
  mandatory_items_to_remove?:string[];
794
+
795
+ /**
796
+ * @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
797
+
798
+ */
799
+
141
800
  terms_to_charge?:number;
801
+
802
+ /**
803
+ * @description Override the [billing alignment mode](https://www.chargebee.com/docs/calendar-billing.html#alignment-of-billing-date) for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site. \* immediate - Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly.. \* delayed - Subscription period will be aligned with the configured billing date at the next renewal.
804
+
805
+ */
806
+
142
807
  billing_alignment_mode?:BillingAlignmentMode;
808
+
809
+ /**
810
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or [coupon codes](https://apidocs.chargebee.com/docs/api/coupon_codes).
811
+
812
+ */
813
+
143
814
  coupon_ids?:string[];
815
+
816
+ /**
817
+ * @description The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
818
+
819
+ **Note** :
820
+
821
+ * Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as [&#x60;subscription_created&#x60;](https://apidocs.chargebee.com/docs/api/events#subscription_created) or [&#x60;invoice_generated&#x60;](https://apidocs.chargebee.com/docs/api/events#invoice_generated)to verify a successful checkout.
822
+ * Redirect URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this redirect URL.
823
+ * *Eg :* *http://yoursite.com?id&#x3D;* *\&lt;hosted_page_id\&gt;\&amp;state&#x3D;succeeded*
824
+ * This parameter is not applicable for iframe messaging.
825
+
826
+ */
827
+
144
828
  redirect_url?:string;
829
+
830
+ /**
831
+ * @description The customers will be redirected to this URL upon canceling checkout. The hosted page id and state will be passed as parameters to this URL.
832
+
833
+ **Note** :
834
+
835
+ * Cancel URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this cancel URL.
836
+ *Eg : http://yoursite.com?id&#x3D;\&lt;hosted_page_id\&gt;\&amp;state&#x3D;cancelled*
837
+ * This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
838
+
839
+ */
840
+
145
841
  cancel_url?:string;
842
+
843
+ /**
844
+ * @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
845
+
846
+ */
847
+
146
848
  pass_thru_content?:string;
849
+
850
+ /**
851
+ * @description Allow the customer to select an offline payment method during checkout. The choice of payment methods can be configured via the Chargebee UI.
852
+
853
+ */
854
+
147
855
  allow_offline_payment_methods?:boolean;
856
+
857
+ /**
858
+ * @description Parameters for subscription
859
+
860
+ */
861
+
148
862
  subscription?:object;
863
+
864
+ /**
865
+ * @description Parameters for customer
866
+
867
+ */
868
+
149
869
  customer?:object;
870
+
871
+ /**
872
+ * @description Parameters for card
873
+
874
+ */
875
+
150
876
  card?:{gateway_account_id?:string};
877
+
878
+ /**
879
+ * @description Parameters for billing_address
880
+
881
+ */
882
+
151
883
  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};
884
+
885
+ /**
886
+ * @description Parameters for shipping_address
887
+
888
+ */
889
+
152
890
  shipping_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};
891
+
892
+ /**
893
+ * @description Parameters for contract_term
894
+
895
+ */
896
+
153
897
  contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
898
+
899
+ /**
900
+ * @description Parameters for subscription_items
901
+
902
+ */
903
+
154
904
  subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
905
+
906
+ /**
907
+ * @description Parameters for discounts
908
+
909
+ */
910
+
155
911
  discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
912
+
913
+ /**
914
+ * @description Parameters for item_tiers
915
+
916
+ */
917
+
156
918
  item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
919
+
920
+ /**
921
+ * @description Parameters for entity_identifiers
922
+
923
+ */
924
+
157
925
  entity_identifiers?:{id?:string,operation?:Operation,scheme?:string,standard?:string,value?:string}[];
158
926
  }
159
- export interface ClaimGiftResponse {
160
- hosted_page:HostedPage;
927
+ export interface ClaimGiftResponse {
928
+ hosted_page:HostedPage;
161
929
  }
162
930
  export interface ClaimGiftInputParam {
931
+
932
+ /**
933
+ * @description The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
934
+
935
+ **Note** :
936
+
937
+ * Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as [&#x60;subscription_created&#x60;](https://apidocs.chargebee.com/docs/api/events#subscription_created) or [&#x60;invoice_generated&#x60;](https://apidocs.chargebee.com/docs/api/events#invoice_generated)to verify a successful checkout.
938
+ * Redirect URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this redirect URL.
939
+ * *Eg :* *http://yoursite.com?id&#x3D;* *\&lt;hosted_page_id\&gt;\&amp;state&#x3D;succeeded*
940
+ * This parameter is not applicable for iframe messaging.
941
+
942
+ */
943
+
163
944
  redirect_url?:string;
945
+
946
+ /**
947
+ * @description Parameters for gift
948
+
949
+ */
950
+
164
951
  gift?:{id:string};
952
+
953
+ /**
954
+ * @description Parameters for customer
955
+
956
+ */
957
+
165
958
  customer?:{locale?:string};
166
959
  }
167
- export interface CheckoutExistingForItemsResponse {
168
- hosted_page:HostedPage;
960
+ export interface CheckoutExistingForItemsResponse {
961
+ hosted_page:HostedPage;
169
962
  }
170
963
  export interface CheckoutExistingForItemsInputParam {
964
+
965
+ /**
966
+ * @description Specifies the checkout layout that overrides the default checkout layout configured in the Checkout \&amp; Self-Serve Portal settings. . \* in_app - Indicates in-app checkout version \* full_page - Indicates full page checkout version
967
+
968
+ */
969
+
171
970
  layout?:Layout;
971
+
972
+ /**
973
+ * @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver&#x3D;2) that are to be removed from the subscription.
974
+
975
+ */
976
+
172
977
  mandatory_items_to_remove?:string[];
978
+
979
+ /**
980
+ * @description If &#x60;true&#x60; then the existing &#x60;subscription_items&#x60; list for the subscription is replaced by the one provided. If &#x60;false&#x60; then the provided &#x60;subscription_items&#x60; list gets added to the existing list.
981
+
982
+ */
983
+
173
984
  replace_items_list?:boolean;
985
+
986
+ /**
987
+ * @description The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if &#x60;create_pending_invoices&#x60; is set to &#x60;true&#x60;, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. taxes and line_item_taxes are computed based on the tax configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
988
+
989
+ * &#x60;invoice_date&#x60; must be in the past.
990
+ * &#x60;invoice_date&#x60; is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
991
+ * It is not earlier than &#x60;changes_scheduled_at&#x60;, &#x60;reactivate_from&#x60;, or &#x60;trial_end&#x60;.
992
+ * &#x60;invoice_immediately&#x60; is &#x60;true&#x60;.
993
+ .
994
+
995
+ */
996
+
174
997
  invoice_date?:number;
998
+
999
+ /**
1000
+ * @description Billing cycles set for plan-item price is used by default.
1001
+
1002
+ */
1003
+
175
1004
  billing_cycles?:number;
1005
+
1006
+ /**
1007
+ * @description The number of subscription billing cycles to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html). If a new term is started for the subscription due to this API call, then &#x60;terms_to_charge&#x60; is inclusive of this new term. See description for the &#x60;force_term_reset&#x60; parameter to learn more about when a subscription term is reset.
1008
+
1009
+ */
1010
+
176
1011
  terms_to_charge?:number;
1012
+
1013
+ /**
1014
+ * @description If the subscription &#x60;status&#x60; is &#x60;cancelled&#x60; and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated.
1015
+ **Note:** It is recommended not to pass this parameter along with &#x60;changed_scheduled_at&#x60;. &#x60;reactivate_from&#x60; can be backdated (set to a value in the past). Use backdating when the subscription has been reactivated already but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
1016
+
1017
+ * Backdating must be enabled for subscription reactivation operations.
1018
+ * The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
1019
+ * The date is on or after the last date/time any of the product catalog items of the subscription were changed.
1020
+ * The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April, &#x60;changes_scheduled_at&#x60; cannot be earlier than 14th February.
1021
+ .
1022
+
1023
+ */
1024
+
177
1025
  reactivate_from?:number;
1026
+
1027
+ /**
1028
+ * @description Override the [billing alignment mode](https://www.chargebee.com/docs/calendar-billing.html#alignment-of-billing-date) chosen for the site for calendar billing. Only applicable when using calendar billing. \* immediate - Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly.. \* delayed - Subscription period will be aligned with the configured billing date at the next renewal.
1029
+
1030
+ */
1031
+
178
1032
  billing_alignment_mode?:BillingAlignmentMode;
1033
+
1034
+ /**
1035
+ * @description List of coupons to be applied to this subscription. You can provide coupon ids or [coupon codes](https://apidocs.chargebee.com/docs/api/coupon_codes).
1036
+
1037
+ */
1038
+
179
1039
  coupon_ids?:string[];
1040
+
1041
+ /**
1042
+ * @description Applicable only for &#x60;cancelled&#x60; subscriptions. When passed as &#x60;true&#x60;, the canceled subscription is activated; otherwise subscription changes are made without changing its &#x60;status&#x60;. If not passed, subscription will be activated only if &#x60;subscription_items&#x60; is passed.
1043
+
1044
+ */
1045
+
180
1046
  reactivate?:boolean;
1047
+
1048
+ /**
1049
+ * @description Say the subscription has the renewal date as 28th of every month. When the plan-item price of the subscription is set to one that has the same billing period as the current plan-item price, the subscription change does not change the term. In other words, the subscription still renews on the 28th. Passing this parameter as &#x60;true&#x60; will have the subscription reset its term to the current date (provided &#x60;end_of_term&#x60; is false).
1050
+ **Note**: When the new plan-item price has a billing period different from the current plan-item price of the subscription, the term is always reset, regardless of the value passed for this parameter.
1051
+
1052
+ */
1053
+
181
1054
  force_term_reset?:boolean;
1055
+
1056
+ /**
1057
+ * @description The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
1058
+
1059
+ **Note** :
1060
+
1061
+ * Although the customer will be redirected to the &#x60;redirect_url&#x60; after successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as [&#x60;subscription_created&#x60;](https://apidocs.chargebee.com/docs/api/events#subscription_created) or [&#x60;invoice_generated&#x60;](https://apidocs.chargebee.com/docs/api/events#invoice_generated)to verify a successful checkout.
1062
+ * Redirect URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this redirect URL.
1063
+ * *Eg :* *http://yoursite.com?id&#x3D;* *\&lt;hosted_page_id\&gt;\&amp;state&#x3D;succeeded*
1064
+ * This parameter is not applicable for iframe messaging.
1065
+
1066
+ */
1067
+
182
1068
  redirect_url?:string;
1069
+
1070
+ /**
1071
+ * @description The customers will be redirected to this URL upon canceling checkout. The hosted page id and state will be passed as parameters to this URL.
1072
+
1073
+ **Note** :
1074
+
1075
+ * Cancel URL configured in Settings \&gt; Hosted Pages Settings would be overriden by this cancel URL.
1076
+ *Eg : http://yoursite.com?id&#x3D;\&lt;hosted_page_id\&gt;\&amp;state&#x3D;cancelled*
1077
+ * This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
1078
+
1079
+ */
1080
+
183
1081
  cancel_url?:string;
1082
+
1083
+ /**
1084
+ * @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
1085
+
1086
+ */
1087
+
184
1088
  pass_thru_content?:string;
1089
+
1090
+ /**
1091
+ * @description Allow the customer to select an offline payment method during checkout. The choice of payment methods can be configured via the Chargebee UI.
1092
+
1093
+ */
1094
+
185
1095
  allow_offline_payment_methods?:boolean;
1096
+
1097
+ /**
1098
+ * @description Parameters for subscription
1099
+
1100
+ */
1101
+
186
1102
  subscription?:object;
1103
+
1104
+ /**
1105
+ * @description Parameters for customer
1106
+
1107
+ */
1108
+
187
1109
  customer?:object;
1110
+
1111
+ /**
1112
+ * @description Parameters for card
1113
+
1114
+ */
1115
+
188
1116
  card?:{gateway_account_id?:string};
1117
+
1118
+ /**
1119
+ * @description Parameters for contract_term
1120
+
1121
+ */
1122
+
189
1123
  contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
1124
+
1125
+ /**
1126
+ * @description Parameters for subscription_items
1127
+
1128
+ */
1129
+
190
1130
  subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
1131
+
1132
+ /**
1133
+ * @description Parameters for discounts
1134
+
1135
+ */
1136
+
191
1137
  discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,id?:string,included_in_mrr?:boolean,item_price_id?:string,operation_type:OperationType,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
1138
+
1139
+ /**
1140
+ * @description Parameters for item_tiers
1141
+
1142
+ */
1143
+
192
1144
  item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
1145
+
1146
+ /**
1147
+ * @description Parameters for entity_identifiers
1148
+
1149
+ */
1150
+
193
1151
  entity_identifiers?:{id?:string,operation?:Operation,scheme?:string,standard?:string,value?:string}[];
194
1152
  }
195
- export interface PreCancelResponse {
196
- hosted_page:HostedPage;
1153
+ export interface PreCancelResponse {
1154
+ hosted_page:HostedPage;
197
1155
  }
198
1156
  export interface PreCancelInputParam {
1157
+
1158
+ /**
1159
+ * @description Additional data to be passed to Chargebee Retention. Only the value of &#x60;pass_thru_content.custom&#x60; is sent to Chargebee Retention. It is sent as the value of the [&#x60;custom&#x60; property](https://help.brightback.com/article/43-installing-brightback). The fields provided in &#x60;pass_thru_content.custom&#x60; must be preconfigured in Chargebee Retention.
1160
+
1161
+ Although only &#x60;pass_thru_content.custom&#x60; is sent to Chargebee Retention, all of &#x60;pass_thru_content&#x60; is stored by Chargebee billing and is retrievable as an [attribute](/docs/api/hosted_pages#hosted_page_pass_thru_content) of the &#x60;hosted_page&#x60;.
1162
+ .
1163
+
1164
+ */
1165
+
199
1166
  pass_thru_content?:string;
1167
+
1168
+ /**
1169
+ * @description The customer is sent to this URL if they finally decide to cancel the subscription, despite the attempt to retain them.
1170
+
1171
+ */
1172
+
200
1173
  cancel_url?:string;
1174
+
1175
+ /**
1176
+ * @description The customer is sent to this URL upon successful retention. In other words, this is the page to which the customer is sent when they decide **not** to cancel the subscription.
1177
+
1178
+ */
1179
+
201
1180
  redirect_url?:string;
1181
+
1182
+ /**
1183
+ * @description Parameters for subscription
1184
+
1185
+ */
1186
+
202
1187
  subscription?:{id:string};
203
1188
  }
204
- export interface AcknowledgeResponse {
205
- hosted_page:HostedPage;
1189
+ export interface AcknowledgeResponse {
1190
+ hosted_page:HostedPage;
206
1191
  }
207
1192
 
208
- export interface RetrieveAgreementPdfResponse {
209
- hosted_page:HostedPage;
1193
+ export interface RetrieveAgreementPdfResponse {
1194
+ hosted_page:HostedPage;
210
1195
  }
211
1196
  export interface RetrieveAgreementPdfInputParam {
1197
+
1198
+ /**
1199
+ * @description Payment source to be used for this payment.
1200
+
1201
+ */
1202
+
212
1203
  payment_source_id:string;
213
1204
  }
214
- export interface RetrieveResponse {
215
- hosted_page:HostedPage;
1205
+ export interface RetrieveResponse {
1206
+ hosted_page:HostedPage;
216
1207
  }
217
1208
 
218
- export interface ManagePaymentSourcesResponse {
219
- hosted_page:HostedPage;
1209
+ export interface ManagePaymentSourcesResponse {
1210
+ hosted_page:HostedPage;
220
1211
  }
221
1212
  export interface ManagePaymentSourcesInputParam {
1213
+
1214
+ /**
1215
+ * @description URL to redirect after payment method is added.
1216
+
1217
+ */
1218
+
222
1219
  redirect_url?:string;
1220
+
1221
+ /**
1222
+ * @description Parameters for customer
1223
+
1224
+ */
1225
+
223
1226
  customer?:{id:string};
1227
+
1228
+ /**
1229
+ * @description Parameters for card
1230
+
1231
+ */
1232
+
224
1233
  card?:{gateway_account_id?:string};
225
1234
  }
226
1235