chargebee 2.25.3 → 2.26.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 +35 -0
- package/README.md +55 -49
- package/lib/chargebee.js +1 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +245 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +305 -13
- package/types/resources/Card.d.ts +485 -13
- package/types/resources/Comment.d.ts +177 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +665 -20
- package/types/resources/CouponCode.d.ts +56 -5
- package/types/resources/CouponSet.d.ts +224 -17
- package/types/resources/CreditNote.d.ts +1202 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +2132 -73
- package/types/resources/DifferentialPrice.d.ts +266 -15
- package/types/resources/Discount.d.ts +107 -0
- package/types/resources/Download.d.ts +18 -0
- package/types/resources/EntitlementOverride.d.ts +101 -7
- package/types/resources/Estimate.d.ts +1181 -27
- package/types/resources/Event.d.ts +145 -8
- package/types/resources/Export.d.ts +703 -32
- package/types/resources/Feature.d.ts +356 -22
- package/types/resources/Gift.d.ts +351 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1212 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +636 -9
- package/types/resources/Invoice.d.ts +2293 -93
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +542 -16
- package/types/resources/ItemEntitlement.d.ts +172 -13
- package/types/resources/ItemFamily.d.ts +173 -15
- package/types/resources/ItemPrice.d.ts +971 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +51 -3
- package/types/resources/Order.d.ts +1224 -32
- package/types/resources/PaymentIntent.d.ts +318 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +1259 -55
- package/types/resources/PaymentVoucher.d.ts +262 -14
- package/types/resources/PortalSession.d.ts +187 -10
- package/types/resources/PromotionalCredit.d.ts +351 -16
- package/types/resources/Purchase.d.ts +274 -5
- package/types/resources/Quote.d.ts +1595 -62
- package/types/resources/QuoteLineGroup.d.ts +134 -5
- package/types/resources/QuotedCharge.d.ts +63 -5
- package/types/resources/QuotedSubscription.d.ts +192 -5
- package/types/resources/ResourceMigration.d.ts +73 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +3462 -137
- package/types/resources/SubscriptionEntitlement.d.ts +116 -8
- package/types/resources/SubscriptionEstimate.d.ts +36 -2
- package/types/resources/TaxWithheld.d.ts +32 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
- package/types/resources/TimeMachine.d.ts +99 -7
- package/types/resources/Token.d.ts +179 -7
- package/types/resources/Transaction.d.ts +597 -25
- package/types/resources/UnbilledCharge.d.ts +355 -14
- package/types/resources/Usage.d.ts +259 -13
- package/types/resources/VirtualBankAccount.d.ts +255 -17
|
@@ -1,226 +1,1401 @@
|
|
|
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 "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
|
+
|
|
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, `resource_version` 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=2#mbe) of this `hosted_page`.
|
|
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=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
|
+
|
|
19
114
|
checkout_one_time_for_items(input?:CheckoutOneTimeForItemsInputParam):ChargebeeRequest<CheckoutOneTimeForItemsResponse>;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @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.
|
|
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=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.
|
|
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=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'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.
|
|
161
|
+
|
|
162
|
+
##### Multiple business entities
|
|
163
|
+
|
|
164
|
+
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
|
|
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 `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.
|
|
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=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.
|
|
204
|
+
2. Send the customer to the Checkout `url` received in the response.
|
|
205
|
+
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.
|
|
206
|
+
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.
|
|
207
|
+
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.
|
|
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=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=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.
|
|
236
|
+
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.
|
|
237
|
+
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.
|
|
238
|
+
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.
|
|
239
|
+
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.
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
*/
|
|
245
|
+
|
|
30
246
|
checkout_existing_for_items(input?:CheckoutExistingForItemsInputParam):ChargebeeRequest<CheckoutExistingForItemsResponse>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @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.
|
|
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 [`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`.
|
|
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 "Thank You" 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 `status` is `successful`, the `content` attribute has the following objects based on the `type` of the hosted page.
|
|
278
|
+
|
|
279
|
+
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
280
|
+
| **`type` of hosted page** | **`content` attribute constituents** |
|
|
281
|
+
| `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. |
|
|
282
|
+
| `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. |
|
|
283
|
+
| `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`. |
|
|
284
|
+
| `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) |
|
|
285
|
+
| `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. |
|
|
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
|
-
|
|
299
|
+
export interface CheckoutOneTimeForItemsResponse {
|
|
300
|
+
/**
|
|
301
|
+
* @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).
|
|
302
|
+
|
|
303
|
+
The following steps describe how best to use this API:
|
|
304
|
+
|
|
305
|
+
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.
|
|
306
|
+
2. Send the customer to the Checkout `url` received in the response.
|
|
307
|
+
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.
|
|
308
|
+
4. [Retrieve the hosted page](./hosted_pages?prod_cat_ver=2#retrieve_a_hosted_page) at this stage to get the invoice details.
|
|
309
|
+
|
|
310
|
+
#### Customer resource lookup and creation {#customer_lookup1}
|
|
311
|
+
|
|
312
|
+
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.
|
|
313
|
+
|
|
314
|
+
##### Multiple business entities
|
|
315
|
+
|
|
316
|
+
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.
|
|
317
|
+
|
|
318
|
+
*/
|
|
319
|
+
|
|
320
|
+
hosted_page:HostedPage;
|
|
39
321
|
}
|
|
40
322
|
export interface CheckoutOneTimeForItemsInputParam {
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @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.
|
|
326
|
+
**Note**
|
|
327
|
+
|
|
328
|
+
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).
|
|
329
|
+
**See also**
|
|
330
|
+
|
|
331
|
+
[Customer resource lookup and creation.](/docs/api/hosted_pages#customer_lookup1)
|
|
332
|
+
|
|
333
|
+
*/
|
|
334
|
+
|
|
41
335
|
business_entity_id?:string;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* @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
|
|
339
|
+
|
|
340
|
+
*/
|
|
341
|
+
|
|
42
342
|
layout?:Layout;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* @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.
|
|
346
|
+
|
|
347
|
+
*/
|
|
348
|
+
|
|
43
349
|
invoice_note?:string;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* @description List of Coupons to be added.
|
|
353
|
+
|
|
354
|
+
*/
|
|
355
|
+
|
|
44
356
|
coupon_ids?:string[];
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* @description The currency code (ISO 4217 format) of the invoice amount.
|
|
360
|
+
|
|
361
|
+
*/
|
|
362
|
+
|
|
45
363
|
currency_code?:string;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @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.
|
|
367
|
+
|
|
368
|
+
**Note** :
|
|
369
|
+
|
|
370
|
+
* 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.
|
|
371
|
+
* Redirect URL configured in Settings \> Hosted Pages Settings would be overriden by this redirect URL.
|
|
372
|
+
* *Eg :* *http://yoursite.com?id=* *\<hosted_page_id\>\&state=succeeded*
|
|
373
|
+
* This parameter is not applicable for iframe messaging.
|
|
374
|
+
|
|
375
|
+
*/
|
|
376
|
+
|
|
46
377
|
redirect_url?:string;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @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.
|
|
381
|
+
|
|
382
|
+
**Note** :
|
|
383
|
+
|
|
384
|
+
* Cancel URL configured in Settings \> Hosted Pages Settings would be overriden by this cancel URL.
|
|
385
|
+
*Eg : http://yoursite.com?id=\<hosted_page_id\>\&state=cancelled*
|
|
386
|
+
* This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
|
|
387
|
+
|
|
388
|
+
*/
|
|
389
|
+
|
|
47
390
|
cancel_url?:string;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
|
|
394
|
+
|
|
395
|
+
*/
|
|
396
|
+
|
|
48
397
|
pass_thru_content?:string;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @description Parameters for customer
|
|
401
|
+
|
|
402
|
+
*/
|
|
403
|
+
|
|
49
404
|
customer?:object;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @description Parameters for invoice
|
|
408
|
+
|
|
409
|
+
*/
|
|
410
|
+
|
|
50
411
|
invoice?:{po_number?:string};
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* @description Parameters for card
|
|
415
|
+
|
|
416
|
+
*/
|
|
417
|
+
|
|
51
418
|
card?:{gateway_account_id?:string};
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @description Parameters for billing_address
|
|
422
|
+
|
|
423
|
+
*/
|
|
424
|
+
|
|
52
425
|
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};
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @description Parameters for shipping_address
|
|
429
|
+
|
|
430
|
+
*/
|
|
431
|
+
|
|
53
432
|
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};
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* @description Parameters for item_prices
|
|
436
|
+
|
|
437
|
+
*/
|
|
438
|
+
|
|
54
439
|
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}[];
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* @description Parameters for item_tiers
|
|
443
|
+
|
|
444
|
+
*/
|
|
445
|
+
|
|
55
446
|
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}[];
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* @description Parameters for charges
|
|
450
|
+
|
|
451
|
+
*/
|
|
452
|
+
|
|
56
453
|
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}[];
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* @description Parameters for discounts
|
|
457
|
+
|
|
458
|
+
*/
|
|
459
|
+
|
|
57
460
|
discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* @description Parameters for entity_identifiers
|
|
464
|
+
|
|
465
|
+
*/
|
|
466
|
+
|
|
58
467
|
entity_identifiers?:{id?:string,operation?:Operation,scheme?:string,standard?:string,value?:string}[];
|
|
59
468
|
}
|
|
60
|
-
export interface UpdatePaymentMethodResponse {
|
|
61
|
-
|
|
469
|
+
export interface UpdatePaymentMethodResponse {
|
|
470
|
+
/**
|
|
471
|
+
* @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.
|
|
472
|
+
|
|
473
|
+
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.
|
|
474
|
+
|
|
475
|
+
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.
|
|
476
|
+
|
|
477
|
+
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.
|
|
478
|
+
**Note:**
|
|
479
|
+
|
|
480
|
+
* 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.
|
|
481
|
+
* 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.
|
|
482
|
+
|
|
483
|
+
*/
|
|
484
|
+
|
|
485
|
+
hosted_page:HostedPage;
|
|
62
486
|
}
|
|
63
487
|
export interface UpdatePaymentMethodInputParam {
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* @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.
|
|
491
|
+
|
|
492
|
+
**Note** :
|
|
493
|
+
|
|
494
|
+
* 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.
|
|
495
|
+
* Redirect URL configured in Settings \> Hosted Pages Settings would be overriden by this redirect URL.
|
|
496
|
+
* *Eg :* *http://yoursite.com?id=* *\<hosted_page_id\>\&state=succeeded*
|
|
497
|
+
* This parameter is not applicable for iframe messaging.
|
|
498
|
+
|
|
499
|
+
*/
|
|
500
|
+
|
|
64
501
|
redirect_url?:string;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* @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.
|
|
505
|
+
|
|
506
|
+
**Note** :
|
|
507
|
+
|
|
508
|
+
* Cancel URL configured in Settings \> Hosted Pages Settings would be overriden by this cancel URL.
|
|
509
|
+
*Eg : http://yoursite.com?id=\<hosted_page_id\>\&state=cancelled*
|
|
510
|
+
* This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
|
|
511
|
+
|
|
512
|
+
*/
|
|
513
|
+
|
|
65
514
|
cancel_url?:string;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
|
|
518
|
+
|
|
519
|
+
*/
|
|
520
|
+
|
|
66
521
|
pass_thru_content?:string;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* @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.
|
|
525
|
+
|
|
526
|
+
**Note** : This parameter is not applicable for [in-app](https://www.chargebee.com/docs/checkout-v3.html) checkout.
|
|
527
|
+
|
|
528
|
+
*/
|
|
529
|
+
|
|
67
530
|
iframe_messaging?:boolean;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* @description Parameters for customer
|
|
534
|
+
|
|
535
|
+
*/
|
|
536
|
+
|
|
68
537
|
customer?:{id:string};
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* @description Parameters for card
|
|
541
|
+
|
|
542
|
+
*/
|
|
543
|
+
|
|
69
544
|
card?:{gateway_account_id?:string};
|
|
70
545
|
}
|
|
71
|
-
export interface ExtendSubscriptionResponse {
|
|
72
|
-
|
|
546
|
+
export interface ExtendSubscriptionResponse {
|
|
547
|
+
/**
|
|
548
|
+
* @description This API generates a hosted page URL to extend the billing cycle of a subscription.
|
|
549
|
+
|
|
550
|
+
*/
|
|
551
|
+
|
|
552
|
+
hosted_page:HostedPage;
|
|
73
553
|
}
|
|
74
554
|
export interface ExtendSubscriptionInputParam {
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @description Expiry (in days) for the link generated. No expiry will be set if this is not specified.
|
|
558
|
+
|
|
559
|
+
*/
|
|
560
|
+
|
|
75
561
|
expiry?:number;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* @description Number of billing cycles to extend. If not specified, plan's billing cycle will be used.
|
|
565
|
+
|
|
566
|
+
*/
|
|
567
|
+
|
|
76
568
|
billing_cycle?:number;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* @description Parameters for subscription
|
|
572
|
+
|
|
573
|
+
*/
|
|
574
|
+
|
|
77
575
|
subscription?:{id:string};
|
|
78
576
|
}
|
|
79
|
-
export interface EventsResponse {
|
|
80
|
-
|
|
577
|
+
export interface EventsResponse {
|
|
578
|
+
/**
|
|
579
|
+
* @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.
|
|
580
|
+
|
|
581
|
+
*/
|
|
582
|
+
|
|
583
|
+
success:boolean;
|
|
81
584
|
}
|
|
82
585
|
export interface EventsInputParam {
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* @description null
|
|
589
|
+
|
|
590
|
+
*/
|
|
591
|
+
|
|
83
592
|
event_name:EventName;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* @description Timestamp indicating when this event had occurred. .
|
|
596
|
+
|
|
597
|
+
*/
|
|
598
|
+
|
|
84
599
|
occurred_at?:number;
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* @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.
|
|
603
|
+
|
|
604
|
+
* `subscription_id`: A unique and immutable identifier for the subscription.
|
|
605
|
+
.
|
|
606
|
+
|
|
607
|
+
*/
|
|
608
|
+
|
|
85
609
|
event_data:object;
|
|
86
610
|
}
|
|
87
|
-
export interface CheckoutGiftForItemsResponse {
|
|
88
|
-
|
|
611
|
+
export interface CheckoutGiftForItemsResponse {
|
|
612
|
+
/**
|
|
613
|
+
* @description Creates a hosted page for a customer (called the gifter) to gift a subscription to another customer (called the receiver).
|
|
614
|
+
|
|
615
|
+
#### Gifter customer resource lookup and creation {#gifter_lookup}
|
|
616
|
+
|
|
617
|
+
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.
|
|
618
|
+
|
|
619
|
+
##### Multiple business entities
|
|
620
|
+
|
|
621
|
+
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.
|
|
622
|
+
|
|
623
|
+
#### Gift receiver customer resource lookup and creation {#receiver_lookup}
|
|
624
|
+
|
|
625
|
+
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.
|
|
626
|
+
|
|
627
|
+
##### Multiple business entities
|
|
628
|
+
|
|
629
|
+
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
|
|
630
|
+
|
|
631
|
+
*/
|
|
632
|
+
|
|
633
|
+
hosted_page:HostedPage;
|
|
89
634
|
}
|
|
90
635
|
export interface CheckoutGiftForItemsInputParam {
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* @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.
|
|
639
|
+
**Note**
|
|
640
|
+
|
|
641
|
+
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).
|
|
642
|
+
**See also**
|
|
643
|
+
|
|
644
|
+
Gifter customer resource lookup and creation.
|
|
645
|
+
|
|
646
|
+
*/
|
|
647
|
+
|
|
91
648
|
business_entity_id?:string;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* @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.
|
|
652
|
+
|
|
653
|
+
**Note** :
|
|
654
|
+
|
|
655
|
+
* 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.
|
|
656
|
+
* Redirect URL configured in Settings \> Hosted Pages Settings would be overriden by this redirect URL.
|
|
657
|
+
* *Eg :* *http://yoursite.com?id=* *\<hosted_page_id\>\&state=succeeded*
|
|
658
|
+
* This parameter is not applicable for iframe messaging.
|
|
659
|
+
|
|
660
|
+
*/
|
|
661
|
+
|
|
92
662
|
redirect_url?:string;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* @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).
|
|
666
|
+
|
|
667
|
+
*/
|
|
668
|
+
|
|
93
669
|
coupon_ids?:string[];
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* @description Parameters for gifter
|
|
673
|
+
|
|
674
|
+
*/
|
|
675
|
+
|
|
94
676
|
gifter?:{customer_id?:string,locale?:string};
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* @description Parameters for subscription_items
|
|
680
|
+
|
|
681
|
+
*/
|
|
682
|
+
|
|
95
683
|
subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string}[];
|
|
96
684
|
}
|
|
97
|
-
export interface ListResponse {
|
|
98
|
-
|
|
99
|
-
|
|
685
|
+
export interface ListResponse {
|
|
686
|
+
/**
|
|
687
|
+
* @description This API retrieves the list of hosted page resources.
|
|
688
|
+
|
|
689
|
+
*/
|
|
690
|
+
|
|
691
|
+
list:{hosted_page:HostedPage}[];
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* @description This API retrieves the list of hosted page resources.
|
|
695
|
+
|
|
696
|
+
*/
|
|
697
|
+
|
|
698
|
+
next_offset?:string;
|
|
100
699
|
}
|
|
101
700
|
export interface ListInputParam {
|
|
102
|
-
[key : string]: any;
|
|
701
|
+
[key : string]: any;
|
|
702
|
+
/**
|
|
703
|
+
* @description The number of resources to be returned.
|
|
704
|
+
|
|
705
|
+
*/
|
|
706
|
+
|
|
103
707
|
limit?:number;
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* @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.
|
|
711
|
+
|
|
712
|
+
*/
|
|
713
|
+
|
|
104
714
|
offset?:string;
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* @description Unique identifier generated for each hosted page requested.
|
|
718
|
+
|
|
719
|
+
*/
|
|
720
|
+
|
|
105
721
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* @description Type of the requested hosted page.
|
|
725
|
+
|
|
726
|
+
*/
|
|
727
|
+
|
|
106
728
|
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};
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* @description Indicating the current state of the hosted page resource.
|
|
732
|
+
|
|
733
|
+
*/
|
|
734
|
+
|
|
107
735
|
state?:{in?:string,is?:'requested' | 'acknowledged' | 'created' | 'cancelled' | 'succeeded',is_not?:'requested' | 'acknowledged' | 'created' | 'cancelled' | 'succeeded',not_in?:string};
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* @description Timestamp indicating when this hosted page was last updated.
|
|
739
|
+
|
|
740
|
+
*/
|
|
741
|
+
|
|
108
742
|
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
109
743
|
}
|
|
110
|
-
export interface ViewVoucherResponse {
|
|
111
|
-
|
|
744
|
+
export interface ViewVoucherResponse {
|
|
745
|
+
/**
|
|
746
|
+
* @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.
|
|
747
|
+
|
|
748
|
+
*/
|
|
749
|
+
|
|
750
|
+
hosted_page:HostedPage;
|
|
112
751
|
}
|
|
113
752
|
export interface ViewVoucherInputParam {
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* @description Parameters for payment_voucher
|
|
756
|
+
|
|
757
|
+
*/
|
|
758
|
+
|
|
114
759
|
payment_voucher?:{id:string};
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* @description Parameters for customer
|
|
763
|
+
|
|
764
|
+
*/
|
|
765
|
+
|
|
115
766
|
customer?:{locale?:string};
|
|
116
767
|
}
|
|
117
|
-
export interface CollectNowResponse {
|
|
118
|
-
|
|
768
|
+
export interface CollectNowResponse {
|
|
769
|
+
/**
|
|
770
|
+
* @description This API generates a hosted page URL to collect due payments for the customer.
|
|
771
|
+
|
|
772
|
+
*/
|
|
773
|
+
|
|
774
|
+
hosted_page:HostedPage;
|
|
119
775
|
}
|
|
120
776
|
export interface CollectNowInputParam {
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* @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.
|
|
780
|
+
|
|
781
|
+
*/
|
|
782
|
+
|
|
121
783
|
redirect_url?:string;
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* @description The currency code (ISO 4217 format) of the specified *credit amount*.
|
|
787
|
+
|
|
788
|
+
*/
|
|
789
|
+
|
|
122
790
|
currency_code?:string;
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* @description Parameters for customer
|
|
794
|
+
|
|
795
|
+
*/
|
|
796
|
+
|
|
123
797
|
customer?:{id:string};
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* @description Parameters for card
|
|
801
|
+
|
|
802
|
+
*/
|
|
803
|
+
|
|
124
804
|
card?:{gateway_account_id?:string};
|
|
125
805
|
}
|
|
126
|
-
export interface AcceptQuoteResponse {
|
|
127
|
-
|
|
806
|
+
export interface AcceptQuoteResponse {
|
|
807
|
+
/**
|
|
808
|
+
* @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.
|
|
809
|
+
|
|
810
|
+
*/
|
|
811
|
+
|
|
812
|
+
hosted_page:HostedPage;
|
|
128
813
|
}
|
|
129
814
|
export interface AcceptQuoteInputParam {
|
|
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 `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.
|
|
822
|
+
* Redirect URL configured in Settings \> Hosted Pages Settings would be overriden by this redirect URL.
|
|
823
|
+
* *Eg :* *http://yoursite.com?id=* *\<hosted_page_id\>\&state=succeeded*
|
|
824
|
+
* This parameter is not applicable for iframe messaging.
|
|
825
|
+
|
|
826
|
+
*/
|
|
827
|
+
|
|
130
828
|
redirect_url?:string;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* @description Parameters for quote
|
|
832
|
+
|
|
833
|
+
*/
|
|
834
|
+
|
|
131
835
|
quote?:{id:string};
|
|
132
836
|
}
|
|
133
|
-
export interface CheckoutNewForItemsResponse {
|
|
134
|
-
|
|
837
|
+
export interface CheckoutNewForItemsResponse {
|
|
838
|
+
/**
|
|
839
|
+
* @description Create a Chargebee hosted page to accept payment details from a customer and checkout a new subscription.
|
|
840
|
+
|
|
841
|
+
The following steps describe how best to use this API:
|
|
842
|
+
|
|
843
|
+
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.
|
|
844
|
+
2. Send the customer to the Checkout `url` received in the response.
|
|
845
|
+
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.
|
|
846
|
+
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.
|
|
847
|
+
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.
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
#### Customer resource lookup and creation {#customer_lookup2}
|
|
852
|
+
|
|
853
|
+
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.
|
|
854
|
+
|
|
855
|
+
##### Multiple business entities
|
|
856
|
+
|
|
857
|
+
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.
|
|
858
|
+
|
|
859
|
+
*/
|
|
860
|
+
|
|
861
|
+
hosted_page:HostedPage;
|
|
135
862
|
}
|
|
136
863
|
export interface CheckoutNewForItemsInputParam {
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* @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
|
|
867
|
+
|
|
868
|
+
*/
|
|
869
|
+
|
|
137
870
|
layout?:Layout;
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* @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.
|
|
874
|
+
**Note**
|
|
875
|
+
|
|
876
|
+
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).
|
|
877
|
+
**See also**
|
|
878
|
+
|
|
879
|
+
[Customer resource lookup and creation.](/docs/api/hosted_pages#customer_lookup2)
|
|
880
|
+
|
|
881
|
+
*/
|
|
882
|
+
|
|
138
883
|
business_entity_id?:string;
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* @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.
|
|
887
|
+
|
|
888
|
+
*/
|
|
889
|
+
|
|
139
890
|
billing_cycles?:number;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
894
|
+
|
|
895
|
+
*/
|
|
896
|
+
|
|
140
897
|
mandatory_items_to_remove?:string[];
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* @description The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html).
|
|
901
|
+
|
|
902
|
+
*/
|
|
903
|
+
|
|
141
904
|
terms_to_charge?:number;
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* @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.
|
|
908
|
+
|
|
909
|
+
*/
|
|
910
|
+
|
|
142
911
|
billing_alignment_mode?:BillingAlignmentMode;
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* @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).
|
|
915
|
+
|
|
916
|
+
*/
|
|
917
|
+
|
|
143
918
|
coupon_ids?:string[];
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* @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.
|
|
922
|
+
|
|
923
|
+
**Note** :
|
|
924
|
+
|
|
925
|
+
* 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.
|
|
926
|
+
* Redirect URL configured in Settings \> Hosted Pages Settings would be overriden by this redirect URL.
|
|
927
|
+
* *Eg :* *http://yoursite.com?id=* *\<hosted_page_id\>\&state=succeeded*
|
|
928
|
+
* This parameter is not applicable for iframe messaging.
|
|
929
|
+
|
|
930
|
+
*/
|
|
931
|
+
|
|
144
932
|
redirect_url?:string;
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* @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.
|
|
936
|
+
|
|
937
|
+
**Note** :
|
|
938
|
+
|
|
939
|
+
* Cancel URL configured in Settings \> Hosted Pages Settings would be overriden by this cancel URL.
|
|
940
|
+
*Eg : http://yoursite.com?id=\<hosted_page_id\>\&state=cancelled*
|
|
941
|
+
* This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
|
|
942
|
+
|
|
943
|
+
*/
|
|
944
|
+
|
|
145
945
|
cancel_url?:string;
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
|
|
949
|
+
|
|
950
|
+
*/
|
|
951
|
+
|
|
146
952
|
pass_thru_content?:string;
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* @description Allow the customer to select an offline payment method during checkout. The choice of payment methods can be configured via the Chargebee UI.
|
|
956
|
+
|
|
957
|
+
*/
|
|
958
|
+
|
|
147
959
|
allow_offline_payment_methods?:boolean;
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* @description Parameters for subscription
|
|
963
|
+
|
|
964
|
+
*/
|
|
965
|
+
|
|
148
966
|
subscription?:object;
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* @description Parameters for customer
|
|
970
|
+
|
|
971
|
+
*/
|
|
972
|
+
|
|
149
973
|
customer?:object;
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* @description Parameters for card
|
|
977
|
+
|
|
978
|
+
*/
|
|
979
|
+
|
|
150
980
|
card?:{gateway_account_id?:string};
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* @description Parameters for billing_address
|
|
984
|
+
|
|
985
|
+
*/
|
|
986
|
+
|
|
151
987
|
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};
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* @description Parameters for shipping_address
|
|
991
|
+
|
|
992
|
+
*/
|
|
993
|
+
|
|
152
994
|
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};
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* @description Parameters for contract_term
|
|
998
|
+
|
|
999
|
+
*/
|
|
1000
|
+
|
|
153
1001
|
contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* @description Parameters for subscription_items
|
|
1005
|
+
|
|
1006
|
+
*/
|
|
1007
|
+
|
|
154
1008
|
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}[];
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* @description Parameters for discounts
|
|
1012
|
+
|
|
1013
|
+
*/
|
|
1014
|
+
|
|
155
1015
|
discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* @description Parameters for item_tiers
|
|
1019
|
+
|
|
1020
|
+
*/
|
|
1021
|
+
|
|
156
1022
|
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}[];
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* @description Parameters for entity_identifiers
|
|
1026
|
+
|
|
1027
|
+
*/
|
|
1028
|
+
|
|
157
1029
|
entity_identifiers?:{id?:string,operation?:Operation,scheme?:string,standard?:string,value?:string}[];
|
|
158
1030
|
}
|
|
159
|
-
export interface ClaimGiftResponse {
|
|
160
|
-
|
|
1031
|
+
export interface ClaimGiftResponse {
|
|
1032
|
+
/**
|
|
1033
|
+
* @description This API generates a hosted page URL to claim a gifted subscription.
|
|
1034
|
+
|
|
1035
|
+
*/
|
|
1036
|
+
|
|
1037
|
+
hosted_page:HostedPage;
|
|
161
1038
|
}
|
|
162
1039
|
export interface ClaimGiftInputParam {
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* @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.
|
|
1043
|
+
|
|
1044
|
+
**Note** :
|
|
1045
|
+
|
|
1046
|
+
* 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.
|
|
1047
|
+
* Redirect URL configured in Settings \> Hosted Pages Settings would be overriden by this redirect URL.
|
|
1048
|
+
* *Eg :* *http://yoursite.com?id=* *\<hosted_page_id\>\&state=succeeded*
|
|
1049
|
+
* This parameter is not applicable for iframe messaging.
|
|
1050
|
+
|
|
1051
|
+
*/
|
|
1052
|
+
|
|
163
1053
|
redirect_url?:string;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* @description Parameters for gift
|
|
1057
|
+
|
|
1058
|
+
*/
|
|
1059
|
+
|
|
164
1060
|
gift?:{id:string};
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* @description Parameters for customer
|
|
1064
|
+
|
|
1065
|
+
*/
|
|
1066
|
+
|
|
165
1067
|
customer?:{locale?:string};
|
|
166
1068
|
}
|
|
167
|
-
export interface CheckoutExistingForItemsResponse {
|
|
168
|
-
|
|
1069
|
+
export interface CheckoutExistingForItemsResponse {
|
|
1070
|
+
/**
|
|
1071
|
+
* @description Create a Chargebee hosted page to accept payment details from a customer and checkout to update the subscription.
|
|
1072
|
+
|
|
1073
|
+
The following steps describe how best to use this API:
|
|
1074
|
+
|
|
1075
|
+
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.
|
|
1076
|
+
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.
|
|
1077
|
+
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.
|
|
1078
|
+
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.
|
|
1079
|
+
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.
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
*/
|
|
1085
|
+
|
|
1086
|
+
hosted_page:HostedPage;
|
|
169
1087
|
}
|
|
170
1088
|
export interface CheckoutExistingForItemsInputParam {
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* @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
|
|
1092
|
+
|
|
1093
|
+
*/
|
|
1094
|
+
|
|
171
1095
|
layout?:Layout;
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* @description Item ids of [mandatorily attached addons](./attached_items?prod_cat_ver=2) that are to be removed from the subscription.
|
|
1099
|
+
|
|
1100
|
+
*/
|
|
1101
|
+
|
|
172
1102
|
mandatory_items_to_remove?:string[];
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* @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.
|
|
1106
|
+
|
|
1107
|
+
*/
|
|
1108
|
+
|
|
173
1109
|
replace_items_list?:boolean;
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* @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:
|
|
1113
|
+
|
|
1114
|
+
* `invoice_date` must be in the past.
|
|
1115
|
+
* `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.
|
|
1116
|
+
* It is not earlier than `changes_scheduled_at`, `reactivate_from`, or `trial_end`.
|
|
1117
|
+
* `invoice_immediately` is `true`.
|
|
1118
|
+
.
|
|
1119
|
+
|
|
1120
|
+
*/
|
|
1121
|
+
|
|
174
1122
|
invoice_date?:number;
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* @description Billing cycles set for plan-item price is used by default.
|
|
1126
|
+
|
|
1127
|
+
*/
|
|
1128
|
+
|
|
175
1129
|
billing_cycles?:number;
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* @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.
|
|
1133
|
+
|
|
1134
|
+
*/
|
|
1135
|
+
|
|
176
1136
|
terms_to_charge?:number;
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* @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.
|
|
1140
|
+
**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:
|
|
1141
|
+
|
|
1142
|
+
* Backdating must be enabled for subscription reactivation operations.
|
|
1143
|
+
* 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.
|
|
1144
|
+
* The date is on or after the last date/time any of the product catalog items of the subscription were changed.
|
|
1145
|
+
* 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.
|
|
1146
|
+
.
|
|
1147
|
+
|
|
1148
|
+
*/
|
|
1149
|
+
|
|
177
1150
|
reactivate_from?:number;
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* @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.
|
|
1154
|
+
|
|
1155
|
+
*/
|
|
1156
|
+
|
|
178
1157
|
billing_alignment_mode?:BillingAlignmentMode;
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* @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).
|
|
1161
|
+
|
|
1162
|
+
*/
|
|
1163
|
+
|
|
179
1164
|
coupon_ids?:string[];
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* @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.
|
|
1168
|
+
|
|
1169
|
+
*/
|
|
1170
|
+
|
|
180
1171
|
reactivate?:boolean;
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* @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).
|
|
1175
|
+
**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.
|
|
1176
|
+
|
|
1177
|
+
*/
|
|
1178
|
+
|
|
181
1179
|
force_term_reset?:boolean;
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* @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.
|
|
1183
|
+
|
|
1184
|
+
**Note** :
|
|
1185
|
+
|
|
1186
|
+
* 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.
|
|
1187
|
+
* Redirect URL configured in Settings \> Hosted Pages Settings would be overriden by this redirect URL.
|
|
1188
|
+
* *Eg :* *http://yoursite.com?id=* *\<hosted_page_id\>\&state=succeeded*
|
|
1189
|
+
* This parameter is not applicable for iframe messaging.
|
|
1190
|
+
|
|
1191
|
+
*/
|
|
1192
|
+
|
|
182
1193
|
redirect_url?:string;
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* @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.
|
|
1197
|
+
|
|
1198
|
+
**Note** :
|
|
1199
|
+
|
|
1200
|
+
* Cancel URL configured in Settings \> Hosted Pages Settings would be overriden by this cancel URL.
|
|
1201
|
+
*Eg : http://yoursite.com?id=\<hosted_page_id\>\&state=cancelled*
|
|
1202
|
+
* This parameter is not applicable for iframe messaging and [in-app](https://www.chargebee.com/docs/2.0/checkout.html) checkout.
|
|
1203
|
+
|
|
1204
|
+
*/
|
|
1205
|
+
|
|
183
1206
|
cancel_url?:string;
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* @description You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
|
|
1210
|
+
|
|
1211
|
+
*/
|
|
1212
|
+
|
|
184
1213
|
pass_thru_content?:string;
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* @description Allow the customer to select an offline payment method during checkout. The choice of payment methods can be configured via the Chargebee UI.
|
|
1217
|
+
|
|
1218
|
+
*/
|
|
1219
|
+
|
|
185
1220
|
allow_offline_payment_methods?:boolean;
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* @description Parameters for subscription
|
|
1224
|
+
|
|
1225
|
+
*/
|
|
1226
|
+
|
|
186
1227
|
subscription?:object;
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* @description Parameters for customer
|
|
1231
|
+
|
|
1232
|
+
*/
|
|
1233
|
+
|
|
187
1234
|
customer?:object;
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* @description Parameters for card
|
|
1238
|
+
|
|
1239
|
+
*/
|
|
1240
|
+
|
|
188
1241
|
card?:{gateway_account_id?:string};
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* @description Parameters for contract_term
|
|
1245
|
+
|
|
1246
|
+
*/
|
|
1247
|
+
|
|
189
1248
|
contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* @description Parameters for subscription_items
|
|
1252
|
+
|
|
1253
|
+
*/
|
|
1254
|
+
|
|
190
1255
|
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}[];
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* @description Parameters for discounts
|
|
1259
|
+
|
|
1260
|
+
*/
|
|
1261
|
+
|
|
191
1262
|
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}[];
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* @description Parameters for item_tiers
|
|
1266
|
+
|
|
1267
|
+
*/
|
|
1268
|
+
|
|
192
1269
|
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}[];
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* @description Parameters for entity_identifiers
|
|
1273
|
+
|
|
1274
|
+
*/
|
|
1275
|
+
|
|
193
1276
|
entity_identifiers?:{id?:string,operation?:Operation,scheme?:string,standard?:string,value?:string}[];
|
|
194
1277
|
}
|
|
195
|
-
export interface PreCancelResponse {
|
|
196
|
-
|
|
1278
|
+
export interface PreCancelResponse {
|
|
1279
|
+
/**
|
|
1280
|
+
* @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.
|
|
1281
|
+
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.
|
|
1282
|
+
|
|
1283
|
+
*/
|
|
1284
|
+
|
|
1285
|
+
hosted_page:HostedPage;
|
|
197
1286
|
}
|
|
198
1287
|
export interface PreCancelInputParam {
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* @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.
|
|
1291
|
+
|
|
1292
|
+
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`.
|
|
1293
|
+
.
|
|
1294
|
+
|
|
1295
|
+
*/
|
|
1296
|
+
|
|
199
1297
|
pass_thru_content?:string;
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* @description The customer is sent to this URL if they finally decide to cancel the subscription, despite the attempt to retain them.
|
|
1301
|
+
|
|
1302
|
+
*/
|
|
1303
|
+
|
|
200
1304
|
cancel_url?:string;
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* @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.
|
|
1308
|
+
|
|
1309
|
+
*/
|
|
1310
|
+
|
|
201
1311
|
redirect_url?:string;
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* @description Parameters for subscription
|
|
1315
|
+
|
|
1316
|
+
*/
|
|
1317
|
+
|
|
202
1318
|
subscription?:{id:string};
|
|
203
1319
|
}
|
|
204
|
-
export interface AcknowledgeResponse {
|
|
205
|
-
|
|
1320
|
+
export interface AcknowledgeResponse {
|
|
1321
|
+
/**
|
|
1322
|
+
* @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`.
|
|
1323
|
+
|
|
1324
|
+
**Note:** The hosted page status must be succeeded for this API call to be allowed.
|
|
1325
|
+
|
|
1326
|
+
*/
|
|
1327
|
+
|
|
1328
|
+
hosted_page:HostedPage;
|
|
206
1329
|
}
|
|
207
1330
|
|
|
208
|
-
export interface RetrieveAgreementPdfResponse {
|
|
209
|
-
|
|
1331
|
+
export interface RetrieveAgreementPdfResponse {
|
|
1332
|
+
/**
|
|
1333
|
+
* @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.
|
|
1334
|
+
|
|
1335
|
+
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.
|
|
1336
|
+
|
|
1337
|
+
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.
|
|
1338
|
+
|
|
1339
|
+
*/
|
|
1340
|
+
|
|
1341
|
+
hosted_page:HostedPage;
|
|
210
1342
|
}
|
|
211
1343
|
export interface RetrieveAgreementPdfInputParam {
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* @description Payment source to be used for this payment.
|
|
1347
|
+
|
|
1348
|
+
*/
|
|
1349
|
+
|
|
212
1350
|
payment_source_id:string;
|
|
213
1351
|
}
|
|
214
|
-
export interface RetrieveResponse {
|
|
215
|
-
|
|
1352
|
+
export interface RetrieveResponse {
|
|
1353
|
+
/**
|
|
1354
|
+
* @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.
|
|
1355
|
+
|
|
1356
|
+
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
1357
|
+
| **`type` of hosted page** | **`content` attribute constituents** |
|
|
1358
|
+
| `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. |
|
|
1359
|
+
| `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. |
|
|
1360
|
+
| `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`. |
|
|
1361
|
+
| `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) |
|
|
1362
|
+
| `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. |
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
*/
|
|
1366
|
+
|
|
1367
|
+
hosted_page:HostedPage;
|
|
216
1368
|
}
|
|
217
1369
|
|
|
218
|
-
export interface ManagePaymentSourcesResponse {
|
|
219
|
-
|
|
1370
|
+
export interface ManagePaymentSourcesResponse {
|
|
1371
|
+
/**
|
|
1372
|
+
* @description This API generates a hosted page URL to add new or update existing payment sources for the customer.
|
|
1373
|
+
|
|
1374
|
+
*/
|
|
1375
|
+
|
|
1376
|
+
hosted_page:HostedPage;
|
|
220
1377
|
}
|
|
221
1378
|
export interface ManagePaymentSourcesInputParam {
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* @description URL to redirect after payment method is added.
|
|
1382
|
+
|
|
1383
|
+
*/
|
|
1384
|
+
|
|
222
1385
|
redirect_url?:string;
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* @description Parameters for customer
|
|
1389
|
+
|
|
1390
|
+
*/
|
|
1391
|
+
|
|
223
1392
|
customer?:{id:string};
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* @description Parameters for card
|
|
1396
|
+
|
|
1397
|
+
*/
|
|
1398
|
+
|
|
224
1399
|
card?:{gateway_account_id?:string};
|
|
225
1400
|
}
|
|
226
1401
|
|