chargebee 2.28.0 → 2.29.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 (51) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +6 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  5. package/.github/workflows/greeting.yml +47 -0
  6. package/CHANGELOG.md +47 -0
  7. package/SECURITY.md +8 -0
  8. package/lib/chargebee.js +1 -1
  9. package/lib/resources/api_endpoints.js +0 -7
  10. package/package.json +1 -1
  11. package/types/core.d.ts +4 -4
  12. package/types/resources/AttachedItem.d.ts +88 -88
  13. package/types/resources/Card.d.ts +68 -68
  14. package/types/resources/Comment.d.ts +50 -44
  15. package/types/resources/Coupon.d.ts +242 -207
  16. package/types/resources/CouponSet.d.ts +72 -68
  17. package/types/resources/CreditNote.d.ts +612 -236
  18. package/types/resources/Customer.d.ts +655 -513
  19. package/types/resources/DifferentialPrice.d.ts +99 -74
  20. package/types/resources/EntitlementOverride.d.ts +27 -12
  21. package/types/resources/Estimate.d.ts +450 -450
  22. package/types/resources/Event.d.ts +30 -12
  23. package/types/resources/Export.d.ts +200 -200
  24. package/types/resources/Feature.d.ts +66 -35
  25. package/types/resources/Gift.d.ts +54 -44
  26. package/types/resources/HostedPage.d.ts +381 -381
  27. package/types/resources/InAppSubscription.d.ts +94 -90
  28. package/types/resources/Invoice.d.ts +1242 -660
  29. package/types/resources/Item.d.ts +148 -142
  30. package/types/resources/ItemEntitlement.d.ts +36 -36
  31. package/types/resources/ItemFamily.d.ts +45 -45
  32. package/types/resources/ItemPrice.d.ts +317 -273
  33. package/types/resources/PaymentIntent.d.ts +60 -60
  34. package/types/resources/PaymentVoucher.d.ts +74 -59
  35. package/types/resources/PortalSession.d.ts +45 -20
  36. package/types/resources/PromotionalCredit.d.ts +68 -68
  37. package/types/resources/Purchase.d.ts +3 -3
  38. package/types/resources/Quote.d.ts +652 -363
  39. package/types/resources/QuoteLineGroup.d.ts +245 -0
  40. package/types/resources/QuotedCharge.d.ts +170 -0
  41. package/types/resources/QuotedSubscription.d.ts +219 -0
  42. package/types/resources/SiteMigrationDetail.d.ts +7 -7
  43. package/types/resources/Subscription.d.ts +1219 -932
  44. package/types/resources/SubscriptionEntitlement.d.ts +33 -12
  45. package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
  46. package/types/resources/TimeMachine.d.ts +15 -15
  47. package/types/resources/Token.d.ts +23 -23
  48. package/types/resources/Transaction.d.ts +229 -112
  49. package/types/resources/UnbilledCharge.d.ts +112 -67
  50. package/types/resources/Usage.d.ts +46 -47
  51. package/types/resources/VirtualBankAccount.d.ts +66 -66
@@ -275,13 +275,6 @@ Ireland** . The first two characters of the VAT number in such a case is `X
275
275
  }
276
276
  export namespace Quote {
277
277
  export class QuoteResource {
278
- /**
279
- * @description Create a quote for new subscription line items of a customer.
280
-
281
- */
282
-
283
- create_sub_items_for_customer_quote(customer_id:string, input?:CreateSubItemsForCustomerQuoteInputParam):ChargebeeRequest<CreateSubItemsForCustomerQuoteResponse>;
284
-
285
278
  /**
286
279
  * @description Retrieves the quotes identified by the &#x27;number&#x27; specified in the url.
287
280
 
@@ -290,18 +283,18 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
290
283
  retrieve(quote_id:string):ChargebeeRequest<RetrieveResponse>;
291
284
 
292
285
  /**
293
- * @description Changes the quote produced for creating a new subscription items
286
+ * @description Create a quote for new subscription line items of a customer.
294
287
 
295
288
  */
296
289
 
297
- edit_create_sub_customer_quote_for_items(quote_id:string, input?:EditCreateSubCustomerQuoteForItemsInputParam):ChargebeeRequest<EditCreateSubCustomerQuoteForItemsResponse>;
290
+ create_sub_items_for_customer_quote(customer_id:string, input?:CreateSubItemsForCustomerQuoteInputParam):ChargebeeRequest<CreateSubItemsForCustomerQuoteResponse>;
298
291
 
299
292
  /**
300
- * @description Updates the status of the quote. Status can be updated to Accepted, Declined, and Closed.
293
+ * @description Changes the quote produced for creating a new subscription items
301
294
 
302
295
  */
303
296
 
304
- update_status(quote_id:string, input:UpdateStatusInputParam):ChargebeeRequest<UpdateStatusResponse>;
297
+ edit_create_sub_customer_quote_for_items(quote_id:string, input?:EditCreateSubCustomerQuoteForItemsInputParam):ChargebeeRequest<EditCreateSubCustomerQuoteForItemsResponse>;
305
298
 
306
299
  /**
307
300
  * @description Create a quote for updating subscription line items.
@@ -311,18 +304,18 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
311
304
  update_subscription_quote_for_items(input?:UpdateSubscriptionQuoteForItemsInputParam):ChargebeeRequest<UpdateSubscriptionQuoteForItemsResponse>;
312
305
 
313
306
  /**
314
- * @description This API retrieves all the quote line groups and lineitems for a quote.
307
+ * @description Changes the quote produced for updating the subscription items.
315
308
 
316
309
  */
317
310
 
318
- quote_line_groups_for_quote(quote_id:string, input?:QuoteLineGroupsForQuoteInputParam):ChargebeeRequest<QuoteLineGroupsForQuoteResponse>;
311
+ edit_update_subscription_quote_for_items(quote_id:string, input?:EditUpdateSubscriptionQuoteForItemsInputParam):ChargebeeRequest<EditUpdateSubscriptionQuoteForItemsResponse>;
319
312
 
320
313
  /**
321
- * @description Can be used to extend the expiry date of a quote.
314
+ * @description Creates a quote using charge-items and one-time charges.
322
315
 
323
316
  */
324
317
 
325
- extend_expiry_date(quote_id:string, input:ExtendExpiryDateInputParam):ChargebeeRequest<ExtendExpiryDateResponse>;
318
+ create_for_charge_items_and_charges(input:CreateForChargeItemsAndChargesInputParam):ChargebeeRequest<CreateForChargeItemsAndChargesResponse>;
326
319
 
327
320
  /**
328
321
  * @description Changes the quote produced for adding one-time charges and charge items.
@@ -332,39 +325,39 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
332
325
  edit_for_charge_items_and_charges(quote_id:string, input?:EditForChargeItemsAndChargesInputParam):ChargebeeRequest<EditForChargeItemsAndChargesResponse>;
333
326
 
334
327
  /**
335
- * @description Changes the quote produced for updating the subscription items.
328
+ * @description List all quotes.
336
329
 
337
330
  */
338
331
 
339
- edit_update_subscription_quote_for_items(quote_id:string, input?:EditUpdateSubscriptionQuoteForItemsInputParam):ChargebeeRequest<EditUpdateSubscriptionQuoteForItemsResponse>;
332
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
340
333
 
341
334
  /**
342
- * @description List all quotes.
335
+ * @description This API retrieves all the quote line groups and lineitems for a quote.
343
336
 
344
337
  */
345
338
 
346
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
339
+ quote_line_groups_for_quote(quote_id:string, input?:QuoteLineGroupsForQuoteInputParam):ChargebeeRequest<QuoteLineGroupsForQuoteResponse>;
347
340
 
348
341
  /**
349
- * @description Retrieves the quote as a PDF. The returned URL is secure, allows download and expires in 60 minutes.
342
+ * @description This API is to convert a quote to an invoice.
350
343
 
351
344
  */
352
345
 
353
- pdf(quote_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
346
+ convert(quote_id:string, input?:ConvertInputParam):ChargebeeRequest<ConvertResponse>;
354
347
 
355
348
  /**
356
- * @description This API is to convert a quote to an invoice.
349
+ * @description Updates the status of the quote. Status can be updated to Accepted, Declined, and Closed.
357
350
 
358
351
  */
359
352
 
360
- convert(quote_id:string, input?:ConvertInputParam):ChargebeeRequest<ConvertResponse>;
353
+ update_status(quote_id:string, input:UpdateStatusInputParam):ChargebeeRequest<UpdateStatusResponse>;
361
354
 
362
355
  /**
363
- * @description Creates a quote using charge-items and one-time charges.
356
+ * @description Can be used to extend the expiry date of a quote.
364
357
 
365
358
  */
366
359
 
367
- create_for_charge_items_and_charges(input:CreateForChargeItemsAndChargesInputParam):ChargebeeRequest<CreateForChargeItemsAndChargesResponse>;
360
+ extend_expiry_date(quote_id:string, input:ExtendExpiryDateInputParam):ChargebeeRequest<ExtendExpiryDateResponse>;
368
361
 
369
362
  /**
370
363
  * @description Delete a quote using this API.
@@ -372,7 +365,22 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
372
365
  */
373
366
 
374
367
  delete(quote_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
368
+
369
+ /**
370
+ * @description Retrieves the quote as a PDF. The returned URL is secure, allows download and expires in 60 minutes.
371
+
372
+ */
373
+
374
+ pdf(quote_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
375
+ }
376
+ export interface RetrieveResponse {
377
+ quote:Quote;
378
+
379
+ quoted_subscription?:QuotedSubscription;
380
+
381
+ quoted_charge?:QuotedCharge;
375
382
  }
383
+
376
384
  export interface CreateSubItemsForCustomerQuoteResponse {
377
385
  quote:Quote;
378
386
 
@@ -478,14 +486,6 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
478
486
 
479
487
  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}[];
480
488
  }
481
- export interface RetrieveResponse {
482
- quote:Quote;
483
-
484
- quoted_subscription?:QuotedSubscription;
485
-
486
- quoted_charge?:QuotedCharge;
487
- }
488
-
489
489
  export interface EditCreateSubCustomerQuoteForItemsResponse {
490
490
  quote:Quote;
491
491
 
@@ -584,29 +584,6 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
584
584
 
585
585
  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}[];
586
586
  }
587
- export interface UpdateStatusResponse {
588
- quote:Quote;
589
-
590
- quoted_subscription?:QuotedSubscription;
591
-
592
- quoted_charge?:QuotedCharge;
593
- }
594
- export interface UpdateStatusInputParam {
595
-
596
- /**
597
- * @description Status to update for the quote. \* accepted - Accepted. \* closed - Closed \* declined - Declined.
598
-
599
- */
600
-
601
- status:'declined' | 'accepted' | 'closed';
602
-
603
- /**
604
- * @description An internal [comment](./comments) to be added for this operation, to the quote. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Quote PDF](./quotes#retrieve_quote_as_pdf).
605
-
606
- */
607
-
608
- comment?:string;
609
- }
610
587
  export interface UpdateSubscriptionQuoteForItemsResponse {
611
588
  quote:Quote;
612
589
 
@@ -796,137 +773,6 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
796
773
 
797
774
  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}[];
798
775
  }
799
- export interface QuoteLineGroupsForQuoteResponse {
800
- /**
801
- * @description This API retrieves all the quote line groups and lineitems for a quote.
802
-
803
- */
804
-
805
- list:{quote_line_group:QuoteLineGroup}[];
806
-
807
- /**
808
- * @description This API retrieves all the quote line groups and lineitems for a quote.
809
-
810
- */
811
-
812
- next_offset?:string;
813
- }
814
- export interface QuoteLineGroupsForQuoteInputParam {
815
- [key : string]: any;
816
- /**
817
- * @description The number of resources to be returned.
818
-
819
- */
820
-
821
- limit?:number;
822
-
823
- /**
824
- * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
825
-
826
- */
827
-
828
- offset?:string;
829
- }
830
- export interface ExtendExpiryDateResponse {
831
- quote:Quote;
832
-
833
- quoted_subscription?:QuotedSubscription;
834
-
835
- quoted_charge?:QuotedCharge;
836
- }
837
- export interface ExtendExpiryDateInputParam {
838
-
839
- /**
840
- * @description Quote will be valid till this date. After this date quote will be marked as closed.
841
-
842
- */
843
-
844
- valid_till:number;
845
- }
846
- export interface EditForChargeItemsAndChargesResponse {
847
- quote:Quote;
848
-
849
- quoted_charge?:QuotedCharge;
850
- }
851
- export interface EditForChargeItemsAndChargesInputParam {
852
-
853
- /**
854
- * @description Purchase Order Number for this quote.
855
-
856
- */
857
-
858
- po_number?:string;
859
-
860
- /**
861
- * @description Notes specific to this quote that you want customers to see on the quote PDF.
862
-
863
- */
864
-
865
- notes?:string;
866
-
867
- /**
868
- * @description Quotes will be vaild till this date. After this quote will be marked as closed.
869
-
870
- */
871
-
872
- expires_at?:number;
873
-
874
- /**
875
- * @description The currency code (ISO 4217 format) of the quote.
876
-
877
- */
878
-
879
- currency_code?:string;
880
-
881
- /**
882
- * @description The &#x27;One Time&#x27; coupon to be applied.
883
-
884
- */
885
-
886
- coupon?:string;
887
-
888
- /**
889
- * @description List of Coupons to be added.
890
-
891
- */
892
-
893
- coupon_ids?:string[];
894
-
895
- /**
896
- * @description Parameters for shipping_address
897
-
898
- */
899
-
900
- 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};
901
-
902
- /**
903
- * @description Parameters for item_prices
904
-
905
- */
906
-
907
- item_prices?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
908
-
909
- /**
910
- * @description Parameters for item_tiers
911
-
912
- */
913
-
914
- 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}[];
915
-
916
- /**
917
- * @description Parameters for charges
918
-
919
- */
920
-
921
- charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_transaction_type?:number,description?:string,service_period?:number}[];
922
-
923
- /**
924
- * @description Parameters for discounts
925
-
926
- */
927
-
928
- discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
929
- }
930
776
  export interface EditUpdateSubscriptionQuoteForItemsResponse {
931
777
  quote:Quote;
932
778
 
@@ -1109,201 +955,110 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
1109
955
 
1110
956
  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}[];
1111
957
  }
1112
- export interface ListResponse {
958
+ export interface CreateForChargeItemsAndChargesResponse {
959
+ quote:Quote;
960
+
961
+ quoted_charge?:QuotedCharge;
962
+ }
963
+ export interface CreateForChargeItemsAndChargesInputParam {
964
+
1113
965
  /**
1114
- * @description List all quotes.
966
+ * @description The quote name will be used as the pdf name of the quote.
1115
967
 
1116
968
  */
1117
969
 
1118
- list:{quote:Quote,quoted_subscription?:QuotedSubscription}[];
970
+ name?:string;
1119
971
 
1120
972
  /**
1121
- * @description List all quotes.
973
+ * @description Identifier of the customer for which the quote needs to be created.
1122
974
 
1123
975
  */
1124
976
 
1125
- next_offset?:string;
1126
- }
1127
- export interface ListInputParam {
1128
- [key : string]: any;
977
+ customer_id:string;
978
+
1129
979
  /**
1130
- * @description The number of resources to be returned.
980
+ * @description Purchase Order Number for this quote.
1131
981
 
1132
982
  */
1133
-
1134
- limit?:number;
983
+
984
+ po_number?:string;
1135
985
 
1136
986
  /**
1137
- * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
987
+ * @description Notes specific to this quote that you want customers to see on the quote PDF.
1138
988
 
1139
989
  */
1140
-
1141
- offset?:string;
990
+
991
+ notes?:string;
1142
992
 
1143
993
  /**
1144
- * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
994
+ * @description Quotes will be vaild till this date. After this quote will be marked as closed.
1145
995
 
1146
996
  */
1147
-
1148
- include_deleted?:boolean;
997
+
998
+ expires_at?:number;
1149
999
 
1150
1000
  /**
1151
- * @description The quote number. Acts as a identifier for quote and typically generated sequentially.
1001
+ * @description The currency code (ISO 4217 format) of the quote.
1152
1002
 
1153
1003
  */
1154
-
1155
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1156
1004
 
1157
- /**
1158
- * @description The identifier of the customer this quote belongs to.
1159
-
1160
- */
1161
-
1162
- customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1163
-
1164
- /**
1165
- * @description To filter based on subscription_id.
1166
- NOTE: Not to be used if *consolidated invoicing* feature is enabled.
1167
-
1168
- */
1169
-
1170
- subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
1171
-
1172
- /**
1173
- * @description Current status of this quote.
1174
-
1175
- */
1176
-
1177
- status?:{in?:string,is?:'declined' | 'invoiced' | 'accepted' | 'closed' | 'open',is_not?:'declined' | 'invoiced' | 'accepted' | 'closed' | 'open',not_in?:string};
1178
-
1179
- /**
1180
- * @description Creation date of the quote. Typically this is the date on which quote is generated.
1181
-
1182
- */
1183
-
1184
- date?:{after?:string,before?:string,between?:string,on?:string};
1005
+ currency_code?:string;
1185
1006
 
1186
1007
  /**
1187
- * @description To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
1008
+ * @description The &#x27;One Time&#x27; coupon to be applied.
1188
1009
 
1189
1010
  */
1190
-
1191
- updated_at?:{after?:string,before?:string,between?:string,on?:string};
1192
1011
 
1193
- /**
1194
- * @description List all quotes.
1195
-
1196
- */
1197
-
1198
- sort_by?:{asc?:'date',desc?:'date'};
1199
- }
1200
- export interface PdfResponse {
1201
- download:Download;
1202
- }
1203
- export interface PdfInputParam {
1012
+ coupon?:string;
1204
1013
 
1205
1014
  /**
1206
- * @description When true, the quote PDF has summary of all charges on the quote. When false, the quote PDF has a detailed view of charges grouped by charge event. This parameter does not affect one-time quotes.
1015
+ * @description List of Coupons to be added.
1207
1016
 
1208
1017
  */
1209
1018
 
1210
- consolidated_view?:boolean;
1019
+ coupon_ids?:string[];
1211
1020
 
1212
1021
  /**
1213
- * @description Determines the pdf should be rendered as inline or attachment in the browser. \* attachment - PDF is rendered as attachment in the browser \* inline - PDF is rendered as inline in the browser
1022
+ * @description Parameters for shipping_address
1214
1023
 
1215
1024
  */
1216
1025
 
1217
- disposition_type?:DispositionType;
1218
- }
1219
- export interface ConvertResponse {
1220
- quote:Quote;
1221
-
1222
- quoted_subscription?:QuotedSubscription;
1223
-
1224
- quoted_charge?:QuotedCharge;
1225
-
1226
- customer:Customer;
1227
-
1228
- subscription?:Subscription;
1229
-
1230
- invoice?:Invoice;
1231
-
1232
- credit_note?:CreditNote;
1233
-
1234
- unbilled_charges?:UnbilledCharge[];
1235
- }
1236
- export interface ConvertInputParam {
1026
+ 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};
1237
1027
 
1238
1028
  /**
1239
- * @description The document date displayed on the invoice PDF. 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. When not provided, the value is the same as current date. Moreover, if the invoice is created as &#x60;pending&#x60;, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the tax configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
1240
-
1241
- * &#x60;invoice_date&#x60; must be in the past.
1242
- * &#x60;invoice_date&#x60; is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
1243
- * The date is not earlier than &#x60;quoted_subscription.start_date&#x60; or &#x60;quoted_subscription.changes_scheduled_at&#x60; (whichever is applicable).
1244
- * &#x60;invoice_immediately&#x60; must be &#x60;true&#x60;.
1245
- .
1029
+ * @description Parameters for item_prices
1246
1030
 
1247
1031
  */
1248
1032
 
1249
- invoice_date?:number;
1033
+ item_prices?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
1250
1034
 
1251
1035
  /**
1252
- * @description This attribute is set to &#x60;true&#x60; automatically for the subscription when it has one or more &#x60;metered&#x60; items. However, when there are no &#x60;metered&#x60; items, you can pass this parameter as &#x60;true&#x60; to force all invoices (except the first) to be created as &#x60;pending&#x60;. This is useful in the following scenarios:
1253
-
1254
- * When you manage metered billing at your end by calculating usage-based charges yourself and add them to the subscription as [one-time charges](https://www.chargebee.com/docs/2.0/charges.html).
1255
- * When your workflow involves inspecting all charges before you close invoices.
1256
-
1257
- **Note:**
1258
-
1259
- * You must enable [Metered Billing](https://www.chargebee.com/docs/2.0/metered_billing.html) for this parameter to be acceptable.
1260
- * To create the first invoice also as &#x60;pending&#x60;, pass &#x60;first_invoice_pending&#x60; as &#x60;true&#x60;.
1261
- .
1036
+ * @description Parameters for item_tiers
1262
1037
 
1263
1038
  */
1264
1039
 
1265
- create_pending_invoices?:boolean;
1040
+ 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}[];
1266
1041
 
1267
1042
  /**
1268
- * @description Non-metered items are billed at the beginning of a billing cycle while metered items are billed at the end. Consequently, the first invoice of the subscription contains only the non-metered items.
1269
-
1270
- By passing this parameter as &#x60;true&#x60;, you create the first invoice as &#x60;pending&#x60; allowing you to add the previous term&#x27;s metered charges to it before closing. This is useful when the subscription is moved to Chargebee from a different billing system. As applicable to all &#x60;pending&#x60; invoices, this invoice is also [closed automatically](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) or via an [API call](/docs/api/invoices?prod_cat_ver&#x3D;2#close_a_pending_invoice).
1271
- **Note:**
1272
-
1273
- This parameter is passed only when there are metered items in the subscription or when &#x60;create_pending_invoices&#x60; is &#x60;true&#x60;.
1274
- .
1043
+ * @description Parameters for charges
1275
1044
 
1276
1045
  */
1277
1046
 
1278
- first_invoice_pending?:boolean;
1047
+ charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_transaction_type?:number,description?:string,service_period?:number}[];
1279
1048
 
1280
1049
  /**
1281
- * @description Parameters for subscription
1050
+ * @description Parameters for discounts
1282
1051
 
1283
1052
  */
1284
1053
 
1285
- subscription?:{auto_close_invoices?:boolean,auto_collection?:AutoCollection,id?:string,po_number?:string};
1054
+ discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
1286
1055
  }
1287
- export interface CreateForChargeItemsAndChargesResponse {
1056
+ export interface EditForChargeItemsAndChargesResponse {
1288
1057
  quote:Quote;
1289
1058
 
1290
1059
  quoted_charge?:QuotedCharge;
1291
1060
  }
1292
- export interface CreateForChargeItemsAndChargesInputParam {
1293
-
1294
- /**
1295
- * @description The quote name will be used as the pdf name of the quote.
1296
-
1297
- */
1298
-
1299
- name?:string;
1300
-
1301
- /**
1302
- * @description Identifier of the customer for which the quote needs to be created.
1303
-
1304
- */
1305
-
1306
- customer_id:string;
1061
+ export interface EditForChargeItemsAndChargesInputParam {
1307
1062
 
1308
1063
  /**
1309
1064
  * @description Purchase Order Number for this quote.
@@ -1382,144 +1137,678 @@ This parameter is passed only when there are metered items in the subscription o
1382
1137
 
1383
1138
  discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
1384
1139
  }
1385
- export interface DeleteResponse {
1386
- quote:Quote;
1387
-
1388
- quoted_subscription?:QuotedSubscription;
1140
+ export interface ListResponse {
1141
+ /**
1142
+ * @description List all quotes.
1143
+
1144
+ */
1389
1145
 
1390
- quoted_charge?:QuotedCharge;
1391
- }
1392
- export interface DeleteInputParam {
1146
+ list:{quote:Quote,quoted_subscription?:QuotedSubscription}[];
1393
1147
 
1394
1148
  /**
1395
- * @description Reason for deleting quote. This comment will be added to the subscription entity if the quote belongs to a subscription or added to the customer entity if the quote is associated only with a customer.
1149
+ * @description List all quotes.
1396
1150
 
1397
1151
  */
1398
1152
 
1399
- comment?:string;
1153
+ next_offset?:string;
1400
1154
  }
1401
- export interface LineItem {
1402
- id?:string;
1155
+ export interface ListInputParam {
1156
+ [key : string]: any;
1157
+ /**
1158
+ * @description List all quotes.
1159
+
1160
+ */
1161
+
1162
+ limit?:number;
1403
1163
 
1404
- subscription_id?:string;
1164
+ /**
1165
+ * @description List all quotes.
1166
+
1167
+ */
1168
+
1169
+ offset?:string;
1405
1170
 
1406
- date_from?:number;
1171
+ /**
1172
+ * @description List all quotes.
1173
+
1174
+ */
1175
+
1176
+ include_deleted?:boolean;
1407
1177
 
1408
- date_to?:number;
1178
+ /**
1179
+ * @description List all quotes.
1180
+
1181
+ */
1182
+
1183
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1409
1184
 
1410
- unit_amount?:number;
1185
+ /**
1186
+ * @description List all quotes.
1187
+
1188
+ */
1189
+
1190
+ customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
1411
1191
 
1412
- quantity?:number;
1192
+ /**
1193
+ * @description List all quotes.
1194
+
1195
+ */
1196
+
1197
+ subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
1413
1198
 
1414
- amount?:number;
1199
+ /**
1200
+ * @description List all quotes.
1201
+
1202
+ */
1203
+
1204
+ status?:{in?:string,is?:'declined' | 'invoiced' | 'accepted' | 'closed' | 'open',is_not?:'declined' | 'invoiced' | 'accepted' | 'closed' | 'open',not_in?:string};
1415
1205
 
1416
- pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
1206
+ /**
1207
+ * @description List all quotes.
1208
+
1209
+ */
1210
+
1211
+ date?:{after?:string,before?:string,between?:string,on?:string};
1417
1212
 
1418
- is_taxed?:boolean;
1213
+ /**
1214
+ * @description List all quotes.
1215
+
1216
+ */
1217
+
1218
+ updated_at?:{after?:string,before?:string,between?:string,on?:string};
1419
1219
 
1420
- tax_amount?:number;
1220
+ /**
1221
+ * @description List all quotes.
1222
+
1223
+ */
1224
+
1225
+ sort_by?:{asc?:'date',desc?:'date'};
1226
+ }
1227
+ export interface QuoteLineGroupsForQuoteResponse {
1228
+ /**
1229
+ * @description This API retrieves all the quote line groups and lineitems for a quote.
1230
+
1231
+ */
1421
1232
 
1422
- tax_rate?:number;
1233
+ list:{quote_line_group:QuoteLineGroup}[];
1423
1234
 
1424
- unit_amount_in_decimal?:string;
1235
+ /**
1236
+ * @description This API retrieves all the quote line groups and lineitems for a quote.
1237
+
1238
+ */
1425
1239
 
1426
- quantity_in_decimal?:string;
1240
+ next_offset?:string;
1241
+ }
1242
+ export interface QuoteLineGroupsForQuoteInputParam {
1243
+ [key : string]: any;
1244
+ /**
1245
+ * @description This API retrieves all the quote line groups and lineitems for a quote.
1246
+
1247
+ */
1248
+
1249
+ limit?:number;
1427
1250
 
1428
- amount_in_decimal?:string;
1251
+ /**
1252
+ * @description This API retrieves all the quote line groups and lineitems for a quote.
1253
+
1254
+ */
1255
+
1256
+ offset?:string;
1257
+ }
1258
+ export interface ConvertResponse {
1259
+ quote:Quote;
1429
1260
 
1430
- discount_amount?:number;
1261
+ quoted_subscription?:QuotedSubscription;
1431
1262
 
1432
- item_level_discount_amount?:number;
1263
+ quoted_charge?:QuotedCharge;
1433
1264
 
1434
- reference_line_item_id?:string;
1265
+ customer:Customer;
1435
1266
 
1436
- description?:string;
1267
+ subscription?:Subscription;
1437
1268
 
1438
- entity_description?:string;
1269
+ invoice?:Invoice;
1439
1270
 
1440
- entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
1271
+ credit_note?:CreditNote;
1441
1272
 
1442
- tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
1273
+ unbilled_charges?:UnbilledCharge[];
1274
+ }
1275
+ export interface ConvertInputParam {
1276
+
1277
+ /**
1278
+ * @description The document date displayed on the invoice PDF. 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. When not provided, the value is the same as current date. Moreover, if the invoice is created as &#x60;pending&#x60;, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. &#x60;taxes&#x60; and &#x60;line_item_taxes&#x60; are computed based on the tax configuration as of &#x60;invoice_date&#x60;. When passing this parameter, the following prerequisites must be met:
1279
+
1280
+ * &#x60;invoice_date&#x60; must be in the past.
1281
+ * &#x60;invoice_date&#x60; is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
1282
+ * The date is not earlier than &#x60;quoted_subscription.start_date&#x60; or &#x60;quoted_subscription.changes_scheduled_at&#x60; (whichever is applicable).
1283
+ * &#x60;invoice_immediately&#x60; must be &#x60;true&#x60;.
1284
+ .
1285
+
1286
+ */
1287
+
1288
+ invoice_date?:number;
1289
+
1290
+ /**
1291
+ * @description This attribute is set to &#x60;true&#x60; automatically for the subscription when it has one or more &#x60;metered&#x60; items. However, when there are no &#x60;metered&#x60; items, you can pass this parameter as &#x60;true&#x60; to force all invoices (except the first) to be created as &#x60;pending&#x60;. This is useful in the following scenarios:
1292
+
1293
+ * When you manage metered billing at your end by calculating usage-based charges yourself and add them to the subscription as [one-time charges](https://www.chargebee.com/docs/2.0/charges.html).
1294
+ * When your workflow involves inspecting all charges before you close invoices.
1295
+
1296
+ **Note:**
1297
+
1298
+ * You must enable [Metered Billing](https://www.chargebee.com/docs/2.0/metered_billing.html) for this parameter to be acceptable.
1299
+ * To create the first invoice also as &#x60;pending&#x60;, pass &#x60;first_invoice_pending&#x60; as &#x60;true&#x60;.
1300
+ .
1301
+
1302
+ */
1303
+
1304
+ create_pending_invoices?:boolean;
1305
+
1306
+ /**
1307
+ * @description Non-metered items are billed at the beginning of a billing cycle while metered items are billed at the end. Consequently, the first invoice of the subscription contains only the non-metered items.
1308
+
1309
+ By passing this parameter as &#x60;true&#x60;, you create the first invoice as &#x60;pending&#x60; allowing you to add the previous term&#x27;s metered charges to it before closing. This is useful when the subscription is moved to Chargebee from a different billing system. As applicable to all &#x60;pending&#x60; invoices, this invoice is also [closed automatically](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing) or via an [API call](/docs/api/invoices?prod_cat_ver&#x3D;2#close_a_pending_invoice).
1310
+ **Note:**
1311
+
1312
+ This parameter is passed only when there are metered items in the subscription or when &#x60;create_pending_invoices&#x60; is &#x60;true&#x60;.
1313
+ .
1314
+
1315
+ */
1316
+
1317
+ first_invoice_pending?:boolean;
1318
+
1319
+ /**
1320
+ * @description Parameters for subscription
1321
+
1322
+ */
1323
+
1324
+ subscription?:{auto_close_invoices?:boolean,auto_collection?:AutoCollection,id?:string,po_number?:string};
1325
+ }
1326
+ export interface UpdateStatusResponse {
1327
+ quote:Quote;
1328
+
1329
+ quoted_subscription?:QuotedSubscription;
1330
+
1331
+ quoted_charge?:QuotedCharge;
1332
+ }
1333
+ export interface UpdateStatusInputParam {
1334
+
1335
+ /**
1336
+ * @description Status to update for the quote. \* accepted - Accepted. \* closed - Closed \* declined - Declined.
1337
+
1338
+ */
1339
+
1340
+ status:'declined' | 'accepted' | 'closed';
1341
+
1342
+ /**
1343
+ * @description An internal [comment](./comments) to be added for this operation, to the quote. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing [Hosted Page](./hosted_pages) or any document such as the [Quote PDF](./quotes#retrieve_quote_as_pdf).
1344
+
1345
+ */
1346
+
1347
+ comment?:string;
1348
+ }
1349
+ export interface ExtendExpiryDateResponse {
1350
+ quote:Quote;
1351
+
1352
+ quoted_subscription?:QuotedSubscription;
1353
+
1354
+ quoted_charge?:QuotedCharge;
1355
+ }
1356
+ export interface ExtendExpiryDateInputParam {
1357
+
1358
+ /**
1359
+ * @description Quote will be valid till this date. After this date quote will be marked as closed.
1360
+
1361
+ */
1362
+
1363
+ valid_till:number;
1364
+ }
1365
+ export interface DeleteResponse {
1366
+ quote:Quote;
1367
+
1368
+ quoted_subscription?:QuotedSubscription;
1369
+
1370
+ quoted_charge?:QuotedCharge;
1371
+ }
1372
+ export interface DeleteInputParam {
1373
+
1374
+ /**
1375
+ * @description Reason for deleting quote. This comment will be added to the subscription entity if the quote belongs to a subscription or added to the customer entity if the quote is associated only with a customer.
1376
+
1377
+ */
1378
+
1379
+ comment?:string;
1380
+ }
1381
+ export interface PdfResponse {
1382
+ download:Download;
1383
+ }
1384
+ export interface PdfInputParam {
1385
+
1386
+ /**
1387
+ * @description When true, the quote PDF has summary of all charges on the quote. When false, the quote PDF has a detailed view of charges grouped by charge event. This parameter does not affect one-time quotes.
1388
+
1389
+ */
1390
+
1391
+ consolidated_view?:boolean;
1392
+
1393
+ /**
1394
+ * @description Determines the pdf should be rendered as inline or attachment in the browser. \* attachment - PDF is rendered as attachment in the browser \* inline - PDF is rendered as inline in the browser
1395
+
1396
+ */
1397
+
1398
+ disposition_type?:DispositionType;
1399
+ }
1400
+ export interface LineItem {
1401
+ /**
1402
+ * @description Uniquely identifies a line_item
1403
+
1404
+ */
1405
+
1406
+ id?:string;
1407
+
1408
+ /**
1409
+ * @description A unique identifier for the subscription this line item belongs to.
1410
+
1411
+ */
1412
+
1413
+ subscription_id?:string;
1414
+
1415
+ /**
1416
+ * @description Start date of this line item.
1417
+
1418
+ */
1419
+
1420
+ date_from:number;
1421
+
1422
+ /**
1423
+ * @description End date of this line item.
1424
+
1425
+ */
1426
+
1427
+ date_to:number;
1428
+
1429
+ /**
1430
+ * @description Unit amount of the line item.
1431
+
1432
+ */
1433
+
1434
+ unit_amount:number;
1435
+
1436
+ /**
1437
+ * @description [Quantity of the recurring item](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_line_items_quantity) which is represented by this line item. For &#x60;metered&#x60; line items, this value is updated from [usages](/docs/api/usages) once when the invoice is generated as &#x60;pending&#x60; and finally when the invoice is [closed](/docs/api/invoices#close_a_pending_invoice).
1438
+
1439
+ */
1440
+
1441
+ quantity?:number;
1442
+
1443
+ /**
1444
+ * @description Total amount of this line item. Typically equals to unit amount x quantity
1445
+
1446
+ */
1447
+
1448
+ amount?:number;
1449
+
1450
+ /**
1451
+ * @description The [pricing scheme](https://www.chargebee.com/docs/2.0/plans.html#pricing-models) for this item price. \* per_unit - A fixed price per unit quantity. \* stairstep - A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in. \* flat_fee - A fixed price that is not quantity-based. \* tiered - The per unit price is based on the tier that the total quantity falls in. \* volume - There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.
1452
+
1453
+ */
1454
+
1455
+ pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
1456
+
1457
+ /**
1458
+ * @description Specifies whether this line item is taxed or not
1459
+
1460
+ */
1461
+
1462
+ is_taxed:boolean;
1463
+
1464
+ /**
1465
+ * @description The tax amount charged for this item
1466
+
1467
+ */
1468
+
1469
+ tax_amount?:number;
1470
+
1471
+ /**
1472
+ * @description Rate of tax used to calculate tax for this lineitem
1473
+
1474
+ */
1475
+
1476
+ tax_rate?:number;
1477
+
1478
+ /**
1479
+ * @description The decimal representation of the unit amount of the &#x60;line_item&#x60;. The value is in major units of the currency. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1480
+
1481
+ */
1482
+
1483
+ unit_amount_in_decimal?:string;
1484
+
1485
+ /**
1486
+ * @description The decimal representation of the quantity of this line_item. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1487
+
1488
+ */
1489
+
1490
+ quantity_in_decimal?:string;
1491
+
1492
+ /**
1493
+ * @description The decimal representation of the amount for the &#x60;line_item&#x60;, in major units of the currency. Typically equals to &#x60;unit_amount_in_decimal&#x60; x &#x60;quantity_in_decimal&#x60;. Returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1494
+
1495
+ */
1496
+
1497
+ amount_in_decimal?:string;
1498
+
1499
+ /**
1500
+ * @description Total discounts for this line
1501
+
1502
+ */
1503
+
1504
+ discount_amount?:number;
1505
+
1506
+ /**
1507
+ * @description Line Item-level discounts for this line.
1508
+
1509
+ */
1510
+
1511
+ item_level_discount_amount?:number;
1512
+
1513
+ /**
1514
+ * @description Invoice Reference Line Item ID
1515
+
1516
+ */
1517
+
1518
+ reference_line_item_id?:string;
1519
+
1520
+ /**
1521
+ * @description Detailed description about this line item.
1522
+
1523
+ */
1524
+
1525
+ description:string;
1526
+
1527
+ /**
1528
+ * @description Detailed description about this item.
1529
+
1530
+ */
1531
+
1532
+ entity_description?:string;
1533
+
1534
+ /**
1535
+ * @description Specifies the modelled entity this line item is based on. \* addon - Indicates that this lineitem is based on &#x27;Addon&#x27; entity. The &#x27;entity_id&#x27; attribute specifies the [addon](/docs/api/addons#addon_attributes) id \* plan_item_price - Indicates that this line item is based on plan Item Price \* addon_item_price - Indicates that this line item is based on addon Item Price \* charge_item_price - Indicates that this line item is based on charge Item Price \* adhoc - Indicates that this lineitem is not modelled. i.e created adhoc. So the &#x27;entity_id&#x27; attribute will be null in this case \* plan_setup - Indicates that this lineitem is based on &#x27;Plan Setup&#x27; charge. The &#x27;entity_id&#x27; attribute specifies the [plan](/docs/api/plans#plan_attributes) id \* plan - Indicates that this lineitem is based on &#x27;Plan&#x27; entity. The &#x27;entity_id&#x27; attribute specifies the [plan](/docs/api/plans#plan_attributes) id
1536
+
1537
+ */
1538
+
1539
+ entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
1540
+
1541
+ /**
1542
+ * @description The reason due to which the line item price/amount is exempted from tax. \* zero_value_item - If the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0. \* reverse_charge - If the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU only \* tax_not_configured - If tax is not enabled for the site \* high_value_physical_goods - If physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be applied \* product_exempt - If the Plan or Addon is marked as Tax exempt \* zero_rated - If the rate of tax is 0% and no Sales/ GST tax is collectable for that line item \* customer_exempt - If the Customer is marked as Tax exempt \* region_non_taxable - If the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdiction \* export - You are not registered for tax in the customer&#x27;s region. This is also the reason code when both &#x60;billing_address&#x60; and &#x60;shipping_address&#x60; have not been provided for the customer and subscription respectively
1543
+
1544
+ */
1545
+
1546
+ tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
1547
+
1548
+ /**
1549
+ * @description The identifier of the modelled entity this line item is based on. Will be null for &#x27;adhoc&#x27; entity type
1550
+
1551
+ */
1443
1552
 
1444
1553
  entity_id?:string;
1445
1554
 
1555
+ /**
1556
+ * @description A unique identifier for the customer this line item belongs to
1557
+
1558
+ */
1559
+
1446
1560
  customer_id?:string;
1447
1561
  }
1448
1562
  export interface Discount {
1449
- amount?:number;
1563
+ /**
1564
+ * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver&#x3D;2#currencies).
1565
+
1566
+ */
1567
+
1568
+ amount:number;
1569
+
1570
+ /**
1571
+ * @description Description for this deduction.
1572
+
1573
+ */
1450
1574
 
1451
1575
  description?:string;
1452
1576
 
1577
+ /**
1578
+ * @description The unique id of the line item that this deduction is for. Is required when &#x60;discounts[entity_type]&#x60; is &#x60;item_level_coupon&#x60; or &#x60;document_level_coupon&#x60;.
1579
+
1580
+ */
1581
+
1453
1582
  line_item_id?:string;
1454
1583
 
1455
- entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1584
+ /**
1585
+ * @description The type of deduction and the amount to which it is applied. \* document_level_coupon - The deduction is due to a coupon applied to the invoice &#x60;sub_total&#x60;. The coupon id is passed as &#x60;entity_id&#x60;. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_adjustment_credit_notes). \* item_level_coupon - The deduction is due to a coupon applied to line item. The coupon &#x60;id&#x60; is passed as &#x60;entity_id&#x60;. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to a line item of the invoice. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits?prod_cat_ver&#x3D;2) applied to the invoice. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to the invoice &#x60;sub_total&#x60;. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;.
1586
+
1587
+ */
1588
+
1589
+ entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1590
+
1591
+ /**
1592
+ * @description The type of discount that is applied to the line item. Relevant only when &#x60;discounts[entity_type]&#x60; is one of &#x60;item_level_discount&#x60; , &#x60;item_level_coupon&#x60;, &#x60;document_level_discount&#x60;, or &#x60;document_level_coupon&#x60; \* percentage - when percentage is applied as discount \* fixed_amount - when amount is applied as discount
1593
+
1594
+ */
1456
1595
 
1457
1596
  discount_type?:'fixed_amount' | 'percentage';
1458
1597
 
1598
+ /**
1599
+ * @description When the deduction is due to a &#x60;coupon&#x60; or a [discount](discounts), then this is the &#x60;id&#x60; of the coupon or discount.
1600
+
1601
+ */
1602
+
1459
1603
  entity_id?:string;
1460
1604
 
1605
+ /**
1606
+ * @description The [coupon code](/docs/api/coupon_codes#coupon_code_code), if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons#coupon_id) is available in &#x60;entity_id&#x60;.
1607
+
1608
+ */
1609
+
1461
1610
  coupon_set_code?:string;
1462
1611
  }
1463
1612
  export interface LineItemDiscount {
1464
- line_item_id?:string;
1613
+ /**
1614
+ * @description The unique id of the line item that this deduction is for.
1615
+
1616
+ */
1465
1617
 
1466
- discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1618
+ line_item_id:string;
1619
+
1620
+ /**
1621
+ * @description The type of deduction and the amount to which it is applied. \* item_level_coupon - The deduction is due to a coupon applied to a line item of the invoice. The coupon &#x60;id&#x60; is available as &#x60;entity_id&#x60;. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_adjustment_credit_notes). \* document_level_coupon - The deduction is due to a coupon applied to the invoice &#x60;sub_total&#x60;. The coupon &#x60;id&#x60; is available as &#x60;entity_id&#x60;. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to the invoice &#x60;sub_total&#x60;. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to a line item of the invoice. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case.
1622
+
1623
+ */
1624
+
1625
+ discount_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
1467
1626
 
1468
1627
  coupon_id?:string;
1469
1628
 
1629
+ /**
1630
+ * @description When the deduction is due to a &#x60;coupon&#x60; or a [discount](discounts), then this is the &#x60;id&#x60; of the coupon or discount.
1631
+
1632
+ */
1633
+
1470
1634
  entity_id?:string;
1471
1635
 
1472
- discount_amount?:number;
1636
+ /**
1637
+ * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api#currencies).
1638
+
1639
+ */
1640
+
1641
+ discount_amount:number;
1473
1642
  }
1474
1643
  export interface Tax {
1475
- name?:string;
1644
+ /**
1645
+ * @description The name of the tax applied. E.g. GST.
1646
+
1647
+ */
1476
1648
 
1477
- amount?:number;
1649
+ name:string;
1650
+
1651
+ /**
1652
+ * @description The tax amount.
1653
+
1654
+ */
1655
+
1656
+ amount:number;
1657
+
1658
+ /**
1659
+ * @description Description of the tax item.
1660
+
1661
+ */
1478
1662
 
1479
1663
  description?:string;
1480
1664
  }
1481
1665
  export interface LineItemTax {
1666
+ /**
1667
+ * @description The unique reference id of the line item for which the tax is applicable
1668
+
1669
+ */
1670
+
1482
1671
  line_item_id?:string;
1483
1672
 
1484
- tax_name?:string;
1673
+ /**
1674
+ * @description The name of the tax applied
1675
+
1676
+ */
1677
+
1678
+ tax_name:string;
1485
1679
 
1486
- tax_rate?:number;
1680
+ /**
1681
+ * @description The rate of tax used to calculate tax amount
1682
+
1683
+ */
1684
+
1685
+ tax_rate:number;
1686
+
1687
+ /**
1688
+ * @description Indicates if tax is applied only on a portion of the line item amount.
1689
+
1690
+ */
1487
1691
 
1488
1692
  is_partial_tax_applied?:boolean;
1489
1693
 
1694
+ /**
1695
+ * @description Indicates the non-compliance tax that should not be reported to the jurisdiction.
1696
+
1697
+ */
1698
+
1490
1699
  is_non_compliance_tax?:boolean;
1491
1700
 
1492
- taxable_amount?:number;
1701
+ /**
1702
+ * @description Indicates the actual portion of the line item amount that is taxable.
1703
+
1704
+ */
1493
1705
 
1494
- tax_amount?:number;
1706
+ taxable_amount:number;
1707
+
1708
+ /**
1709
+ * @description The tax amount
1710
+
1711
+ */
1712
+
1713
+ tax_amount:number;
1714
+
1715
+ /**
1716
+ * @description The type of tax jurisdiction \* unincorporated - Combined tax of state and county. \* federal - The tax jurisdiction is a federal \* state - The tax jurisdiction is a state \* county - The tax jurisdiction is a county \* country - The tax jurisdiction is a country \* city - The tax jurisdiction is a city \* other - Jurisdictions other than the ones listed above. \* special - Special tax jurisdiction.
1717
+
1718
+ */
1495
1719
 
1496
1720
  tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
1497
1721
 
1722
+ /**
1723
+ * @description The name of the tax jurisdiction
1724
+
1725
+ */
1726
+
1498
1727
  tax_juris_name?:string;
1499
1728
 
1729
+ /**
1730
+ * @description The tax jurisdiction code
1731
+
1732
+ */
1733
+
1500
1734
  tax_juris_code?:string;
1501
1735
 
1736
+ /**
1737
+ * @description Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
1738
+
1739
+ */
1740
+
1502
1741
  tax_amount_in_local_currency?:number;
1503
1742
 
1743
+ /**
1744
+ * @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
1745
+
1746
+ */
1747
+
1504
1748
  local_currency_code?:string;
1505
1749
  }
1506
1750
  export interface LineItemTier {
1751
+ /**
1752
+ * @description Uniquely identifies a line_item
1753
+
1754
+ */
1755
+
1507
1756
  line_item_id?:string;
1508
1757
 
1509
- starting_unit?:number;
1758
+ /**
1759
+ * @description The lower limit of a range of units for the tier
1760
+
1761
+ */
1762
+
1763
+ starting_unit:number;
1764
+
1765
+ /**
1766
+ * @description The upper limit of a range of units for the tier
1767
+
1768
+ */
1510
1769
 
1511
1770
  ending_unit?:number;
1512
1771
 
1513
- quantity_used?:number;
1772
+ /**
1773
+ * @description The number of units purchased in a range.
1774
+
1775
+ */
1776
+
1777
+ quantity_used:number;
1778
+
1779
+ /**
1780
+ * @description The price of the tier if the charge model is a &#x60;stairtstep&#x60; pricing , or the price of each unit in the tier if the charge model is &#x60;tiered&#x60;/&#x60;volume&#x60; pricing.
1781
+
1782
+ */
1783
+
1784
+ unit_amount:number;
1514
1785
 
1515
- unit_amount?:number;
1786
+ /**
1787
+ * @description The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as &#x60;ending_unit_in_decimal&#x60; of the next lower tier. Returned only when the &#x60;line_items.pricing_model&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1788
+
1789
+ */
1516
1790
 
1517
1791
  starting_unit_in_decimal?:string;
1518
1792
 
1793
+ /**
1794
+ * @description The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the &#x60;starting_unit_in_decimal&#x60; of the next higher tier. Returned only when the &#x60;line_items.pricing_model&#x60; is &#x60;tiered&#x60;, &#x60;volume&#x60; or stairstep and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1795
+
1796
+ */
1797
+
1519
1798
  ending_unit_in_decimal?:string;
1520
1799
 
1800
+ /**
1801
+ * @description The decimal representation of the quantity purchased from this tier. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1802
+
1803
+ */
1804
+
1521
1805
  quantity_used_in_decimal?:string;
1522
1806
 
1807
+ /**
1808
+ * @description The decimal representation of the per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. When the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;, it is the decimal representation of the total price for &#x60;line_item&#x60;. The value is in major units of the currency. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
1809
+
1810
+ */
1811
+
1523
1812
  unit_amount_in_decimal?:string;
1524
1813
  }
1525
1814
  export interface ShippingAddress {
@@ -1633,7 +1922,7 @@ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021
1633
1922
 
1634
1923
  */
1635
1924
 
1636
- index?:number;
1925
+ index:number;
1637
1926
  }
1638
1927
  export interface BillingAddress {
1639
1928
  /**