chargebee 2.41.0 → 3.0.0-beta.2

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 (118) hide show
  1. package/CHANGELOG.md +11 -15
  2. package/LICENSE +1 -1
  3. package/README.md +90 -170
  4. package/cjs/RequestWrapper.js +84 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +80 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +90 -55
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +24 -35
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +230 -747
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4336
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +276 -911
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2935
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,332 +1,202 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface Purchase {
4
-
5
- /**
6
- * @description The unique identifier of the purchase resource. This is always autogenerated.
7
-
8
- */
9
-
10
- id?:string;
11
-
12
- /**
13
- * @description The unique identifier of the [customer](https://apidocs.chargebee.com/docs/api/customers) that made this purchase.
14
-
15
- */
16
-
17
- customer_id:string;
18
-
19
- /**
20
- * @description The time at which this purchase was created.
21
-
22
- */
23
-
24
- created_at?:number;
25
-
26
- /**
27
- * @description The time at which the purchase was modified.
28
-
29
- */
30
-
31
- modified_at?:number;
32
-
33
- /**
34
- * @description The unique identifiers of the [subscriptions](https://apidocs.chargebee.com/docs/api/subscriptions) that are created as part of this purchase. These IDs remain even when the associated subscriptions have been deleted.
35
-
36
- */
37
-
38
- subscription_ids?:string[];
39
-
40
- /**
41
- * @description The unique identifier of the [invoice(s)](invoices) created immediately as part of this purchase.
42
-
43
- */
44
-
45
- invoice_ids?:string[];
6
+ id?: string;
7
+ customer_id: string;
8
+ created_at?: number;
9
+ modified_at?: number;
10
+ subscription_ids?: string[];
11
+ invoice_ids?: string[];
46
12
  }
47
- export namespace Purchase {
48
- export class PurchaseResource {
49
- /**
50
- * @description Creates a &#x60;purchase&#x60; resource. A purchase can contain one or more of the following:
51
-
52
- * subscriptions (a [subscription](subscriptions) resource consists of item prices such that at least one of the item prices belongs to an [item](items) of &#x60;type&#x60; &#x60;plan&#x60;.)
53
- * group of one-time charges (aka [charge item prices](item_prices#types))
54
-
55
- When you call this API, the invoices for the subscription(s) and one-time charge(s) are created immediately and not left [unbilled](subscriptions?prod_cat_ver&#x3D;2#create_subscription_for_items_invoice_immediately).
56
- **Note**
57
-
58
- Providing &#x60;shipping_addresses[]&#x60; is required when the [Orders feature](https://www.chargebee.com/docs/2.0/orders.html#configuration_step-1-configure-site-wide-settings) has been enabled.
59
-
60
- ### Specifying &#x60;purchase_item&#x60; groups {#groups}
61
-
62
-
63
- When creating a purchase, you must specify the *group* or &#x60;index&#x60; to which each item price belongs. You can do this by setting the &#x60;purchase_items[index]&#x60; for each item price. Item prices with the same &#x60;purchase_items[index]&#x60; belong to the same group.
64
-
65
-
66
- The grouping of item prices allows you to specify the &#x60;discounts[]&#x60; applicable for each group and indicate which item prices should be added to any subscriptions you want to create. Groups can be one of two types:
67
-
68
- * Subscription groups
69
- * One-time charge groups
70
-
71
- The following subsections describe the types of groups in detail.
72
- **Note**
73
-
74
- You can specify up to 10 groups,
75
-
76
- * with a recommended subscription group of 5. To increase this limit to a maximum of 8, contact eap@chargebee.com.
77
- * with a maximum of 10 one-time charge groups by default.
78
-
79
- The total limit for group items for a single purchase is 60.
80
-
81
- #### Subscription groups {#subscription}
82
-
83
- To create a subscription, specify a *subscription group* . A subscription [group](#groups) is a group of item prices that contains exactly one item price of &#x60;type&#x60; &#x60;plan&#x60;. To create multiple subscriptions, provide multiple subscription groups.
84
- **Note**
85
-
86
- A subscription group can have up to 20 non-plan item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
87
13
 
88
- #### Custom Fields {#custom-fields}
89
-
90
- Purchase API supports custom fields of Subscriptions, use the following format to specify custom fields in Purchase API: **&#x60;subscription_info[custom_field]&#x60;**.
91
-
92
- #### One-time charge groups {#one-time}
93
-
94
- A one-time charge [group](#groups) is a group of charge item prices (i.e. item prices belonging to items of &#x60;type&#x60; &#x60;charge&#x60;). Charge item prices can be added to subscription groups as well. The charges within and across each one-time group must be unique.
95
- **Note**
96
-
97
- * A one-time charge group can have up to 20 item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
98
- * A charge item price can only be added to a single one-time charge group. However, it can be part of multiple [subscription groups](#subscription).
99
-
100
- ### Applying discounts {#discounts}
101
-
102
- Discounts, both [manual discounts](discounts) and &lt;coupons&gt;, can be applied to groups by specifying the &#x60;discounts[]&#x60; array. The following table describes the method of application based on whether &#x60;discounts[index][i]&#x60; is provided:
14
+ export namespace Purchase {
15
+ export class PurchaseResource {
16
+ create(
17
+ input: CreateInputParam,
18
+ headers?: ChargebeeRequestHeader,
19
+ ): Promise<ChargebeeResponse<CreateResponse>>;
20
+
21
+ estimate(
22
+ input: EstimateInputParam,
23
+ headers?: ChargebeeRequestHeader,
24
+ ): Promise<ChargebeeResponse<EstimateResponse>>;
25
+ }
103
26
 
104
- | | **&#x60;discounts[index][i]&#x60; is provided** | **&#x60;discounts[index][i]&#x60; is not provided** |
105
- |----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
106
- | **Coupons** | * The coupon is applied exclusively to the invoice for group &#x60;i&#x60;. * The coupon is applied exclusively to the invoice created immediately upon invoking this API. * If group &#x60;i&#x60; is a [subscription group](#subscription), then the coupon is applied to invoices for subscription renewals based on coupon attributes such as &#x60;duration_type&#x60; and &#x60;max_redemptions&#x60;. | * The coupon is applied to all the invoices immediately generated upon invoking this API. * The coupon is not applied to subsequent invoices, such as those generated upon subscription renewal. |
107
- | **Manual discounts** | * The manual discount is applied exclusively to the invoice for group &#x60;i&#x60;. * The manual discount is applied exclusively to the invoice created immediately upon invoking this API. * The manual discount is not applied to subsequent invoices, such as those generated upon subscription renewal. | * The manual discount is applied to all the invoices immediately generated upon invoking this API. * The manual discount is not applied to subsequent invoices, such as those generated upon subscription renewal. |
27
+ export interface CreateResponse {
28
+ purchase: Purchase;
29
+ }
108
30
 
31
+ export interface EstimateResponse {
32
+ estimate: Estimate;
33
+ }
109
34
 
110
- */
111
-
112
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
113
-
114
- /**
115
- * @description Returns an estimate for creating a &#x60;purchase&#x60; resource. The operation works exactly like [Create a purchase](purchases#create_a_purchase), except that only an [estimate](estimates) resource is returned without an actual &#x60;purchase&#x60; resource being created.
35
+ // REQUEST PARAMS
36
+ //---------------
116
37
 
117
- */
118
-
119
- estimate(input:EstimateInputParam):ChargebeeRequest<EstimateResponse>;
38
+ export interface CreateInputParam {
39
+ customer_id: string;
40
+ payment_source_id?: string;
41
+ invoice_info?: InvoiceInfoCreateInputParam;
42
+ statement_descriptor?: StatementDescriptorCreateInputParam;
43
+ installment_info?: InstallmentInfoCreateInputParam;
44
+ purchase_items?: PurchaseItemsCreateInputParam[];
45
+ item_tiers?: ItemTiersCreateInputParam[];
46
+ shipping_addresses?: ShippingAddressesCreateInputParam[];
47
+ discounts?: DiscountsCreateInputParam[];
48
+ subscription_info?: SubscriptionInfoCreateInputParam[];
49
+ contract_terms?: ContractTermsCreateInputParam[];
120
50
  }
121
- export interface CreateResponse {
122
- purchase:Purchase;
51
+ export interface EstimateInputParam {
52
+ client_profile_id?: string;
53
+ customer_id?: string;
54
+ customer?: CustomerEstimateInputParam;
55
+ billing_address?: BillingAddressEstimateInputParam;
56
+ purchase_items?: PurchaseItemsEstimateInputParam[];
57
+ item_tiers?: ItemTiersEstimateInputParam[];
58
+ shipping_addresses?: ShippingAddressesEstimateInputParam[];
59
+ discounts?: DiscountsEstimateInputParam[];
60
+ subscription_info?: SubscriptionInfoEstimateInputParam[];
61
+ contract_terms?: ContractTermsEstimateInputParam[];
123
62
  }
124
- export interface CreateInputParam {
125
-
126
- /**
127
- * @description The unique identifier of the [customer](https://apidocs.chargebee.com/docs/api/customers) that made this purchase.
128
-
129
- */
130
-
131
- customer_id:string;
132
-
133
- /**
134
- * @description Payment source attached to this purchase. If present, the customer&#x27;s payment sources won&#x27;t be used to collect any payment for this purchase.
135
-
136
- */
137
-
138
- payment_source_id?:string;
139
-
140
- /**
141
- * @description Parameters for invoice_info
142
-
143
- */
144
-
145
- invoice_info?:{notes?:string,po_number?:string};
146
-
147
- /**
148
- * @description Parameters for installment_info
149
-
150
- */
151
-
152
- installment_info?:{amount?:number,config_id?:string};
153
-
154
- /**
155
- * @description Parameters for purchase_items
156
-
157
- */
158
-
159
- purchase_items:{index:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
160
-
161
- /**
162
- * @description Parameters for item_tiers
163
-
164
- */
165
-
166
- item_tiers:{ending_unit?:number,ending_unit_in_decimal?:string,index:number,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
167
-
168
- /**
169
- * @description Parameters for shipping_addresses
170
-
171
- */
172
-
173
- shipping_addresses?:{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}[];
174
-
175
- /**
176
- * @description Parameters for discounts
177
-
178
- */
179
-
180
- discounts?:{amount?:number,coupon_id?:string,included_in_mrr?:boolean,index?:number,percentage?:number}[];
181
-
182
- /**
183
- * @description Parameters for subscription_info
184
-
185
- */
186
-
187
- subscription_info:{billing_cycles?:number,contract_term_billing_cycle_on_renewal?:number,index:number,meta_data?:object,subscription_id?:string}[];
188
-
189
- /**
190
- * @description Creates a &#x60;purchase&#x60; resource. A purchase can contain one or more of the following:
191
-
192
- * subscriptions (a [subscription](subscriptions) resource consists of item prices such that at least one of the item prices belongs to an [item](items) of &#x60;type&#x60; &#x60;plan&#x60;.)
193
- * group of one-time charges (aka [charge item prices](item_prices#types))
194
-
195
- When you call this API, the invoices for the subscription(s) and one-time charge(s) are created immediately and not left [unbilled](subscriptions?prod_cat_ver&#x3D;2#create_subscription_for_items_invoice_immediately).
196
- **Note**
197
-
198
- Providing &#x60;shipping_addresses[]&#x60; is required when the [Orders feature](https://www.chargebee.com/docs/2.0/orders.html#configuration_step-1-configure-site-wide-settings) has been enabled.
199
-
200
- ### Specifying &#x60;purchase_item&#x60; groups {#groups}
201
-
202
-
203
- When creating a purchase, you must specify the *group* or &#x60;index&#x60; to which each item price belongs. You can do this by setting the &#x60;purchase_items[index]&#x60; for each item price. Item prices with the same &#x60;purchase_items[index]&#x60; belong to the same group.
204
-
205
-
206
- The grouping of item prices allows you to specify the &#x60;discounts[]&#x60; applicable for each group and indicate which item prices should be added to any subscriptions you want to create. Groups can be one of two types:
207
-
208
- * Subscription groups
209
- * One-time charge groups
210
-
211
- The following subsections describe the types of groups in detail.
212
- **Note**
213
-
214
- You can specify up to 10 groups,
215
-
216
- * with a recommended subscription group of 5. To increase this limit to a maximum of 8, contact eap@chargebee.com.
217
- * with a maximum of 10 one-time charge groups by default.
218
-
219
- The total limit for group items for a single purchase is 60.
220
-
221
- #### Subscription groups {#subscription}
222
-
223
- To create a subscription, specify a *subscription group* . A subscription [group](#groups) is a group of item prices that contains exactly one item price of &#x60;type&#x60; &#x60;plan&#x60;. To create multiple subscriptions, provide multiple subscription groups.
224
- **Note**
225
-
226
- A subscription group can have up to 20 non-plan item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
227
-
228
- #### Custom Fields {#custom-fields}
229
-
230
- Purchase API supports custom fields of Subscriptions, use the following format to specify custom fields in Purchase API: **&#x60;subscription_info[custom_field]&#x60;**.
231
-
232
- #### One-time charge groups {#one-time}
233
-
234
- A one-time charge [group](#groups) is a group of charge item prices (i.e. item prices belonging to items of &#x60;type&#x60; &#x60;charge&#x60;). Charge item prices can be added to subscription groups as well. The charges within and across each one-time group must be unique.
235
- **Note**
236
-
237
- * A one-time charge group can have up to 20 item prices. To increase this limit to a maximum of 60, contact eap@chargebee.com.
238
- * A charge item price can only be added to a single one-time charge group. However, it can be part of multiple [subscription groups](#subscription).
239
-
240
- ### Applying discounts {#discounts}
241
-
242
- Discounts, both [manual discounts](discounts) and &lt;coupons&gt;, can be applied to groups by specifying the &#x60;discounts[]&#x60; array. The following table describes the method of application based on whether &#x60;discounts[index][i]&#x60; is provided:
243
-
244
- | | **&#x60;discounts[index][i]&#x60; is provided** | **&#x60;discounts[index][i]&#x60; is not provided** |
245
- |----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
246
- | **Coupons** | * The coupon is applied exclusively to the invoice for group &#x60;i&#x60;. * The coupon is applied exclusively to the invoice created immediately upon invoking this API. * If group &#x60;i&#x60; is a [subscription group](#subscription), then the coupon is applied to invoices for subscription renewals based on coupon attributes such as &#x60;duration_type&#x60; and &#x60;max_redemptions&#x60;. | * The coupon is applied to all the invoices immediately generated upon invoking this API. * The coupon is not applied to subsequent invoices, such as those generated upon subscription renewal. |
247
- | **Manual discounts** | * The manual discount is applied exclusively to the invoice for group &#x60;i&#x60;. * The manual discount is applied exclusively to the invoice created immediately upon invoking this API. * The manual discount is not applied to subsequent invoices, such as those generated upon subscription renewal. | * The manual discount is applied to all the invoices immediately generated upon invoking this API. * The manual discount is not applied to subsequent invoices, such as those generated upon subscription renewal. |
248
-
249
-
250
- */
251
-
252
- contract_terms:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number,index:number}[];
253
- statement_descriptor?:{descriptor?:string};
63
+ export interface StatementDescriptorCreateInputParam {
64
+ descriptor?: string;
254
65
  }
255
- export interface EstimateResponse {
256
- estimate:Estimate;
66
+ export interface InvoiceInfoCreateInputParam {
67
+ po_number?: string;
68
+ notes?: string;
69
+ }
70
+ export interface InstallmentInfoCreateInputParam {
71
+ config_id?: string;
72
+ amount?: number;
257
73
  }
258
- export interface EstimateInputParam {
259
-
260
- /**
261
- * @description Indicates the Client profile id for the customer. This is applicable only if you use [Chargebee&#x27;s AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
262
-
263
- */
264
-
265
- client_profile_id?:string;
266
-
267
- /**
268
- * @description The unique identifier of the [customer](https://apidocs.chargebee.com/docs/api/customers) that made this purchase.
269
-
270
- */
271
-
272
- customer_id?:string;
273
-
274
- /**
275
- * @description Parameters for customer
276
-
277
- */
278
-
279
- customer?:{customer_type?:CustomerType,entity_code?:EntityCode,exempt_number?:string,exemption_details?:any[],registered_for_gst?:boolean,taxability?:Taxability,vat_number?:string,vat_number_prefix?:string};
280
-
281
- /**
282
- * @description Parameters for billing_address
283
-
284
- */
285
-
286
- billing_address?:{city?:string,country?:string,line1?:string,line2?:string,line3?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
287
-
288
- /**
289
- * @description Parameters for purchase_items
290
-
291
- */
292
-
293
- purchase_items:{index:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
294
-
295
- /**
296
- * @description Parameters for item_tiers
297
-
298
- */
299
-
300
- item_tiers:{ending_unit?:number,ending_unit_in_decimal?:string,index:number,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
301
-
302
- /**
303
- * @description Parameters for shipping_addresses
304
-
305
- */
306
-
307
- shipping_addresses?:{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}[];
308
-
309
- /**
310
- * @description Parameters for discounts
311
-
312
- */
313
-
314
- discounts?:{amount?:number,coupon_id?:string,included_in_mrr?:boolean,index?:number,percentage?:number}[];
315
-
316
- /**
317
- * @description Parameters for subscription_info
318
74
 
319
- */
320
-
321
- subscription_info:{billing_cycles?:number,contract_term_billing_cycle_on_renewal?:number,index:number,subscription_id?:string}[];
322
-
323
- /**
324
- * @description Returns an estimate for creating a &#x60;purchase&#x60; resource. The operation works exactly like [Create a purchase](purchases#create_a_purchase), except that only an [estimate](estimates) resource is returned without an actual &#x60;purchase&#x60; resource being created.
75
+ export interface SubscriptionInfoCreateInputParam {
76
+ index: number;
77
+ subscription_id?: string;
78
+ billing_cycles?: number;
79
+ contract_term_billing_cycle_on_renewal?: number;
80
+ meta_data?: any;
81
+ }
82
+ export interface PurchaseItemsCreateInputParam {
83
+ index: number;
84
+ item_price_id: string;
85
+ quantity?: number;
86
+ unit_amount?: number;
87
+ unit_amount_in_decimal?: string;
88
+ quantity_in_decimal?: string;
89
+ }
90
+ export interface DiscountsCreateInputParam {
91
+ index?: number;
92
+ coupon_id?: string;
93
+ percentage?: number;
94
+ amount?: number;
95
+ included_in_mrr?: boolean;
96
+ }
97
+ export interface ContractTermsCreateInputParam {
98
+ index: number;
99
+ action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
100
+ cancellation_cutoff_period?: number;
101
+ }
102
+ export interface ItemTiersCreateInputParam {
103
+ index: number;
104
+ item_price_id?: string;
105
+ starting_unit?: number;
106
+ ending_unit?: number;
107
+ price?: number;
108
+ starting_unit_in_decimal?: string;
109
+ ending_unit_in_decimal?: string;
110
+ price_in_decimal?: string;
111
+ }
112
+ export interface ShippingAddressesCreateInputParam {
113
+ first_name?: string;
114
+ last_name?: string;
115
+ email?: string;
116
+ company?: string;
117
+ phone?: string;
118
+ line1?: string;
119
+ line2?: string;
120
+ line3?: string;
121
+ city?: string;
122
+ state?: string;
123
+ state_code?: string;
124
+ country?: string;
125
+ zip?: string;
126
+ validation_status?: ValidationStatus;
127
+ }
128
+ export interface BillingAddressEstimateInputParam {
129
+ line1?: string;
130
+ line2?: string;
131
+ line3?: string;
132
+ city?: string;
133
+ state_code?: string;
134
+ zip?: string;
135
+ country?: string;
136
+ validation_status?: ValidationStatus;
137
+ }
138
+ export interface CustomerEstimateInputParam {
139
+ vat_number?: string;
140
+ vat_number_prefix?: string;
141
+ registered_for_gst?: boolean;
142
+ taxability?: Taxability;
143
+ entity_code?: EntityCode;
144
+ exempt_number?: string;
145
+ exemption_details?: any;
146
+ customer_type?: CustomerType;
147
+ }
325
148
 
326
- */
327
-
328
- contract_terms:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number,index:number}[];
149
+ export interface SubscriptionInfoEstimateInputParam {
150
+ index: number;
151
+ subscription_id?: string;
152
+ billing_cycles?: number;
153
+ contract_term_billing_cycle_on_renewal?: number;
154
+ }
155
+ export interface PurchaseItemsEstimateInputParam {
156
+ index: number;
157
+ item_price_id: string;
158
+ quantity?: number;
159
+ unit_amount?: number;
160
+ unit_amount_in_decimal?: string;
161
+ quantity_in_decimal?: string;
162
+ }
163
+ export interface DiscountsEstimateInputParam {
164
+ index?: number;
165
+ coupon_id?: string;
166
+ percentage?: number;
167
+ amount?: number;
168
+ included_in_mrr?: boolean;
169
+ }
170
+ export interface ContractTermsEstimateInputParam {
171
+ index: number;
172
+ action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
173
+ cancellation_cutoff_period?: number;
174
+ }
175
+ export interface ItemTiersEstimateInputParam {
176
+ index: number;
177
+ item_price_id?: string;
178
+ starting_unit?: number;
179
+ ending_unit?: number;
180
+ price?: number;
181
+ starting_unit_in_decimal?: string;
182
+ ending_unit_in_decimal?: string;
183
+ price_in_decimal?: string;
184
+ }
185
+ export interface ShippingAddressesEstimateInputParam {
186
+ first_name?: string;
187
+ last_name?: string;
188
+ email?: string;
189
+ company?: string;
190
+ phone?: string;
191
+ line1?: string;
192
+ line2?: string;
193
+ line3?: string;
194
+ city?: string;
195
+ state?: string;
196
+ state_code?: string;
197
+ country?: string;
198
+ zip?: string;
199
+ validation_status?: ValidationStatus;
329
200
  }
330
-
331
201
  }
332
- }
202
+ }