chargebee 2.50.0 → 2.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/lib/chargebee.js +1 -1
  3. package/lib/resources/api_endpoints.js +37 -1
  4. package/package.json +1 -1
  5. package/types/core.d.ts +8 -5
  6. package/types/index.d.ts +3 -0
  7. package/types/resources/Address.d.ts +2 -194
  8. package/types/resources/AdvanceInvoiceSchedule.d.ts +5 -67
  9. package/types/resources/Attribute.d.ts +4 -1
  10. package/types/resources/BillingConfiguration.d.ts +21 -0
  11. package/types/resources/Brand.d.ts +12 -0
  12. package/types/resources/BusinessEntity.d.ts +8 -6
  13. package/types/resources/BusinessEntityTransfer.d.ts +10 -7
  14. package/types/resources/Card.d.ts +11 -311
  15. package/types/resources/Comment.d.ts +7 -124
  16. package/types/resources/Configuration.d.ts +2 -0
  17. package/types/resources/Contact.d.ts +2 -44
  18. package/types/resources/ContractTerm.d.ts +4 -72
  19. package/types/resources/Coupon.d.ts +0 -37
  20. package/types/resources/CouponCode.d.ts +67 -35
  21. package/types/resources/CouponSet.d.ts +12 -121
  22. package/types/resources/CreditNote.d.ts +2 -6
  23. package/types/resources/CreditNoteEstimate.d.ts +1 -1
  24. package/types/resources/Currency.d.ts +8 -5
  25. package/types/resources/Customer.d.ts +90 -89
  26. package/types/resources/Discount.d.ts +2 -89
  27. package/types/resources/Download.d.ts +2 -14
  28. package/types/resources/Entitlement.d.ts +15 -103
  29. package/types/resources/EntitlementOverride.d.ts +4 -89
  30. package/types/resources/Estimate.d.ts +6 -10
  31. package/types/resources/Event.d.ts +23 -108
  32. package/types/resources/Export.d.ts +116 -432
  33. package/types/resources/Feature.d.ts +17 -319
  34. package/types/resources/GatewayErrorDetail.d.ts +6 -48
  35. package/types/resources/Gift.d.ts +34 -294
  36. package/types/resources/Hierarchy.d.ts +4 -24
  37. package/types/resources/ImpactedItem.d.ts +4 -36
  38. package/types/resources/ImpactedItemPrice.d.ts +5 -2
  39. package/types/resources/ImpactedSubscription.d.ts +3 -30
  40. package/types/resources/InAppSubscription.d.ts +13 -355
  41. package/types/resources/Invoice.d.ts +26 -18
  42. package/types/resources/InvoiceEstimate.d.ts +1 -1
  43. package/types/resources/Item.d.ts +4 -9
  44. package/types/resources/ItemEntitlement.d.ts +15 -155
  45. package/types/resources/NonSubscription.d.ts +9 -6
  46. package/types/resources/OmnichannelSubscriptionItem.d.ts +9 -0
  47. package/types/resources/PaymentIntent.d.ts +9 -255
  48. package/types/resources/PaymentReferenceNumber.d.ts +3 -20
  49. package/types/resources/PaymentSource.d.ts +2 -2
  50. package/types/resources/PaymentVoucher.d.ts +20 -203
  51. package/types/resources/PortalSession.d.ts +4 -146
  52. package/types/resources/PromotionalCredit.d.ts +10 -215
  53. package/types/resources/Purchase.d.ts +3 -1
  54. package/types/resources/Quote.d.ts +68 -18
  55. package/types/resources/QuoteLineGroup.d.ts +1 -1
  56. package/types/resources/QuotedRamp.d.ts +142 -0
  57. package/types/resources/RecordedPurchase.d.ts +2 -0
  58. package/types/resources/ResourceMigration.d.ts +2 -54
  59. package/types/resources/SiteMigrationDetail.d.ts +13 -55
  60. package/types/resources/Subscription.d.ts +13 -9
  61. package/types/resources/SubscriptionEntitlement.d.ts +6 -106
  62. package/types/resources/SubscriptionEstimate.d.ts +14 -11
  63. package/types/resources/TaxWithheld.d.ts +14 -26
  64. package/types/resources/ThirdPartyPaymentMethod.d.ts +2 -19
  65. package/types/resources/TimeMachine.d.ts +3 -64
  66. package/types/resources/Token.d.ts +3 -60
  67. package/types/resources/Transaction.d.ts +2 -2
  68. package/types/resources/Usage.d.ts +21 -165
@@ -1,321 +1,30 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
2
3
  declare module 'chargebee' {
3
4
  export interface InAppSubscription {
4
5
 
5
- /**
6
- * @description The &#x60;id&#x60; of the [subscription](subscriptions#subscription_id) for which the receipt was sent.
7
6
 
8
- */
9
-
7
+ app_id:string;
8
+
10
9
  subscription_id:string;
11
-
12
- /**
13
- * @description The &#x60;id&#x60; of the [customer](customers#customer_id) object to which the subscription belongs.
14
10
 
15
- */
16
-
17
11
  customer_id?:string;
18
-
19
- /**
20
- * @description The &#x60;id&#x60; of the plan-item price of the subscription.
21
12
 
22
- */
23
-
24
13
  plan_id?:string;
25
-
26
- /**
27
- * @description The status of the subscription for the store \* paused - When the subscription is paused. \* in_trial - When the subscription is in trial. \* active - When the subscription is active. \* cancelled - When the subscription is cancelled.
28
14
 
29
- */
30
-
31
- store_status?:'in_trial' | 'paused' | 'active' | 'cancelled';
32
-
33
- /**
34
- * @description The &#x60;id&#x60; of the invoice generated in Chargebee
15
+ store_status?:'in_trial' | 'active' | 'cancelled' | 'paused';
35
16
 
36
- */
37
-
38
17
  invoice_id?:string;
18
+
39
19
  }
40
20
  export namespace InAppSubscription {
41
21
  export class InAppSubscriptionResource {
42
- /**
43
- * @description Verifies an in-app purchase made by your customer and creates a subscription in Chargebee.
44
- **Tip**
45
-
46
- The recommended approach is to call this endpoint from the client-side app directly. However, if you are using this API to replace an existing direct integration with Apple or Google, then you may choose to call this API from the server-side.
47
- **Note:**
48
-
49
- if App Store or Play Store products have not been imported to Chargebee and this API is invoked, Chargebee will automatically create plans that correspond to the store product IDs. However, if historical subscriptions are to be imported using the [import receipt](https://apidocs.chargebee.com/docs/api/in_app_subscriptions#import_receipt) API, importing products is mandatory. [Learn more](https://www.chargebee.com/docs/mobile_subscriptions.html).
50
-
51
- Apple App Store {#app_store}
52
- ----------------------------
53
-
54
- This section provides details of the Process Purchase Command operation when performed for the Apple App Store. This API processes only the latest in-app transaction on the receipt. Sync historical subscriptions into Chargebee using [bulk import](https://www.chargebee.com/docs/2.0/mobile-app-store-product-iap.html#import-in-app-purchase-receipts) of In-App Purchase receipts.
55
- **Important**
56
-
57
- * [Integrate Chargebee](https://www.chargebee.com/docs/mobile-app-store-connect.html#connnect-with-your-chargebee-site) with your Apple App Store account using your shared secret from Apple.
58
- * It is strongly recommended to use this endpoint to notify Chargebee of **new** purchases only.
59
- * For updates to existing subscriptions, we recommend that you configure Apple App Store to send server notifications to Chargebee.
60
-
61
- Chargebee validates the &#x60;receipt&#x60; with Apple App Store and does the following once validation succeeds:
62
-
63
- 1. Look for [item_family.id](/docs/api/item_families?prod_cat_ver&#x3D;2#item_family_id) that matches the value Apple-App-Store, and create such a product family if not found.
64
- 2. Look for [item.id](/docs/api/items?prod_cat_ver&#x3D;2#item_id) that matches &#x60;product[id]&#x60; and if not found, create such a plan-item under the item family described in the previous step.
65
- 3. Look for [item_price.id](/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_id) that matches the concatenation of &#x60;product[id]&#x60; and &#x60;product[currency_code]&#x60;, and if not found, create such an item price under the item described in the previous step.
66
- 4. Create/update a subscription:
67
- * If the receipt is for a new purchase, a new subscription is created for the plan-item price described in the previous step. The subscription has the following details:
68
- * &#x60;id&#x60; set to [original_transaction_id](https://developer.apple.com/documentation/appstorereceipts/original_transaction_id?language&#x3D;objc)
69
- * &#x60;start_date&#x60; set to [responseBody.Latest_receipt_info.purchase_date_ms](https://developer.apple.com/documentation/appstorereceipts/responsebody/latest_receipt_info?language&#x3D;objc)
70
- * &#x60;current_term_end&#x60; set to &#x60;responseBody.Latest_receipt_info.expires_date_ms&#x60;
71
- * Instead, if the receipt belongs to an existing subscription in Chargebee, it is updated to reflect the current state of the subscription at Apple.
72
- 5. The payment is recorded against the subscription invoice. The associated transaction is updated with the following details:
73
- * The [transaction.reference_number](/docs/api/transactions?prod_cat_ver&#x3D;2#transaction_reference_number) is set to the [transaction_id](https://developer.apple.com/documentation/appstorereceipts/transaction_id?language&#x3D;objc) of the payment.
74
- * The [transaction.payment_method](/docs/api/transactions#transaction_payment_method) is set to &#x60;apple_pay&#x60;.
75
-
76
- Google Play Store {#app_store}
77
- ------------------------------
78
-
79
- This section provides details of the Process Purchase Command operation when performed for the Google Play Store. This API processes only the latest in-app transaction using the purchase token.
80
- **Important**
81
-
82
- * [Integrate Chargebee](https://www.chargebee.com/docs/2.0/mobile-playstore-connect.html#chargebee-configuration) with your Google Play Store account using the service account credentials JSON.
83
- * It is strongly recommended to use this endpoint to notify Chargebee of **new** purchases only.
84
- * For updates to existing subscriptions, we recommend that you configure Chargebee to receive Google&#x27;s server notifications through pub/sub topic. [Learn more](https://developer.android.com/google/play/billing/getting-ready#setup-pubsub).
85
-
86
- Chargebee validates the purchase **token** with Google Play Store and does the following once validation succeeds:
87
-
88
- 1. Look for [item_family.id](/docs/api/item_families?prod_cat_ver&#x3D;2#item_family_id) that matches the value &#x60;Google-Play-Store&#x60;, and create such a product family if not found.
89
- 2. Look for [item.id](/docs/api/items?prod_cat_ver&#x3D;2#item_id) that matches &#x60;product[id]&#x60; and if not found, create such a [plan-item](/docs/api/items?prod_cat_ver&#x3D;2#item_type) under the item family described in the previous step.
90
- 3. Look for [item_price.id](/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_id) that matches the concatenation of &#x60;product[id]&#x60; and [priceCurrencyCode](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions?hl&#x3D;en#SubscriptionPurchase.FIELDS.price_currency_code), and if not found, create such an item price under the item described in the previous step.
91
- 4. Create/update a subscription:
92
- * If this token is for a new purchase, a new subscription is created for the plan-item price described in the previous step. The subscription has the following details:
93
- * &#x60;id&#x60; set to unique identifier generated by Chargebee and mapped to **token** of the [SubscriptionPurchase](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions?hl&#x3D;en) object from Google response.
94
- * &#x60;start_date&#x60; set to &#x60;SubscriptionPurchase.startTimeMillis&#x60;.
95
- * &#x60;current_term_end&#x60; set to &#x60;SubscriptionPurchase.expiryTimeMillis&#x60;.
96
- * Instead, if the token belongs to an existing subscription in Chargebee, it is updated to reflect the current state of the subscription at Google.
97
- 5. The payment is recorded against the subscription invoice. The associated transaction is updated with the following details:
98
- * The [transaction.reference_number](/docs/api/transactions?prod_cat_ver&#x3D;2#transaction_reference_number) is set to the [orderId](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions?hl&#x3D;en#SubscriptionPurchase.FIELDS.order_id) of the payment.
99
- * The [transaction.payment_method](/docs/api/transactions#transaction_payment_method) is set to &#x60;play_store&#x60;.
100
-
101
- Path Parameter {#path_param_pcv2}
102
- ---------------------------------
103
-
104
- &#x60;{in_app_subscription_app_id}&#x60;: The handle created by Chargebee for your Apple App Store or Google Play Store app. It can be obtained from the Chargebee web app.
105
-
106
- The following are instructions to obtain the value of the path parameter for the Apple App Store and Google Play Store.
107
-
108
- * **Apple App Store** : To obtain the value for &#x60;{in_app_subscription_app_id}&#x60;, click **View Keys** within the **Sync Overview** page of the web app and use the value of generated **App ID** for this parameter. See detailed steps [here](https://www.chargebee.com/docs/1.0/mobile-app-store-product-iap.html#resource-id).
109
- * **Google Play Store** : To obtain the value for &#x60;{in_app_subscription_app_id}&#x60;, click **Set up notifications** within the **Sync Overview** page of the web app and use the value of generated **App ID** for this parameter. See detailed steps [here](https://www.chargebee.com/docs/1.0/mobile-playstore-notifications.html#app-id).
110
-
111
-
112
-
113
-
114
- */
115
-
116
22
  process_receipt(in_app_subscription_app_id:string, input:ProcessReceiptInputParam):ChargebeeRequest<ProcessReceiptResponse>;
117
23
 
118
- /**
119
- * @description Verifies an Apple App Store or Google Play Store in-app purchase [receipt](https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/validating_receipts_with_the_app_store?language&#x3D;objc#overview) and imports [subscriptions](/docs/api/subscriptions) for all historical purchases made by the customer.
120
- **Tip**
121
- An &#x60;in_app_subscription&#x60; is created for every unique &#x60;original_transaction_id&#x60;. Apple creates &#x60;original_transaction_id&#x60; for every create, upgrade, or downgrade of the subscription. A receipt hardly contains more than 100 &#x60;original_transaction_id&#x60;s. If a receipt contains more than 100 &#x60;original_transaction_id&#x60;s, Chargebee creates all subscription records but this endpoint returns the first 100 records in the response.
122
-
123
- CSV upload has a file size [limitation](https://www.chargebee.com/docs/mobile-app-store-product-iap.html#upload-in-app-receipts) that increases the processing time and the number of receipts. This API removes such limitations and allows you to import historical in-app subscription receipts.
124
- **Note** : This API verifies receipt or token through Apple or Google and then processes them via Chargebee. For bulk imports, limit API calls to **6** per minute (**10** seconds apart) to ensure successful subscription imports.
125
-
126
- Apple App Store {#app_store}
127
- ----------------------------
128
-
129
- This section provides details of the Import Receipt operation performed for the Apple App Store. This API processes only the historical in-app transaction receipts.
130
- **Important**
131
-
132
- * [Integrate Chargebee](https://www.chargebee.com/docs/mobile-app-store-connect.html#connnect-with-your-chargebee-site) with your Apple App Store account using your shared secret from Apple.
133
- * It is strongly recommended to use this endpoint to import historical in-app subscriptions only.
134
- * You must [import Apple App Store products](https://www.chargebee.com/docs/2.0/mobile-app-store-product-iap.html#import-products) using Chargebee&#x27;s user interface before importing receipts using this API.
135
-
136
- Chargebee validates the &#x60;receipt&#x60; with Apple App Store and does the following once validation succeeds:
137
-
138
- #### Subscriptions {#ir_apple_app_store_pcv2}
139
-
140
- [Subscriptions](/docs/api/subscriptions) are imported as follows:
141
-
142
- 1. A subscription is imported for every unique value of the [original_transaction_id](https://developer.apple.com/documentation/appstorereceipts/original_transaction_id?language&#x3D;objc) in the Apple receipt.
143
- **Note** : This is not done for &#x60;original_transaction_id&#x60;s for which a subscription already exists in Chargebee.
144
- 2. Each subscription imported has the following attributes set:
145
- * &#x60;id&#x60; set to &#x60;original_transaction_id&#x60;.
146
- * &#x60;start_date&#x60; set to the earliest [purchase_date_ms](https://developer.apple.com/documentation/appstorereceipts/responsebody/latest_receipt_info?language&#x3D;objc).
147
- * &#x60;current_term_start&#x60; set to latest [purchase_date_ms](https://developer.apple.com/documentation/appstorereceipts/responsebody/latest_receipt_info?language&#x3D;objc).
148
- * &#x60;current_term_end&#x60; set to [expires_date_ms](https://developer.apple.com/documentation/appstorereceipts/responsebody/latest_receipt_info?language&#x3D;objc) of the same &#x60;Latest_receipt_info&#x60; element with the latest &#x60;purchase_date_ms&#x60;.
149
- * &#x60;item_price_id&#x60; set to &#x60;product_id&#x60;.
150
- * &#x60;status&#x60; set to &#x60;in_trial&#x60; if there is only one element of [Latest_receipt_info](https://developer.apple.com/documentation/appstorereceipts/responsebody/latest_receipt_info?language&#x3D;objc) with the &#x60;original_transaction_id&#x60; and the field &#x60;is_trial_period&#x60; is &#x60;true&#x60;, then consider the subscription is currently in trial. No invoices are created for this subscription.
151
-
152
- #### Invoices for the subscription
153
-
154
- [Invoices](/docs/api/invoices) are imported as follows:
155
-
156
- 1. An invoice is imported to Chargebee for every element of the array [Latest_receipt_info](https://developer.apple.com/documentation/appstorereceipts/responsebody/latest_receipt_info?language&#x3D;objc) which has [is_trial_period](https://developer.apple.com/documentation/appstorereceipts/is_trial_period?language&#x3D;objc) as &#x60;false&#x60;.
157
- 2. Each imported invoice has the &#x60;subscription_id&#x60; set to &#x60;original_transaction_id&#x60;.
158
-
159
- #### Transactions for the invoices
160
-
161
- A [transaction](/docs/api/transactions) is imported for each invoice with the following details:
162
-
163
- 1. &#x60;reference_number&#x60; set to the &#x60;transaction_id&#x60;.
164
- 2. &#x60;payment_method&#x60; set to &#x60;apple_store&#x60;.
165
-
166
-
167
-
168
- Google Play Store {#app_store}
169
- ------------------------------
170
-
171
- This section provides details of the Import Receipt operation performed for the Google Play Store. This API is used to process only the historical in-app purchase subscriptions.
172
- **Important**
173
-
174
- * [Integrate Chargebee](https://www.chargebee.com/docs/2.0/mobile-playstore-connect.html) with your Google Play Store account using your [service account credentials JSON](https://www.chargebee.com/docs/2.0/mobile-playstore-connect.html#generate-service-account-credentials-json).
175
- * It is strongly recommended to use this endpoint to import historical in-app subscriptions only.
176
- * It is recommended to pass only the latest purchase &#x60;token&#x60;. If any other purchase &#x60;token&#x60; is passed instead of the latest one, there is a possibility of returning incorrect transaction details. If an expired purchase &#x60;token&#x60; is passed, then it returns an error.
177
- * The Google purchase token is [valid for 60 days](https://developer.android.com/google/play/billing/subscriptions#lifecycle) from the subscription purchase date. After the &#x60;token&#x60; expires, an API request to Google Developers API returns an error.
178
-
179
- Chargebee validates the purchase &#x60;token&#x60; with Google Play Store and does the following once validation succeeds:
180
-
181
- #### Subscriptions {#ir_google_play_store_pcv2}
182
-
183
- * A [subscription](/docs/api/subscriptions) is imported for every unique purchase token if it is not linked to an existing purchase &#x60;token&#x60;( &#x60;linkedPurchaseToken&#x60; field in &#x60;SubscriptionsV2.get&#x60; API Response).
184
-
185
- * Each subscription imported has the following attributes set:
186
-
187
- * &#x60;id&#x60; set to a unique identifier generated by Chargebee and mapped to the &#x60;token&#x60; and &#x60;latestOrderId&#x60; of the &#x60;SubscriptionPurchaseV2&#x60; object from Google response.
188
-
189
- * &#x60;start_date&#x60; set to the earliest &#x60;SubscriptionPurchaseV2.startTime&#x60;.
190
-
191
- * &#x60;current_term_start&#x60; set to latest &#x60;SubscriptionPurchaseV2.startTime&#x60;.
192
-
193
- * &#x60;current_term_end&#x60; set to &#x60;expiryTime&#x60; of the same &#x60;SubscriptionPurchaseV2&#x60; element with the latest purchase.
194
-
195
- * &#x60;item_price_id&#x60; set to the concatenation of &#x60;product[id]&#x60; and &#x60;priceCurrencyCode&#x60; from Google.
196
-
197
- * &#x60;status&#x60; set to &#x60;in_trial&#x60; if the free trial configuration is enabled in Google and the [monetization.subscriptions.basePlans.offers.State](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#State) is &#x60;Active&#x60; with a [SubscriptionOfferPhase.duration](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#subscriptionofferphase), then consider the subscription is currently in trial. No invoices are created for this subscription.
198
-
199
- #### Invoices for the subscription
200
-
201
- Invoices are imported as follows:
202
-
203
- * An [invoice](/docs/api/invoices &quot;https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver&#x3D;2&quot;) is imported to Chargebee for every new subscription and renewal of an existing subscription using &#x60;latestOrderId&#x60;.
204
-
205
- * Each imported invoice has the &#x60;subscription_id&#x60; set to a unique identifier generated by Chargebee and mapped to the &#x60;token&#x60; and &#x60;latestOrderId&#x60;.
206
-
207
- #### Transactions for the invoices
208
-
209
- A [transaction](/docs/api/transactions) is imported for each invoice with the following details:
210
-
211
- * &#x60;transaction.reference_number&#x60; is set to the &#x60;latestOrderId&#x60;.
212
-
213
- * &#x60;transaction.payment_method&#x60; is set to &#x60;play_store&#x60;.
214
-
215
- Path Parameter {#path_param}
216
- ----------------------------
217
-
218
- &#x60;{in_app_subscription_app_id}&#x60;: The handle created by Chargebee for your Apple App Store or Google Play Store app. It can be obtained from the Chargebee web app.
219
-
220
- The following are instructions to obtain the value of the path parameter for the Apple App Store and Google Play Store.
221
-
222
- * **Apple App Store** : To obtain the value for &#x60;{in_app_subscription_app_id}&#x60;, click **View Keys** within the **Sync Overview** page of the web app and use the value of generated **App ID** for this parameter. See detailed steps [here](https://www.chargebee.com/docs/1.0/mobile-app-store-product-iap.html#connection-keys_app-id).
223
- * **Google Play Store** : To obtain the value for &#x60;{in_app_subscription_app_id}&#x60;, click **Set up notifications** within the **Sync Overview** page of the web app and use the value of generated **App ID** for this parameter. See detailed steps [here](https://www.chargebee.com/docs/1.0/mobile-playstore-notifications.html#app-id).
224
-
225
-
226
-
227
-
228
- */
229
-
230
24
  import_receipt(in_app_subscription_app_id:string, input:ImportReceiptInputParam):ChargebeeRequest<ImportReceiptResponse>;
231
25
 
232
- /**
233
- * @description The Import Subscriptions endpoint is a Chargebee API that allows you to import historic In-App Subscriptions without using a valid Apple App Store receipt. This endpoint is useful if you do not have access to the receipt data which is required for the [Import Receipt](https://apidocs.chargebee.com/docs/api/in_app_subscriptions#import_receipt) API.
234
-
235
- With this API, you can import subscriptions and corresponding invoices for historic In-App purchases. The API returns the [in-app-subscriptions object](https://apidocs.chargebee.com/docs/api/in_app_subscriptions#in_app_subscription_attributes) once the historic subscription is successfully imported into Chargebee.
236
- **Note** :
237
-
238
- * Subscriptions cannot be imported from the Google Play Store without a receipt or token. Therefore; Chargebee does not allow you to use this API for the Google Play Store.
239
- * Enable V1 notifications in the Apple App Store for subscriptions created without receipts. Chargebee depends on receipt data to update subscription statuses. Apple&#x27;s V2 notifications do not have receipt information; therefore, Chargebee cannot process V2 notifications for subscriptions imported without receipts. Learn more about [++app store notifications++](https://apidocs.chargebee.com/docs/api/in_app_purchase_events?prod_cat_ver&#x3D;2#app_store_notifications) and [++notification URL configuration++](https://www.chargebee.com/docs/mobile-app-store-product-iap.html#connection-keys_notification-url).
240
-
241
- ### Apple App Store
242
-
243
- This section provides details of the Import Subscription operation when performed for the Apple App Store. This API creates a historic subscription if the incoming subscription is unknown. For a known subscription, it creates an invoice for the mentioned period.
244
- **Important**
245
-
246
- * [Integrate Chargebee](https://www.chargebee.com/docs/mobile-app-store-connect.html#connnect-with-your-chargebee-site) with your Apple App Store account using your shared secret from Apple.
247
-
248
- * It is strongly recommended to use this endpoint to create a historic In-App subscription only.
249
-
250
- * You must import App Store products using Chargebee&#x27;s user interface before importing receipts using this API.
251
-
252
- Chargebee validates the application ID with Apple App Store and does the following once validation succeeds:
253
-
254
- #### Subscription
255
-
256
- 1. Import the subscription from the &#x60;latest_receipt_info&#x60; array from Apple and a new subscription is imported for the item-price.
257
- **Note:** The subscription is not imported if it already exists in Chargebee but we will import the associated invoice using the subscription\[transaction_id\] in the payload.
258
-
259
- 2. Each subscription imported has the following attribute set:
260
-
261
- * &#x60;id&#x60; set to &#x60;subscription[id]&#x60; . This &#x60;subscription[id]&#x60; is &#x60;original_transaction_id&#x60; in the receipts.
262
-
263
- * &#x60;start_date&#x60; set to &#x60;subscription[start_date]&#x60;. You need to provide this information from the oldest &#x60;Latest_receipt_info.purchase_date_ms&#x60;.
264
-
265
- * &#x60;term_start&#x60; set to &#x60;subscription[term_start]&#x60;. You need to provide this information from the oldest &#x60;Latest_receipt_info.purchase_date_ms)&#x60;.
266
-
267
- * &#x60;term_end&#x60; set to &#x60;subscription[term_end]&#x60;. You need to provide this information from the oldest &#x60;Latest_receipt_info.expires_date_ms&#x60;.
268
-
269
- * &#x60;item_price_id&#x60; set to &#x60;subscription[product_id] + subscription[currency_code].&#x60; You need to provide this information from the &#x60;Latest_receipt_info.product_id&#x60;.
270
-
271
- * Chargebee records the subscription in a **Trial** state if the &#x60;is_trial_period&#x60; is &#x60;true&#x60;.
272
-
273
- * Chargebee records the subscription in a **Canceled** state if the &#x60;term_end&#x60; is less than the &#x60;System.currentTime()&#x60;.
274
-
275
- #### Invoice for the subscription
276
-
277
- 1. The payment is recorded against the subscription invoice.
278
-
279
- * Imported invoice has the &#x60;subscription_id&#x60; set to &#x60;original_transaction_id&#x60;.
280
-
281
- **Transactions for the invoice**
282
-
283
- 1. The associated transaction is updated with the following details:
284
-
285
- * The &#x60;transaction.reference_number&#x60; is set to the &#x60;transaction_id&#x60; of the payment.
286
-
287
- * The &#x60;transaction.payment_method&#x60; is set to &#x60;apple_store&#x60;.
288
-
289
- #### Path Parameter
290
-
291
- in_app_subscription_app_id
292
- required, string
293
-
294
- The handle created by Chargebee for your App Store app. It can be obtained from within the Chargebee web app.
295
-
296
- To obtain the value of &#x60;in_app_subscription_app_id &#x60;for the Apple App Store, click **View Keys** within the **Sync Overview** page of the web app, and use the value of generated **App ID** for this parameter. See detailed steps [here](https://www.chargebee.com/docs/mobile-app-store-product-iap.html#connection-keys_app-id).
297
-
298
- */
299
-
300
- import_subscription(in_app_subscription_app_id:string, input?:ImportSubscriptionInputParam):ChargebeeRequest<ImportSubscriptionResponse>;
26
+ import_subscription(in_app_subscription_app_id:string, input:ImportSubscriptionInputParam):ChargebeeRequest<ImportSubscriptionResponse>;
301
27
 
302
- /**
303
- * @description This API verifies the application id &#x60;{in_app_subscription_app_id}&#x60; and &#x60;receipt&#x60; then returns the subscription details associated with the purchase.
304
-
305
- #### Path Parameter
306
-
307
- in_app_subscription_app_id
308
- required, string
309
-
310
- The handle is created by Chargebee for your Apple App Store or Google Play Store app. It can be obtained from the Chargebee web app.
311
-
312
- The following are instructions to obtain the value of the path parameter for the Apple App Store and Google Play Store.
313
-
314
- * **Apple App Store** : To obtain the value for &#x60;{in_app_subscription_app_id}&#x60;, click **View Keys** within the **Sync Overview** page of the web app and use the value of generated **App ID** for this parameter. See detailed steps [here](https://www.chargebee.com/docs/1.0/mobile-app-store-product-iap.html#resource-id).
315
- * **Google Play Store** : To obtain the value for &#x60;{in_app_subscription_app_id}&#x60;, click **Set up notifications** within the **Sync Overview** page of the web app and use the value of generated **App ID** for this parameter. See detailed steps [here](https://www.chargebee.com/docs/1.0/mobile-playstore-notifications.html#app-id).
316
-
317
- */
318
-
319
28
  retrieve_store_subs(in_app_subscription_app_id:string, input:RetrieveStoreSubsInputParam):ChargebeeRequest<RetrieveStoreSubsResponse>;
320
29
  }
321
30
  export interface ProcessReceiptResponse {
@@ -323,73 +32,29 @@ The following are instructions to obtain the value of the path parameter for the
323
32
  }
324
33
  export interface ProcessReceiptInputParam {
325
34
 
326
- /**
327
- * @description **Apple App Store** : The Base64 encoded [App Store in-app purchase receipt](https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/validating_receipts_with_the_app_store?language&#x3D;objc#overview) taken from the Apple device after successful creation of the in-app purchase subscription.
328
-
329
- **Google Play Store** : The purchase &#x60;token&#x60; taken from the Android device after the successful creation of an in-app purchase subscription.
330
-
331
- */
332
-
333
- receipt:string;
334
-
335
- /**
336
- * @description Parameters for product
337
-
338
- */
339
-
340
- product?:{currency_code:string,id:string,name?:string,period?:string,period_unit?:string,price:number,price_in_decimal?:string};
341
-
342
- /**
343
- * @description Parameters for customer
344
-
345
- */
35
+ product:{currency_code:string,id:string,name?:string,period?:string,period_unit?:string,price:number,price_in_decimal?:string};
346
36
 
347
37
  customer?:{email?:string,first_name?:string,id?:string,last_name?:string};
38
+
39
+ receipt:string;
348
40
  }
349
41
  export interface ImportReceiptResponse {
350
42
  in_app_subscriptions:InAppSubscription[];
351
43
  }
352
44
  export interface ImportReceiptInputParam {
353
45
 
354
- /**
355
- * @description **Apple App Store** : The Base64 encoded [App Store in-app purchase receipt](https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/validating_receipts_with_the_app_store?language&#x3D;objc#overview) taken from the Apple device after successful creation of the in-app purchase subscription.
356
-
357
- **Google Play Store** : The purchase &#x60;token&#x60; taken from the Android device after the successful creation of an in-app purchase subscription.
358
-
359
- */
360
-
361
- receipt:string;
362
-
363
- /**
364
- * @description Parameters for product
365
-
366
- */
367
-
368
- product?:{currency_code:string};
369
-
370
- /**
371
- * @description Parameters for customer
372
-
373
- */
46
+ product:{currency_code:string};
374
47
 
375
48
  customer?:{email?:string,id?:string};
49
+
50
+ receipt:string;
376
51
  }
377
52
  export interface ImportSubscriptionResponse {
378
53
  in_app_subscription:InAppSubscription;
379
54
  }
380
55
  export interface ImportSubscriptionInputParam {
381
56
 
382
- /**
383
- * @description Parameters for subscription
384
-
385
- */
386
-
387
- subscription?:{currency_code:string,id:string,is_trial?:boolean,product_id:string,started_at:number,term_end:number,term_start:number,transaction_id:string};
388
-
389
- /**
390
- * @description Parameters for customer
391
-
392
- */
57
+ subscription:{currency_code:string,id:string,is_trial?:boolean,product_id:string,started_at:number,term_end:number,term_start:number,transaction_id:string};
393
58
 
394
59
  customer?:{email?:string,id?:string};
395
60
  }
@@ -398,13 +63,6 @@ The following are instructions to obtain the value of the path parameter for the
398
63
  }
399
64
  export interface RetrieveStoreSubsInputParam {
400
65
 
401
- /**
402
- * @description **Apple App Store** : The Base64 encoded [App Store in-app purchase receipt](https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/validating_receipts_with_the_app_store?language&#x3D;objc#overview) taken from the Apple device after successful creation of the in-app purchase subscription.
403
-
404
- **Google Play Store** : The purchase &#x60;token&#x60; taken from the Android device after the successful creation of an in-app purchase subscription.
405
-
406
- */
407
-
408
66
  receipt:string;
409
67
  }
410
68
 
@@ -155,6 +155,10 @@ declare module 'chargebee' {
155
155
 
156
156
  stop_dunning(invoice_id:string, input?:StopDunningInputParam):ChargebeeRequest<StopDunningResponse>;
157
157
 
158
+ pause_dunning(invoice_id:string, input:PauseDunningInputParam):ChargebeeRequest<PauseDunningResponse>;
159
+
160
+ resume_dunning(invoice_id:string, input?:ResumeDunningInputParam):ChargebeeRequest<ResumeDunningResponse>;
161
+
158
162
  import_invoice(input:ImportInvoiceInputParam):ChargebeeRequest<ImportInvoiceResponse>;
159
163
 
160
164
  apply_payments(invoice_id:string, input?:ApplyPaymentsInputParam):ChargebeeRequest<ApplyPaymentsResponse>;
@@ -234,7 +238,7 @@ declare module 'chargebee' {
234
238
 
235
239
  payment_method?:{additional_information?:object,gateway?:Gateway,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
236
240
 
237
- payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland',reference_id?:string};
241
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland' | 'payconiq_by_bancontact',reference_id?:string};
238
242
 
239
243
  addons?:{date_from?:number,date_to?:number,id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
240
244
 
@@ -291,7 +295,7 @@ declare module 'chargebee' {
291
295
 
292
296
  payment_method?:{additional_information?:object,gateway?:Gateway,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
293
297
 
294
- payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland',reference_id?:string};
298
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_payment_method_id?:string,gw_token?:string,id?:string,payment_method_type?:'card' | 'ideal' | 'sofort' | 'bancontact' | 'google_pay' | 'dotpay' | 'giropay' | 'apple_pay' | 'upi' | 'netbanking_emandates' | 'paypal_express_checkout' | 'direct_debit' | 'boleto' | 'venmo' | 'amazon_payments' | 'pay_to' | 'faster_payments' | 'sepa_instant_transfer' | 'klarna_pay_now' | 'online_banking_poland' | 'payconiq_by_bancontact',reference_id?:string};
295
299
 
296
300
  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}[];
297
301
 
@@ -443,6 +447,22 @@ declare module 'chargebee' {
443
447
 
444
448
  comment?:string;
445
449
  }
450
+ export interface PauseDunningResponse {
451
+ invoice:Invoice;
452
+ }
453
+ export interface PauseDunningInputParam {
454
+
455
+ expected_payment_date:number;
456
+
457
+ comment?:string;
458
+ }
459
+ export interface ResumeDunningResponse {
460
+ invoice:Invoice;
461
+ }
462
+ export interface ResumeDunningInputParam {
463
+
464
+ comment?:string;
465
+ }
446
466
  export interface ImportInvoiceResponse {
447
467
  invoice:Invoice;
448
468
 
@@ -582,16 +602,6 @@ declare module 'chargebee' {
582
602
 
583
603
  include_deleted?:boolean;
584
604
 
585
- hide_zero_line_item?:boolean;
586
-
587
- show_zero_tax_lines?:boolean;
588
-
589
- show_exempted_tax_lines?:boolean;
590
-
591
- include_consolidated_invoices?:boolean;
592
-
593
- ignore_imported_invoice?:boolean;
594
-
595
605
  /**
596
606
  * @description The invoice number. Acts as a identifier for invoice and typically generated sequentially.
597
607
 
@@ -775,9 +785,7 @@ NOTE: Not to be used if *consolidated invoicing* is enabled.
775
785
  }
776
786
  export interface RetrieveInputParam {
777
787
 
778
- line_items_limit?:number;
779
-
780
- line_items_offset?:string;
788
+ line_item?:{customer_id?:{is?:string},subscription_id?:{is?:string}};
781
789
  }
782
790
  export interface PdfResponse {
783
791
  download:Download;
@@ -1098,7 +1106,7 @@ NOTE: Not to be used if *consolidated invoicing* is enabled.
1098
1106
 
1099
1107
  metered?:boolean;
1100
1108
 
1101
- percentage?:string;
1109
+ is_percentage_pricing?:boolean;
1102
1110
 
1103
1111
  reference_line_item_id?:string;
1104
1112
 
@@ -1293,11 +1301,11 @@ NOTE: Not to be used if *consolidated invoicing* is enabled.
1293
1301
  created_at:number;
1294
1302
  }
1295
1303
  export interface Note {
1296
- entity_type:'coupon' | 'subscription' | 'customer' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price' | 'tax' | 'plan' | 'addon';
1297
-
1298
1304
  note:string;
1299
1305
 
1300
1306
  entity_id?:string;
1307
+
1308
+ entity_type?:'coupon' | 'subscription' | 'customer' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price' | 'tax' | 'plan' | 'addon';
1301
1309
  }
1302
1310
  export interface ShippingAddress {
1303
1311
  first_name?:string;
@@ -79,7 +79,7 @@ declare module 'chargebee' {
79
79
 
80
80
  metered?:boolean;
81
81
 
82
- percentage?:string;
82
+ is_percentage_pricing?:boolean;
83
83
 
84
84
  reference_line_item_id?:string;
85
85
 
@@ -120,11 +120,11 @@ declare module 'chargebee' {
120
120
 
121
121
  usage_calculation?:'sum_of_usages' | 'last_usage' | 'max_usage';
122
122
 
123
+ is_percentage_pricing?:boolean;
124
+
123
125
  metadata?:object;
124
126
 
125
127
  business_entity_id?:string;
126
-
127
- is_percentage_pricing?:boolean;
128
128
  }
129
129
  export interface RetrieveResponse {
130
130
  item:Item;
@@ -174,6 +174,8 @@ declare module 'chargebee' {
174
174
  included_in_mrr?:boolean;
175
175
 
176
176
  status?:'active' | 'archived';
177
+
178
+ is_percentage_pricing?:boolean;
177
179
  }
178
180
  export interface ListResponse {
179
181
  list:{item:Item}[];
@@ -288,13 +290,6 @@ declare module 'chargebee' {
288
290
 
289
291
  usage_calculation?:{in?:string,is?:'sum_of_usages' | 'last_usage' | 'max_usage',is_not?:'sum_of_usages' | 'last_usage' | 'max_usage',not_in?:string};
290
292
 
291
- /**
292
- * @description Indicates Whether a plan is grouped(bundle) or not. If it is grouped, it gives us the type of group.
293
-
294
- */
295
-
296
- item_grouping_category?:{in?:string,is?:'non_bundle' | 'fixed',is_not?:'non_bundle' | 'fixed',not_in?:string};
297
-
298
293
  /**
299
294
  * @description The subscription channel this object originated from and is maintained in.
300
295