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.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
- package/.github/ISSUE_TEMPLATE/config.yml +6 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- package/.github/workflows/greeting.yml +47 -0
- package/CHANGELOG.md +47 -0
- package/SECURITY.md +8 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +0 -7
- package/package.json +1 -1
- package/types/core.d.ts +4 -4
- package/types/resources/AttachedItem.d.ts +88 -88
- package/types/resources/Card.d.ts +68 -68
- package/types/resources/Comment.d.ts +50 -44
- package/types/resources/Coupon.d.ts +242 -207
- package/types/resources/CouponSet.d.ts +72 -68
- package/types/resources/CreditNote.d.ts +612 -236
- package/types/resources/Customer.d.ts +655 -513
- package/types/resources/DifferentialPrice.d.ts +99 -74
- package/types/resources/EntitlementOverride.d.ts +27 -12
- package/types/resources/Estimate.d.ts +450 -450
- package/types/resources/Event.d.ts +30 -12
- package/types/resources/Export.d.ts +200 -200
- package/types/resources/Feature.d.ts +66 -35
- package/types/resources/Gift.d.ts +54 -44
- package/types/resources/HostedPage.d.ts +381 -381
- package/types/resources/InAppSubscription.d.ts +94 -90
- package/types/resources/Invoice.d.ts +1242 -660
- package/types/resources/Item.d.ts +148 -142
- package/types/resources/ItemEntitlement.d.ts +36 -36
- package/types/resources/ItemFamily.d.ts +45 -45
- package/types/resources/ItemPrice.d.ts +317 -273
- package/types/resources/PaymentIntent.d.ts +60 -60
- package/types/resources/PaymentVoucher.d.ts +74 -59
- package/types/resources/PortalSession.d.ts +45 -20
- package/types/resources/PromotionalCredit.d.ts +68 -68
- package/types/resources/Purchase.d.ts +3 -3
- package/types/resources/Quote.d.ts +652 -363
- package/types/resources/QuoteLineGroup.d.ts +245 -0
- package/types/resources/QuotedCharge.d.ts +170 -0
- package/types/resources/QuotedSubscription.d.ts +219 -0
- package/types/resources/SiteMigrationDetail.d.ts +7 -7
- package/types/resources/Subscription.d.ts +1219 -932
- package/types/resources/SubscriptionEntitlement.d.ts +33 -12
- package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
- package/types/resources/TimeMachine.d.ts +15 -15
- package/types/resources/Token.d.ts +23 -23
- package/types/resources/Transaction.d.ts +229 -112
- package/types/resources/UnbilledCharge.d.ts +112 -67
- package/types/resources/Usage.d.ts +46 -47
- 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 'number' specified in the url.
|
|
287
280
|
|
|
@@ -290,18 +283,18 @@ Ireland** . The first two characters of the VAT number in such a case is `X
|
|
|
290
283
|
retrieve(quote_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
291
284
|
|
|
292
285
|
/**
|
|
293
|
-
* @description
|
|
286
|
+
* @description Create a quote for new subscription line items of a customer.
|
|
294
287
|
|
|
295
288
|
*/
|
|
296
289
|
|
|
297
|
-
|
|
290
|
+
create_sub_items_for_customer_quote(customer_id:string, input?:CreateSubItemsForCustomerQuoteInputParam):ChargebeeRequest<CreateSubItemsForCustomerQuoteResponse>;
|
|
298
291
|
|
|
299
292
|
/**
|
|
300
|
-
* @description
|
|
293
|
+
* @description Changes the quote produced for creating a new subscription items
|
|
301
294
|
|
|
302
295
|
*/
|
|
303
296
|
|
|
304
|
-
|
|
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 `X
|
|
|
311
304
|
update_subscription_quote_for_items(input?:UpdateSubscriptionQuoteForItemsInputParam):ChargebeeRequest<UpdateSubscriptionQuoteForItemsResponse>;
|
|
312
305
|
|
|
313
306
|
/**
|
|
314
|
-
* @description
|
|
307
|
+
* @description Changes the quote produced for updating the subscription items.
|
|
315
308
|
|
|
316
309
|
*/
|
|
317
310
|
|
|
318
|
-
|
|
311
|
+
edit_update_subscription_quote_for_items(quote_id:string, input?:EditUpdateSubscriptionQuoteForItemsInputParam):ChargebeeRequest<EditUpdateSubscriptionQuoteForItemsResponse>;
|
|
319
312
|
|
|
320
313
|
/**
|
|
321
|
-
* @description
|
|
314
|
+
* @description Creates a quote using charge-items and one-time charges.
|
|
322
315
|
|
|
323
316
|
*/
|
|
324
317
|
|
|
325
|
-
|
|
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 `X
|
|
|
332
325
|
edit_for_charge_items_and_charges(quote_id:string, input?:EditForChargeItemsAndChargesInputParam):ChargebeeRequest<EditForChargeItemsAndChargesResponse>;
|
|
333
326
|
|
|
334
327
|
/**
|
|
335
|
-
* @description
|
|
328
|
+
* @description List all quotes.
|
|
336
329
|
|
|
337
330
|
*/
|
|
338
331
|
|
|
339
|
-
|
|
332
|
+
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
340
333
|
|
|
341
334
|
/**
|
|
342
|
-
* @description
|
|
335
|
+
* @description This API retrieves all the quote line groups and lineitems for a quote.
|
|
343
336
|
|
|
344
337
|
*/
|
|
345
338
|
|
|
346
|
-
|
|
339
|
+
quote_line_groups_for_quote(quote_id:string, input?:QuoteLineGroupsForQuoteInputParam):ChargebeeRequest<QuoteLineGroupsForQuoteResponse>;
|
|
347
340
|
|
|
348
341
|
/**
|
|
349
|
-
* @description
|
|
342
|
+
* @description This API is to convert a quote to an invoice.
|
|
350
343
|
|
|
351
344
|
*/
|
|
352
345
|
|
|
353
|
-
|
|
346
|
+
convert(quote_id:string, input?:ConvertInputParam):ChargebeeRequest<ConvertResponse>;
|
|
354
347
|
|
|
355
348
|
/**
|
|
356
|
-
* @description
|
|
349
|
+
* @description Updates the status of the quote. Status can be updated to Accepted, Declined, and Closed.
|
|
357
350
|
|
|
358
351
|
*/
|
|
359
352
|
|
|
360
|
-
|
|
353
|
+
update_status(quote_id:string, input:UpdateStatusInputParam):ChargebeeRequest<UpdateStatusResponse>;
|
|
361
354
|
|
|
362
355
|
/**
|
|
363
|
-
* @description
|
|
356
|
+
* @description Can be used to extend the expiry date of a quote.
|
|
364
357
|
|
|
365
358
|
*/
|
|
366
359
|
|
|
367
|
-
|
|
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 `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 `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 `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 `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 \`offset\` to the value of \`next_offset\` 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 'One Time' 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 `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
|
|
958
|
+
export interface CreateForChargeItemsAndChargesResponse {
|
|
959
|
+
quote:Quote;
|
|
960
|
+
|
|
961
|
+
quoted_charge?:QuotedCharge;
|
|
962
|
+
}
|
|
963
|
+
export interface CreateForChargeItemsAndChargesInputParam {
|
|
964
|
+
|
|
1113
965
|
/**
|
|
1114
|
-
* @description
|
|
966
|
+
* @description The quote name will be used as the pdf name of the quote.
|
|
1115
967
|
|
|
1116
968
|
*/
|
|
1117
969
|
|
|
1118
|
-
|
|
970
|
+
name?:string;
|
|
1119
971
|
|
|
1120
972
|
/**
|
|
1121
|
-
* @description
|
|
973
|
+
* @description Identifier of the customer for which the quote needs to be created.
|
|
1122
974
|
|
|
1123
975
|
*/
|
|
1124
976
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
export interface ListInputParam {
|
|
1128
|
-
[key : string]: any;
|
|
977
|
+
customer_id:string;
|
|
978
|
+
|
|
1129
979
|
/**
|
|
1130
|
-
* @description
|
|
980
|
+
* @description Purchase Order Number for this quote.
|
|
1131
981
|
|
|
1132
982
|
*/
|
|
1133
|
-
|
|
1134
|
-
|
|
983
|
+
|
|
984
|
+
po_number?:string;
|
|
1135
985
|
|
|
1136
986
|
/**
|
|
1137
|
-
* @description
|
|
987
|
+
* @description Notes specific to this quote that you want customers to see on the quote PDF.
|
|
1138
988
|
|
|
1139
989
|
*/
|
|
1140
|
-
|
|
1141
|
-
|
|
990
|
+
|
|
991
|
+
notes?:string;
|
|
1142
992
|
|
|
1143
993
|
/**
|
|
1144
|
-
* @description
|
|
994
|
+
* @description Quotes will be vaild till this date. After this quote will be marked as closed.
|
|
1145
995
|
|
|
1146
996
|
*/
|
|
1147
|
-
|
|
1148
|
-
|
|
997
|
+
|
|
998
|
+
expires_at?:number;
|
|
1149
999
|
|
|
1150
1000
|
/**
|
|
1151
|
-
* @description The
|
|
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
|
|
1008
|
+
* @description The 'One Time' 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
|
|
1015
|
+
* @description List of Coupons to be added.
|
|
1207
1016
|
|
|
1208
1017
|
*/
|
|
1209
1018
|
|
|
1210
|
-
|
|
1019
|
+
coupon_ids?:string[];
|
|
1211
1020
|
|
|
1212
1021
|
/**
|
|
1213
|
-
* @description
|
|
1022
|
+
* @description Parameters for shipping_address
|
|
1214
1023
|
|
|
1215
1024
|
*/
|
|
1216
1025
|
|
|
1217
|
-
|
|
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
|
|
1240
|
-
|
|
1241
|
-
* `invoice_date` must be in the past.
|
|
1242
|
-
* `invoice_date` is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
|
|
1243
|
-
* The date is not earlier than `quoted_subscription.start_date` or `quoted_subscription.changes_scheduled_at` (whichever is applicable).
|
|
1244
|
-
* `invoice_immediately` must be `true`.
|
|
1245
|
-
.
|
|
1029
|
+
* @description Parameters for item_prices
|
|
1246
1030
|
|
|
1247
1031
|
*/
|
|
1248
1032
|
|
|
1249
|
-
|
|
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
|
|
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 `pending`, pass `first_invoice_pending` as `true`.
|
|
1261
|
-
.
|
|
1036
|
+
* @description Parameters for item_tiers
|
|
1262
1037
|
|
|
1263
1038
|
*/
|
|
1264
1039
|
|
|
1265
|
-
|
|
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
|
|
1269
|
-
|
|
1270
|
-
By passing this parameter as `true`, you create the first invoice as `pending` allowing you to add the previous term'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 `pending` 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=2#close_a_pending_invoice).
|
|
1271
|
-
**Note:**
|
|
1272
|
-
|
|
1273
|
-
This parameter is passed only when there are metered items in the subscription or when `create_pending_invoices` is `true`.
|
|
1274
|
-
.
|
|
1043
|
+
* @description Parameters for charges
|
|
1275
1044
|
|
|
1276
1045
|
*/
|
|
1277
1046
|
|
|
1278
|
-
|
|
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
|
|
1050
|
+
* @description Parameters for discounts
|
|
1282
1051
|
|
|
1283
1052
|
*/
|
|
1284
1053
|
|
|
1285
|
-
|
|
1054
|
+
discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
|
|
1286
1055
|
}
|
|
1287
|
-
export interface
|
|
1056
|
+
export interface EditForChargeItemsAndChargesResponse {
|
|
1288
1057
|
quote:Quote;
|
|
1289
1058
|
|
|
1290
1059
|
quoted_charge?:QuotedCharge;
|
|
1291
1060
|
}
|
|
1292
|
-
export interface
|
|
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
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1140
|
+
export interface ListResponse {
|
|
1141
|
+
/**
|
|
1142
|
+
* @description List all quotes.
|
|
1143
|
+
|
|
1144
|
+
*/
|
|
1389
1145
|
|
|
1390
|
-
|
|
1391
|
-
}
|
|
1392
|
-
export interface DeleteInputParam {
|
|
1146
|
+
list:{quote:Quote,quoted_subscription?:QuotedSubscription}[];
|
|
1393
1147
|
|
|
1394
1148
|
/**
|
|
1395
|
-
* @description
|
|
1149
|
+
* @description List all quotes.
|
|
1396
1150
|
|
|
1397
1151
|
*/
|
|
1398
1152
|
|
|
1399
|
-
|
|
1153
|
+
next_offset?:string;
|
|
1400
1154
|
}
|
|
1401
|
-
export interface
|
|
1402
|
-
|
|
1155
|
+
export interface ListInputParam {
|
|
1156
|
+
[key : string]: any;
|
|
1157
|
+
/**
|
|
1158
|
+
* @description List all quotes.
|
|
1159
|
+
|
|
1160
|
+
*/
|
|
1161
|
+
|
|
1162
|
+
limit?:number;
|
|
1403
1163
|
|
|
1404
|
-
|
|
1164
|
+
/**
|
|
1165
|
+
* @description List all quotes.
|
|
1166
|
+
|
|
1167
|
+
*/
|
|
1168
|
+
|
|
1169
|
+
offset?:string;
|
|
1405
1170
|
|
|
1406
|
-
|
|
1171
|
+
/**
|
|
1172
|
+
* @description List all quotes.
|
|
1173
|
+
|
|
1174
|
+
*/
|
|
1175
|
+
|
|
1176
|
+
include_deleted?:boolean;
|
|
1407
1177
|
|
|
1408
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1206
|
+
/**
|
|
1207
|
+
* @description List all quotes.
|
|
1208
|
+
|
|
1209
|
+
*/
|
|
1210
|
+
|
|
1211
|
+
date?:{after?:string,before?:string,between?:string,on?:string};
|
|
1417
1212
|
|
|
1418
|
-
|
|
1213
|
+
/**
|
|
1214
|
+
* @description List all quotes.
|
|
1215
|
+
|
|
1216
|
+
*/
|
|
1217
|
+
|
|
1218
|
+
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
1419
1219
|
|
|
1420
|
-
|
|
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
|
-
|
|
1233
|
+
list:{quote_line_group:QuoteLineGroup}[];
|
|
1423
1234
|
|
|
1424
|
-
|
|
1235
|
+
/**
|
|
1236
|
+
* @description This API retrieves all the quote line groups and lineitems for a quote.
|
|
1237
|
+
|
|
1238
|
+
*/
|
|
1425
1239
|
|
|
1426
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1261
|
+
quoted_subscription?:QuotedSubscription;
|
|
1431
1262
|
|
|
1432
|
-
|
|
1263
|
+
quoted_charge?:QuotedCharge;
|
|
1433
1264
|
|
|
1434
|
-
|
|
1265
|
+
customer:Customer;
|
|
1435
1266
|
|
|
1436
|
-
|
|
1267
|
+
subscription?:Subscription;
|
|
1437
1268
|
|
|
1438
|
-
|
|
1269
|
+
invoice?:Invoice;
|
|
1439
1270
|
|
|
1440
|
-
|
|
1271
|
+
credit_note?:CreditNote;
|
|
1441
1272
|
|
|
1442
|
-
|
|
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 `pending`, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of `invoice_date`. When passing this parameter, the following prerequisites must be met:
|
|
1279
|
+
|
|
1280
|
+
* `invoice_date` must be in the past.
|
|
1281
|
+
* `invoice_date` is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
|
|
1282
|
+
* The date is not earlier than `quoted_subscription.start_date` or `quoted_subscription.changes_scheduled_at` (whichever is applicable).
|
|
1283
|
+
* `invoice_immediately` must be `true`.
|
|
1284
|
+
.
|
|
1285
|
+
|
|
1286
|
+
*/
|
|
1287
|
+
|
|
1288
|
+
invoice_date?:number;
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* @description This attribute is set to `true` automatically for the subscription when it has one or more `metered` items. However, when there are no `metered` items, you can pass this parameter as `true` to force all invoices (except the first) to be created as `pending`. 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 `pending`, pass `first_invoice_pending` as `true`.
|
|
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 `true`, you create the first invoice as `pending` allowing you to add the previous term'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 `pending` 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=2#close_a_pending_invoice).
|
|
1310
|
+
**Note:**
|
|
1311
|
+
|
|
1312
|
+
This parameter is passed only when there are metered items in the subscription or when `create_pending_invoices` is `true`.
|
|
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=2#invoice_line_items_quantity) which is represented by this line item. For `metered` line items, this value is updated from [usages](/docs/api/usages) once when the invoice is generated as `pending` 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 `line_item`. The value is in major units of the currency. Returned when the `line_item` 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 `line_item` 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 `line_item`, in major units of the currency. Typically equals to `unit_amount_in_decimal` x `quantity_in_decimal`. 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 'Addon' entity. The 'entity_id' 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 'entity_id' attribute will be null in this case \* plan_setup - Indicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the [plan](/docs/api/plans#plan_attributes) id \* plan - Indicates that this lineitem is based on 'Plan' entity. The 'entity_id' 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's region. This is also the reason code when both `billing_address` and `shipping_address` 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 'adhoc' 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
|
-
|
|
1563
|
+
/**
|
|
1564
|
+
* @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver=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 `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon`.
|
|
1579
|
+
|
|
1580
|
+
*/
|
|
1581
|
+
|
|
1453
1582
|
line_item_id?:string;
|
|
1454
1583
|
|
|
1455
|
-
|
|
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 `sub_total`. The coupon id is passed as `entity_id`. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver=2#invoice_adjustment_credit_notes). \* item_level_coupon - The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id`. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to a line item of the invoice. The discount `id` is available as the `entity_id`. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits?prod_cat_ver=2) applied to the invoice. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
|
|
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 `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon`, `document_level_discount`, or `document_level_coupon` \* 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 `coupon` or a [discount](discounts), then this is the `id` 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 `entity_id`.
|
|
1607
|
+
|
|
1608
|
+
*/
|
|
1609
|
+
|
|
1461
1610
|
coupon_set_code?:string;
|
|
1462
1611
|
}
|
|
1463
1612
|
export interface LineItemDiscount {
|
|
1464
|
-
|
|
1613
|
+
/**
|
|
1614
|
+
* @description The unique id of the line item that this deduction is for.
|
|
1615
|
+
|
|
1616
|
+
*/
|
|
1465
1617
|
|
|
1466
|
-
|
|
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 `id` is available as `entity_id`. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver=2#invoice_adjustment_credit_notes). \* document_level_coupon - The deduction is due to a coupon applied to the invoice `sub_total`. The coupon `id` is available as `entity_id`. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to a line item of the invoice. The discount `id` is available as the `entity_id`. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice. The `entity_id` is `null` 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 `coupon` or a [discount](discounts), then this is the `id` of the coupon or discount.
|
|
1631
|
+
|
|
1632
|
+
*/
|
|
1633
|
+
|
|
1470
1634
|
entity_id?:string;
|
|
1471
1635
|
|
|
1472
|
-
|
|
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
|
-
|
|
1644
|
+
/**
|
|
1645
|
+
* @description The name of the tax applied. E.g. GST.
|
|
1646
|
+
|
|
1647
|
+
*/
|
|
1476
1648
|
|
|
1477
|
-
|
|
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
|
-
|
|
1673
|
+
/**
|
|
1674
|
+
* @description The name of the tax applied
|
|
1675
|
+
|
|
1676
|
+
*/
|
|
1677
|
+
|
|
1678
|
+
tax_name:string;
|
|
1485
1679
|
|
|
1486
|
-
|
|
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
|
-
|
|
1701
|
+
/**
|
|
1702
|
+
* @description Indicates the actual portion of the line item amount that is taxable.
|
|
1703
|
+
|
|
1704
|
+
*/
|
|
1493
1705
|
|
|
1494
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 `stairtstep` pricing , or the price of each unit in the tier if the charge model is `tiered`/`volume` pricing.
|
|
1781
|
+
|
|
1782
|
+
*/
|
|
1783
|
+
|
|
1784
|
+
unit_amount:number;
|
|
1514
1785
|
|
|
1515
|
-
|
|
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 `ending_unit_in_decimal` of the next lower tier. Returned only when the `line_items.pricing_model` is `tiered`, `volume` or `stairstep` 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 `starting_unit_in_decimal` of the next higher tier. Returned only when the `line_items.pricing_model` is `tiered`, `volume` 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 `line_item` 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 `pricing_model` is `tiered` or `volume`. When the `pricing_model` is `stairstep`, it is the decimal representation of the total price for `line_item`. The value is in major units of the currency. Returned when the `line_item` 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
|
|
1925
|
+
index:number;
|
|
1637
1926
|
}
|
|
1638
1927
|
export interface BillingAddress {
|
|
1639
1928
|
/**
|