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