chargebee 2.26.1 → 2.28.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/CHANGELOG.md +40 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +8 -1
- package/package.json +1 -1
- package/types/resources/Address.d.ts +0 -10
- package/types/resources/AttachedItem.d.ts +0 -20
- package/types/resources/Card.d.ts +0 -110
- package/types/resources/Comment.d.ts +0 -17
- package/types/resources/Coupon.d.ts +0 -37
- package/types/resources/CouponCode.d.ts +0 -10
- package/types/resources/CouponSet.d.ts +0 -30
- package/types/resources/CreditNote.d.ts +0 -102
- package/types/resources/Customer.d.ts +0 -313
- package/types/resources/DifferentialPrice.d.ts +0 -20
- package/types/resources/Estimate.d.ts +0 -160
- package/types/resources/Event.d.ts +0 -7
- package/types/resources/Export.d.ts +0 -81
- package/types/resources/Feature.d.ts +0 -69
- package/types/resources/Gift.d.ts +0 -55
- package/types/resources/HostedPage.d.ts +0 -166
- package/types/resources/InAppSubscription.d.ts +0 -267
- package/types/resources/Invoice.d.ts +0 -350
- package/types/resources/Item.d.ts +0 -20
- package/types/resources/ItemEntitlement.d.ts +0 -10
- package/types/resources/ItemFamily.d.ts +0 -20
- package/types/resources/ItemPrice.d.ts +0 -20
- package/types/resources/NonSubscription.d.ts +0 -5
- package/types/resources/Order.d.ts +0 -52
- package/types/resources/PaymentIntent.d.ts +0 -25
- package/types/resources/PaymentSource.d.ts +0 -275
- package/types/resources/PaymentVoucher.d.ts +0 -10
- package/types/resources/PortalSession.d.ts +0 -33
- package/types/resources/PromotionalCredit.d.ts +0 -51
- package/types/resources/Purchase.d.ts +0 -68
- package/types/resources/Quote.d.ts +0 -165
- package/types/resources/ResourceMigration.d.ts +0 -5
- package/types/resources/Subscription.d.ts +103 -1001
- package/types/resources/TimeMachine.d.ts +0 -17
- package/types/resources/Token.d.ts +0 -15
- package/types/resources/Transaction.d.ts +0 -30
- package/types/resources/UnbilledCharge.d.ts +0 -46
- package/types/resources/Usage.d.ts +0 -22
- package/types/resources/VirtualBankAccount.d.ts +0 -35
|
@@ -764,11 +764,6 @@ If the order of precendence described above does not work for your use case, and
|
|
|
764
764
|
download_einvoice(invoice_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
|
|
765
765
|
}
|
|
766
766
|
export interface DeleteLineItemsResponse {
|
|
767
|
-
/**
|
|
768
|
-
* @description This endpoint is used to delete line items from "Pending" invoice.
|
|
769
|
-
|
|
770
|
-
*/
|
|
771
|
-
|
|
772
767
|
invoice:Invoice;
|
|
773
768
|
}
|
|
774
769
|
export interface DeleteLineItemsInputParam {
|
|
@@ -781,22 +776,8 @@ If the order of precendence described above does not work for your use case, and
|
|
|
781
776
|
line_items?:{id?:string}[];
|
|
782
777
|
}
|
|
783
778
|
export interface RemoveCreditNoteResponse {
|
|
784
|
-
/**
|
|
785
|
-
* @description This API removes a credit note attached to an invoice. When you remove a credit note from an invoice, the invoice status returns to `not_paid`.
|
|
786
|
-
|
|
787
|
-
**Note:** You cannot remove a credit note from an invoice if it has already been refunded.
|
|
788
|
-
|
|
789
|
-
*/
|
|
790
|
-
|
|
791
779
|
invoice:Invoice;
|
|
792
780
|
|
|
793
|
-
/**
|
|
794
|
-
* @description This API removes a credit note attached to an invoice. When you remove a credit note from an invoice, the invoice status returns to `not_paid`.
|
|
795
|
-
|
|
796
|
-
**Note:** You cannot remove a credit note from an invoice if it has already been refunded.
|
|
797
|
-
|
|
798
|
-
*/
|
|
799
|
-
|
|
800
781
|
credit_note:CreditNote;
|
|
801
782
|
}
|
|
802
783
|
export interface RemoveCreditNoteInputParam {
|
|
@@ -809,18 +790,8 @@ If the order of precendence described above does not work for your use case, and
|
|
|
809
790
|
credit_note?:{id:string};
|
|
810
791
|
}
|
|
811
792
|
export interface RemovePaymentResponse {
|
|
812
|
-
/**
|
|
813
|
-
* @description This API [removes payments](https://www.chargebee.com/docs/2.0/invoice-operations.html#actions-for-paid-invoices_remove-payment) applied to an invoice. Once the applied payment is removed, the invoice status returns to `not_paid` or `payment_due`. The removed payment is then added to the customer's excess payment balance.
|
|
814
|
-
|
|
815
|
-
*/
|
|
816
|
-
|
|
817
793
|
invoice:Invoice;
|
|
818
794
|
|
|
819
|
-
/**
|
|
820
|
-
* @description This API [removes payments](https://www.chargebee.com/docs/2.0/invoice-operations.html#actions-for-paid-invoices_remove-payment) applied to an invoice. Once the applied payment is removed, the invoice status returns to `not_paid` or `payment_due`. The removed payment is then added to the customer's excess payment balance.
|
|
821
|
-
|
|
822
|
-
*/
|
|
823
|
-
|
|
824
795
|
transaction:Transaction;
|
|
825
796
|
}
|
|
826
797
|
export interface RemovePaymentInputParam {
|
|
@@ -833,11 +804,6 @@ If the order of precendence described above does not work for your use case, and
|
|
|
833
804
|
transaction?:{id:string};
|
|
834
805
|
}
|
|
835
806
|
export interface StopDunningResponse {
|
|
836
|
-
/**
|
|
837
|
-
* @description This API is used to stop dunning for "Payment Due" invoices that have been enabled for Auto Collection. When dunning is stopped, the status of the invoice will be changed to "Not Paid".
|
|
838
|
-
|
|
839
|
-
*/
|
|
840
|
-
|
|
841
807
|
invoice:Invoice;
|
|
842
808
|
}
|
|
843
809
|
export interface StopDunningInputParam {
|
|
@@ -850,13 +816,6 @@ If the order of precendence described above does not work for your use case, and
|
|
|
850
816
|
comment?:string;
|
|
851
817
|
}
|
|
852
818
|
export interface ApplyPaymentsResponse {
|
|
853
|
-
/**
|
|
854
|
-
* @description The API applies [excess payments](https://apidocs.chargebee.com/docs/api/customers#customer_excess_payments) to an invoice. Once an excess payment is applied, the [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice `status` changes to either `paid` or `payment_due` depending on how much excess payment is applied to the invoice amount.
|
|
855
|
-
|
|
856
|
-
For example, if you have an excess payment of $25.00, and the invoice to which you want to apply this excess payment has a balance of $50. Once you apply this excess payment, the invoice status changes to `paid`, and [invoice.amount_due](invoices#invoice_amount_due) is adjusted to $25.00.
|
|
857
|
-
|
|
858
|
-
*/
|
|
859
|
-
|
|
860
819
|
invoice:Invoice;
|
|
861
820
|
}
|
|
862
821
|
export interface ApplyPaymentsInputParam {
|
|
@@ -876,26 +835,8 @@ For example, if you have an excess payment of $25.00, and the invoice to which y
|
|
|
876
835
|
transactions?:{id?:string}[];
|
|
877
836
|
}
|
|
878
837
|
export interface VoidInvoiceResponse {
|
|
879
|
-
/**
|
|
880
|
-
* @description Voids the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before voiding it.
|
|
881
|
-
|
|
882
|
-
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
883
|
-
* If an invoice for the current term of a subscription is voided and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
884
|
-
* Any [usages](/docs/api/usages?prod_cat_ver=2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the `invoice_id` field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver=2#retrieve_usages_for_an_invoice_as_pdf) is generated and saved to the invoice as an [attachment](https://www.chargebee.com/docs/2.0/file-attachment.html).
|
|
885
|
-
|
|
886
|
-
*/
|
|
887
|
-
|
|
888
838
|
invoice:Invoice;
|
|
889
839
|
|
|
890
|
-
/**
|
|
891
|
-
* @description Voids the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before voiding it.
|
|
892
|
-
|
|
893
|
-
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
894
|
-
* If an invoice for the current term of a subscription is voided and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
895
|
-
* Any [usages](/docs/api/usages?prod_cat_ver=2) associated with item prices in the invoice are delinked from the invoice. This is done by clearing the `invoice_id` field of said usages. However, before this is done, a [usage PDF](/docs/api/usages?prod_cat_ver=2#retrieve_usages_for_an_invoice_as_pdf) is generated and saved to the invoice as an [attachment](https://www.chargebee.com/docs/2.0/file-attachment.html).
|
|
896
|
-
|
|
897
|
-
*/
|
|
898
|
-
|
|
899
840
|
credit_note?:CreditNote;
|
|
900
841
|
}
|
|
901
842
|
export interface VoidInvoiceInputParam {
|
|
@@ -915,11 +856,6 @@ For example, if you have an excess payment of $25.00, and the invoice to which y
|
|
|
915
856
|
void_reason_code?:string;
|
|
916
857
|
}
|
|
917
858
|
export interface AddChargeResponse {
|
|
918
|
-
/**
|
|
919
|
-
* @description Adds a one-time charge to a [pending](https://apidocs.chargebee.com/docs/api/invoices#invoice_status) invoice. A one-time charge is a charge that is added ad hoc to the invoice and does not represent a predefined [item price](https:/apidocs.chargebee.com/docs/api/item_prices). It appears in the invoice as a [line_item](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items) of [entity_type](https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=2&lang=curl#invoice_line_items_entity_type) `adhoc`.
|
|
920
|
-
|
|
921
|
-
*/
|
|
922
|
-
|
|
923
859
|
invoice:Invoice;
|
|
924
860
|
}
|
|
925
861
|
export interface AddChargeInputParam {
|
|
@@ -981,42 +917,12 @@ For example, if you have an excess payment of $25.00, and the invoice to which y
|
|
|
981
917
|
line_item?:{date_from?:number,date_to?:number};
|
|
982
918
|
}
|
|
983
919
|
export interface SendEinvoiceResponse {
|
|
984
|
-
/**
|
|
985
|
-
* @description This endpoint is used to send an e-invoice for invoice.
|
|
986
|
-
|
|
987
|
-
To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
|
|
988
|
-
|
|
989
|
-
This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
|
|
990
|
-
|
|
991
|
-
* If e-invoicing is not enabled at the site and customer level.
|
|
992
|
-
|
|
993
|
-
* If there is an e-invoice generated already for the invoice.
|
|
994
|
-
|
|
995
|
-
* If the "**Use automatic e-invoicing**" option is selected.
|
|
996
|
-
|
|
997
|
-
* If there are no generated e-invoices with the `failed` or `skipped` status.
|
|
998
|
-
|
|
999
|
-
* If the invoice status is `voided` or `pending`.
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
*/
|
|
1003
|
-
|
|
1004
920
|
invoice:Invoice;
|
|
1005
921
|
}
|
|
1006
922
|
|
|
1007
923
|
export interface WriteOffResponse {
|
|
1008
|
-
/**
|
|
1009
|
-
* @description This API writes off an Invoice.
|
|
1010
|
-
|
|
1011
|
-
*/
|
|
1012
|
-
|
|
1013
924
|
invoice:Invoice;
|
|
1014
925
|
|
|
1015
|
-
/**
|
|
1016
|
-
* @description This API writes off an Invoice.
|
|
1017
|
-
|
|
1018
|
-
*/
|
|
1019
|
-
|
|
1020
926
|
credit_note:CreditNote;
|
|
1021
927
|
}
|
|
1022
928
|
export interface WriteOffInputParam {
|
|
@@ -1029,11 +935,6 @@ This endpoint schedules e-invoices manually. This operation is not allowed when
|
|
|
1029
935
|
comment?:string;
|
|
1030
936
|
}
|
|
1031
937
|
export interface AddChargeItemResponse {
|
|
1032
|
-
/**
|
|
1033
|
-
* @description This endpoint is used when [metered billing](https://www.chargebee.com/docs/2.0/metered_billing.html) is enabled and it adds a [charge-item price](./item_prices?prod_cat_ver=2) to a `pending` invoice. To collect the accumulated charges by closing the invoice, call [Close a pending invoice](./invoices?prod_cat_ver=2#close_a_pending_invoice).
|
|
1034
|
-
|
|
1035
|
-
*/
|
|
1036
|
-
|
|
1037
938
|
invoice:Invoice;
|
|
1038
939
|
}
|
|
1039
940
|
export interface AddChargeItemInputParam {
|
|
@@ -1253,15 +1154,6 @@ NOTE: Not to be used if *consolidated invoicing* is enabled.
|
|
|
1253
1154
|
einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
|
|
1254
1155
|
}
|
|
1255
1156
|
export interface CloseResponse {
|
|
1256
|
-
/**
|
|
1257
|
-
* @description Invoices for a subscription are created with a `pending` `status` when the subscription has `create_pending_invoices` attribute set to `true`. This API call finalizes a `pending` invoice. Any `refundable_credits` and `excess_payments` for the customer are applied to the invoice, and any payment due is collected automatically if `auto_collection` is `on` for the customer.
|
|
1258
|
-
|
|
1259
|
-
#### Automation
|
|
1260
|
-
|
|
1261
|
-
This operation can be automated by using a [site setting](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing). Moreover, the automation can be overridden at the [customer](/docs/api/customers?prod_cat_ver=2#customer_auto_close_invoices) and [subscription](/docs/api/subscriptions?prod_cat_ver=2#subscription_auto_close_invoices) level.
|
|
1262
|
-
|
|
1263
|
-
*/
|
|
1264
|
-
|
|
1265
1157
|
invoice:Invoice;
|
|
1266
1158
|
}
|
|
1267
1159
|
export interface CloseInputParam {
|
|
@@ -1302,11 +1194,6 @@ This operation can be automated by using a [site setting](https://www.chargebee.
|
|
|
1302
1194
|
notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
|
|
1303
1195
|
}
|
|
1304
1196
|
export interface ApplyCreditsResponse {
|
|
1305
|
-
/**
|
|
1306
|
-
* @description This API applies [available credits](customers#customer_balances) to an invoice. After credits are applied, [invoice.amount_due](invoices#invoice_amount_due) is recalculated. The invoice status changes to either `paid` or `payment_due` depending on how much credit is applied to the invoice amount.
|
|
1307
|
-
|
|
1308
|
-
*/
|
|
1309
|
-
|
|
1310
1197
|
invoice:Invoice;
|
|
1311
1198
|
}
|
|
1312
1199
|
export interface ApplyCreditsInputParam {
|
|
@@ -1326,20 +1213,10 @@ This operation can be automated by using a [site setting](https://www.chargebee.
|
|
|
1326
1213
|
credit_notes?:{id?:string}[];
|
|
1327
1214
|
}
|
|
1328
1215
|
export interface RetrieveResponse {
|
|
1329
|
-
/**
|
|
1330
|
-
* @description Retrieve the invoice for the specified invoice id.
|
|
1331
|
-
|
|
1332
|
-
*/
|
|
1333
|
-
|
|
1334
1216
|
invoice:Invoice;
|
|
1335
1217
|
}
|
|
1336
1218
|
|
|
1337
1219
|
export interface CreateForChargeItemsAndChargesResponse {
|
|
1338
|
-
/**
|
|
1339
|
-
* @description Creates an invoice for [charge-items](./items?prod_cat_ver=2) and [one-time charges](https://www.chargebee.com/docs/2.0/charges.html). The item prices must belong to items of `type` `charge`.
|
|
1340
|
-
|
|
1341
|
-
*/
|
|
1342
|
-
|
|
1343
1220
|
invoice:Invoice;
|
|
1344
1221
|
}
|
|
1345
1222
|
export interface CreateForChargeItemsAndChargesInputParam {
|
|
@@ -1521,13 +1398,6 @@ The invoice is [linked](/docs/api?prod_cat_ver=2#mbe-linked-be) to the same
|
|
|
1521
1398
|
discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
|
|
1522
1399
|
}
|
|
1523
1400
|
export interface UpdateDetailsResponse {
|
|
1524
|
-
/**
|
|
1525
|
-
* @description This API allows you to update the invoice Billing/Shipping address, VAT and PO number. During this operation if Billing Info (Billing Address, vat_number), Shipping info and PO number are not already present in the system the data will be added. If data is already present, the existing values will be replaced. If info is present in the system, but not passed as part of the request, the info will not be removed from the system.
|
|
1526
|
-
|
|
1527
|
-
**Note:** Incase, tax is already applied will now vary due to address change, you cannot update the address. You cannot update the VAT Number if the billing address is not present in the API request.This will update the invoice only, it won't change the corresponding customer/subscription details.
|
|
1528
|
-
|
|
1529
|
-
*/
|
|
1530
|
-
|
|
1531
1401
|
invoice:Invoice;
|
|
1532
1402
|
}
|
|
1533
1403
|
export interface UpdateDetailsInputParam {
|
|
@@ -1580,26 +1450,8 @@ Ireland** . The first two characters of the VAT number in such a case is `X
|
|
|
1580
1450
|
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};
|
|
1581
1451
|
}
|
|
1582
1452
|
export interface RecordPaymentResponse {
|
|
1583
|
-
/**
|
|
1584
|
-
* @description To record a [offline payment](https://www.chargebee.com/docs/offline_payments.html) for an invoice.
|
|
1585
|
-
|
|
1586
|
-
The invoice status will be marked as 'paid' if its amount due becomes 0 because of this recorded payment.
|
|
1587
|
-
|
|
1588
|
-
**Note:** If the payment transaction amount is more than the invoice due amount, the remaining transaction amount will be added to the customer's Excess Payments balance to be used against other invoices.
|
|
1589
|
-
|
|
1590
|
-
*/
|
|
1591
|
-
|
|
1592
1453
|
invoice:Invoice;
|
|
1593
1454
|
|
|
1594
|
-
/**
|
|
1595
|
-
* @description To record a [offline payment](https://www.chargebee.com/docs/offline_payments.html) for an invoice.
|
|
1596
|
-
|
|
1597
|
-
The invoice status will be marked as 'paid' if its amount due becomes 0 because of this recorded payment.
|
|
1598
|
-
|
|
1599
|
-
**Note:** If the payment transaction amount is more than the invoice due amount, the remaining transaction amount will be added to the customer's Excess Payments balance to be used against other invoices.
|
|
1600
|
-
|
|
1601
|
-
*/
|
|
1602
|
-
|
|
1603
1455
|
transaction:Transaction;
|
|
1604
1456
|
}
|
|
1605
1457
|
export interface RecordPaymentInputParam {
|
|
@@ -1619,17 +1471,6 @@ The invoice status will be marked as 'paid' if its amount due becomes
|
|
|
1619
1471
|
transaction?:{amount?:number,date?:number,error_code?:string,error_text?:string,id_at_gateway?:string,payment_method:PaymentMethod,reference_number?:string,status?:'success' | 'failure'};
|
|
1620
1472
|
}
|
|
1621
1473
|
export interface DeleteResponse {
|
|
1622
|
-
/**
|
|
1623
|
-
* @description Deletes the specified invoice. Any payments must be [removed](/docs/api/invoices?prod_cat_ver=2#remove_payment_from_an_invoice) from the invoice before deleting it.
|
|
1624
|
-
**Caution**
|
|
1625
|
-
|
|
1626
|
-
All associated [usages](/docs/api/usages?prod_cat_ver=2) are permanently deleted on deleting an invoice. If you want to regenerate such an invoice, [add](/docs/api/usages?prod_cat_ver=2#create_a_usage) or [bulk import](https://www.chargebee.com/docs/2.0/bulk-operations.html#overview_available-bulk-operations) usages before invoice regeneration.
|
|
1627
|
-
|
|
1628
|
-
* Any [promotional credits](/docs/api/promotional_credits?prod_cat_ver=2) or [credit notes](/docs/api/credit_notes?prod_cat_ver=2) applied to the invoice are removed.
|
|
1629
|
-
* If an invoice for the current term of a subscription is deleted and the subscription is changed later with `proration` enabled, no prorated credits are issued.
|
|
1630
|
-
|
|
1631
|
-
*/
|
|
1632
|
-
|
|
1633
1474
|
invoice:Invoice;
|
|
1634
1475
|
}
|
|
1635
1476
|
export interface DeleteInputParam {
|
|
@@ -1649,18 +1490,8 @@ All associated [usages](/docs/api/usages?prod_cat_ver=2) are permanently de
|
|
|
1649
1490
|
claim_credits?:boolean;
|
|
1650
1491
|
}
|
|
1651
1492
|
export interface ImportInvoiceResponse {
|
|
1652
|
-
/**
|
|
1653
|
-
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1654
|
-
|
|
1655
|
-
*/
|
|
1656
|
-
|
|
1657
1493
|
invoice:Invoice;
|
|
1658
1494
|
|
|
1659
|
-
/**
|
|
1660
|
-
* @description Use this endpoint to import invoices that are created outside of Chargebee; for example, import invoices created with a commercial accounting software to Chargebee. This allows you to conveniently manage invoices in one place.
|
|
1661
|
-
|
|
1662
|
-
*/
|
|
1663
|
-
|
|
1664
1495
|
credit_note?:CreditNote;
|
|
1665
1496
|
}
|
|
1666
1497
|
export interface ImportInvoiceInputParam {
|
|
@@ -1897,16 +1728,6 @@ The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to b
|
|
|
1897
1728
|
notes?:{entity_id?:string,entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price',note?:string}[];
|
|
1898
1729
|
}
|
|
1899
1730
|
export interface RecordTaxWithheldResponse {
|
|
1900
|
-
/**
|
|
1901
|
-
* @description Records [tax_withheld](/docs/api/tax_withheld) by the customer against the invoice specified. This operation is allowed only when all of the following conditions are true:
|
|
1902
|
-
|
|
1903
|
-
* Tax Amount Withheld is enabled.
|
|
1904
|
-
* The `invoice` does not have a `linked_taxes_withheld` record associated with it already.
|
|
1905
|
-
* `invoice.amount_due` is greater than zero.
|
|
1906
|
-
* `invoice.status` is one of the following: `payment_due`, `not_paid`, or `posted`.
|
|
1907
|
-
|
|
1908
|
-
*/
|
|
1909
|
-
|
|
1910
1731
|
invoice:Invoice;
|
|
1911
1732
|
}
|
|
1912
1733
|
export interface RecordTaxWithheldInputParam {
|
|
@@ -1919,24 +1740,10 @@ The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to b
|
|
|
1919
1740
|
tax_withheld?:{amount:number,date?:number,description?:string,reference_number?:string};
|
|
1920
1741
|
}
|
|
1921
1742
|
export interface ResendEinvoiceResponse {
|
|
1922
|
-
/**
|
|
1923
|
-
* @description Resend failed einvoice of an invoice to the customer using this API.
|
|
1924
|
-
|
|
1925
|
-
*/
|
|
1926
|
-
|
|
1927
1743
|
invoice:Invoice;
|
|
1928
1744
|
}
|
|
1929
1745
|
|
|
1930
1746
|
export interface RemoveTaxWithheldResponse {
|
|
1931
|
-
/**
|
|
1932
|
-
* @description Removes a [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld) record from the `invoice` specified. This operation is allowed only when all of the following conditions are true:
|
|
1933
|
-
|
|
1934
|
-
* [invoice.status](/docs/api/invoices#invoice_status) is one of the following: `payment_due`, `not_paid`, or `posted`.
|
|
1935
|
-
* There are no [adjustment_credit_notes](/docs/api/invoices#invoice_adjustment_credit_notes) associated with the invoice.
|
|
1936
|
-
* There are no [issued_credit_notes](/docs/api/invoices#invoice_issued_credit_notes) associated with the invoice.
|
|
1937
|
-
|
|
1938
|
-
*/
|
|
1939
|
-
|
|
1940
1747
|
invoice:Invoice;
|
|
1941
1748
|
}
|
|
1942
1749
|
export interface RemoveTaxWithheldInputParam {
|
|
@@ -1995,26 +1802,8 @@ The [invoice](/docs/api/invoices?prod_cat_ver=1#invoice_status) is yet to b
|
|
|
1995
1802
|
payment_reference_number?:{number?:{in?:string,is?:string}};
|
|
1996
1803
|
}
|
|
1997
1804
|
export interface CollectPaymentResponse {
|
|
1998
|
-
/**
|
|
1999
|
-
* @description Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
|
|
2000
|
-
|
|
2001
|
-
This API is used to collect payments for `payment_due` and `not_paid` invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
|
|
2002
|
-
|
|
2003
|
-
Pass `authorization_transaction_id` to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as `payment_due`.
|
|
2004
|
-
|
|
2005
|
-
*/
|
|
2006
|
-
|
|
2007
1805
|
invoice:Invoice;
|
|
2008
1806
|
|
|
2009
|
-
/**
|
|
2010
|
-
* @description Storing card after successful 3DS completion is not supported in this API. Use [create using Payment Intent API](/docs/api/payment_sources#create_using_payment_intent) under Payment source to store the card after successful 3DS flow completion.
|
|
2011
|
-
|
|
2012
|
-
This API is used to collect payments for `payment_due` and `not_paid` invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown.
|
|
2013
|
-
|
|
2014
|
-
Pass `authorization_transaction_id` to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as `payment_due`.
|
|
2015
|
-
|
|
2016
|
-
*/
|
|
2017
|
-
|
|
2018
1807
|
transaction:Transaction;
|
|
2019
1808
|
}
|
|
2020
1809
|
export interface CollectPaymentInputParam {
|
|
@@ -2055,51 +1844,14 @@ Pass `authorization_transaction_id` to capture the already blocked fun
|
|
|
2055
1844
|
payment_initiator?:PaymentInitiator;
|
|
2056
1845
|
}
|
|
2057
1846
|
export interface SyncUsagesResponse {
|
|
2058
|
-
/**
|
|
2059
|
-
* @description Updates the [`quantity`](/docs/api/invoices#invoice_line_items_quantity) for `metered` [`line_items`](/docs/api/invoices#invoice_line_items) of an invoice to reflect the latest [usage](https://apidocs.chargebee.com/docs/api/usages) data.
|
|
2060
|
-
|
|
2061
|
-
**Note:** This operation is done automatically while [closing](https://apidocs.chargebee.com/docs/api/invoices#close_a_pending_invoice) the invoice.
|
|
2062
|
-
|
|
2063
|
-
*/
|
|
2064
|
-
|
|
2065
1847
|
invoice:Invoice;
|
|
2066
1848
|
}
|
|
2067
1849
|
|
|
2068
1850
|
export interface RefundResponse {
|
|
2069
|
-
/**
|
|
2070
|
-
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
2071
|
-
|
|
2072
|
-
* Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
|
|
2073
|
-
* Refund a fully refunded invoice.
|
|
2074
|
-
|
|
2075
|
-
If the refund transaction succeeds, a `credit_note` capturing this refund detail is created for the invoice.
|
|
2076
|
-
|
|
2077
|
-
*/
|
|
2078
|
-
|
|
2079
1851
|
invoice:Invoice;
|
|
2080
1852
|
|
|
2081
|
-
/**
|
|
2082
|
-
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
2083
|
-
|
|
2084
|
-
* Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
|
|
2085
|
-
* Refund a fully refunded invoice.
|
|
2086
|
-
|
|
2087
|
-
If the refund transaction succeeds, a `credit_note` capturing this refund detail is created for the invoice.
|
|
2088
|
-
|
|
2089
|
-
*/
|
|
2090
|
-
|
|
2091
1853
|
transaction:Transaction;
|
|
2092
1854
|
|
|
2093
|
-
/**
|
|
2094
|
-
* @description Refunds the invoice. The [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer. You can choose to either make a full refund for the entire amount or make many partial refunds until you reach the total amount charged for the invoice. The API returns an error if an attempt is made to:
|
|
2095
|
-
|
|
2096
|
-
* Refund an offline invoice. For such invoices, use the [Record refund API](/docs/api/invoices#record_refund_for_an_invoice).
|
|
2097
|
-
* Refund a fully refunded invoice.
|
|
2098
|
-
|
|
2099
|
-
If the refund transaction succeeds, a `credit_note` capturing this refund detail is created for the invoice.
|
|
2100
|
-
|
|
2101
|
-
*/
|
|
2102
|
-
|
|
2103
1855
|
credit_note?:CreditNote;
|
|
2104
1856
|
}
|
|
2105
1857
|
export interface RefundInputParam {
|
|
@@ -2133,94 +1885,10 @@ If the refund transaction succeeds, a `credit_note` capturing this ref
|
|
|
2133
1885
|
credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver'};
|
|
2134
1886
|
}
|
|
2135
1887
|
export interface RecordRefundResponse {
|
|
2136
|
-
/**
|
|
2137
|
-
* @description Refunds the invoice. The refund is provided against the following in order of precedence:
|
|
2138
|
-
|
|
2139
|
-
* Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2140
|
-
* Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
|
|
2141
|
-
* Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2142
|
-
|
|
2143
|
-
**Example**
|
|
2144
|
-
|
|
2145
|
-
Consider an invoice with the following payments and tax withheld.
|
|
2146
|
-
|
|
2147
|
-
* Offline payments: $30
|
|
2148
|
-
* Online payments: $20
|
|
2149
|
-
* Tax withheld: $5
|
|
2150
|
-
|
|
2151
|
-
When recording a refund worth $40, the refund amount is split as follows:
|
|
2152
|
-
|
|
2153
|
-
* Refund against offline payments: $30
|
|
2154
|
-
* Refund against tax withheld: $5
|
|
2155
|
-
* Refund against online payments: $5
|
|
2156
|
-
|
|
2157
|
-
For payments made via online transactions, the [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer.
|
|
2158
|
-
**Tip**
|
|
2159
|
-
|
|
2160
|
-
If the order of precendence described above does not work for your use case, and you want to provide a refund against online `linked_payments` first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
|
|
2161
|
-
|
|
2162
|
-
*/
|
|
2163
|
-
|
|
2164
1888
|
invoice:Invoice;
|
|
2165
1889
|
|
|
2166
|
-
/**
|
|
2167
|
-
* @description Refunds the invoice. The refund is provided against the following in order of precedence:
|
|
2168
|
-
|
|
2169
|
-
* Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2170
|
-
* Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
|
|
2171
|
-
* Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2172
|
-
|
|
2173
|
-
**Example**
|
|
2174
|
-
|
|
2175
|
-
Consider an invoice with the following payments and tax withheld.
|
|
2176
|
-
|
|
2177
|
-
* Offline payments: $30
|
|
2178
|
-
* Online payments: $20
|
|
2179
|
-
* Tax withheld: $5
|
|
2180
|
-
|
|
2181
|
-
When recording a refund worth $40, the refund amount is split as follows:
|
|
2182
|
-
|
|
2183
|
-
* Refund against offline payments: $30
|
|
2184
|
-
* Refund against tax withheld: $5
|
|
2185
|
-
* Refund against online payments: $5
|
|
2186
|
-
|
|
2187
|
-
For payments made via online transactions, the [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer.
|
|
2188
|
-
**Tip**
|
|
2189
|
-
|
|
2190
|
-
If the order of precendence described above does not work for your use case, and you want to provide a refund against online `linked_payments` first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
|
|
2191
|
-
|
|
2192
|
-
*/
|
|
2193
|
-
|
|
2194
1890
|
transaction?:Transaction;
|
|
2195
1891
|
|
|
2196
|
-
/**
|
|
2197
|
-
* @description Refunds the invoice. The refund is provided against the following in order of precedence:
|
|
2198
|
-
|
|
2199
|
-
* Offline [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2200
|
-
* Any [linked_taxes_withheld](/docs/api/invoices#invoice_linked_taxes_withheld)
|
|
2201
|
-
* Online [linked_payments](/docs/api/invoices#invoice_linked_payments)
|
|
2202
|
-
|
|
2203
|
-
**Example**
|
|
2204
|
-
|
|
2205
|
-
Consider an invoice with the following payments and tax withheld.
|
|
2206
|
-
|
|
2207
|
-
* Offline payments: $30
|
|
2208
|
-
* Online payments: $20
|
|
2209
|
-
* Tax withheld: $5
|
|
2210
|
-
|
|
2211
|
-
When recording a refund worth $40, the refund amount is split as follows:
|
|
2212
|
-
|
|
2213
|
-
* Refund against offline payments: $30
|
|
2214
|
-
* Refund against tax withheld: $5
|
|
2215
|
-
* Refund against online payments: $5
|
|
2216
|
-
|
|
2217
|
-
For payments made via online transactions, the [refund](https://www.chargebee.com/docs/refunds.html) request is processed via the payment gateway originally used to charge the customer.
|
|
2218
|
-
**Tip**
|
|
2219
|
-
|
|
2220
|
-
If the order of precendence described above does not work for your use case, and you want to provide a refund against online `linked_payments` first, use the [Refund an invoice API](/docs/api/invoices#refund_an_invoice).
|
|
2221
|
-
|
|
2222
|
-
*/
|
|
2223
|
-
|
|
2224
1892
|
credit_note?:CreditNote;
|
|
2225
1893
|
}
|
|
2226
1894
|
export interface RecordRefundInputParam {
|
|
@@ -2254,15 +1922,6 @@ If the order of precendence described above does not work for your use case, and
|
|
|
2254
1922
|
credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'chargeback' | 'order_change' | 'waiver'};
|
|
2255
1923
|
}
|
|
2256
1924
|
export interface PdfResponse {
|
|
2257
|
-
/**
|
|
2258
|
-
* @description Gets the invoice as PDF. The returned URL is secure and allows download. The URL will expire in 60 minutes.
|
|
2259
|
-
|
|
2260
|
-
#### Related Tutorial
|
|
2261
|
-
|
|
2262
|
-
* [Check out customer portal tutorial on how to download invoice as PDF.](//www.chargebee.com/tutorials/customer-portal-sample.html#downloading_invoices_as_pdf)
|
|
2263
|
-
|
|
2264
|
-
*/
|
|
2265
|
-
|
|
2266
1925
|
download:Download;
|
|
2267
1926
|
}
|
|
2268
1927
|
export interface PdfInputParam {
|
|
@@ -2275,15 +1934,6 @@ If the order of precendence described above does not work for your use case, and
|
|
|
2275
1934
|
disposition_type?:DispositionType;
|
|
2276
1935
|
}
|
|
2277
1936
|
export interface DownloadEinvoiceResponse {
|
|
2278
|
-
/**
|
|
2279
|
-
* @description Download the e-invoice in both XML and PDF formats. The response consists of a `download` object for each format. The XML format follows the [structure as per Peppol BIS Billing v3.0](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/tree/).
|
|
2280
|
-
**Note**
|
|
2281
|
-
|
|
2282
|
-
* You can only download e-invoices when their `status` is `success`.
|
|
2283
|
-
* There are some cases in which the PDF is not available for download. In such cases, you can obtain it from the XML by decoding the value for [cbc:EmbeddedDocumentBinaryObject](https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cac-Attachment/cbc-EmbeddedDocumentBinaryObject/), which is the Base64-encoded version of the PDF.
|
|
2284
|
-
|
|
2285
|
-
*/
|
|
2286
|
-
|
|
2287
1937
|
downloads:Download[];
|
|
2288
1938
|
}
|
|
2289
1939
|
|
|
@@ -349,11 +349,6 @@ Other details of attaching items can be specified using the [Create](./attached_
|
|
|
349
349
|
sort_by?:{asc?:'updated_at' | 'name' | 'id',desc?:'updated_at' | 'name' | 'id'};
|
|
350
350
|
}
|
|
351
351
|
export interface CreateResponse {
|
|
352
|
-
/**
|
|
353
|
-
* @description Creates a new item.
|
|
354
|
-
|
|
355
|
-
*/
|
|
356
|
-
|
|
357
352
|
item:Item;
|
|
358
353
|
}
|
|
359
354
|
export interface CreateInputParam {
|
|
@@ -499,29 +494,14 @@ Other details of attaching items can be specified using the [Create](./attached_
|
|
|
499
494
|
metadata?:object;
|
|
500
495
|
}
|
|
501
496
|
export interface DeleteResponse {
|
|
502
|
-
/**
|
|
503
|
-
* @description Deletes an item, marking its `status` as deleted. This is not allowed if there are `active` or `archived` item prices under the item. Once deleted, the id and name of the item can be reused.
|
|
504
|
-
|
|
505
|
-
*/
|
|
506
|
-
|
|
507
497
|
item:Item;
|
|
508
498
|
}
|
|
509
499
|
|
|
510
500
|
export interface RetrieveResponse {
|
|
511
|
-
/**
|
|
512
|
-
* @description Retrieve an item resource.
|
|
513
|
-
|
|
514
|
-
*/
|
|
515
|
-
|
|
516
501
|
item:Item;
|
|
517
502
|
}
|
|
518
503
|
|
|
519
504
|
export interface UpdateResponse {
|
|
520
|
-
/**
|
|
521
|
-
* @description Updates an item with the changes specified. Unspecified item parameters are not modified.
|
|
522
|
-
|
|
523
|
-
*/
|
|
524
|
-
|
|
525
505
|
item:Item;
|
|
526
506
|
}
|
|
527
507
|
export interface UpdateInputParam {
|
|
@@ -129,11 +129,6 @@ declare module 'chargebee' {
|
|
|
129
129
|
offset?:string;
|
|
130
130
|
}
|
|
131
131
|
export interface AddItemEntitlementsResponse {
|
|
132
|
-
/**
|
|
133
|
-
* @description Upserts or removes a set of `item_entitlement`s for an `feature` depending on the `action` specified. The API returns the upserted or deleted `item_entitlements` after successfully completing the operation. The operation returns an error when the first `item_entitlement` fails to be processed. Either all the `item_entitlement`s provided in the request are processed or none.
|
|
134
|
-
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
132
|
item_entitlement:ItemEntitlement;
|
|
138
133
|
}
|
|
139
134
|
export interface AddItemEntitlementsInputParam {
|
|
@@ -184,11 +179,6 @@ declare module 'chargebee' {
|
|
|
184
179
|
offset?:string;
|
|
185
180
|
}
|
|
186
181
|
export interface UpsertOrRemoveItemEntitlementsForItemResponse {
|
|
187
|
-
/**
|
|
188
|
-
* @description Upserts or removes a set of `item_entitlements` for an [item](items?prod_cat_ver=2) depending on the `action` specified. The API returns the upserted or deleted `item_entitlements` after successfully completing the operation. The operation returns an error when the first `item_entitlement` fails to be processed. Either all the `item_entitlement`s provided in the request are processed or none.
|
|
189
|
-
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
182
|
item_entitlement:ItemEntitlement;
|
|
193
183
|
}
|
|
194
184
|
export interface UpsertOrRemoveItemEntitlementsForItemInputParam {
|
|
@@ -89,11 +89,6 @@ declare module 'chargebee' {
|
|
|
89
89
|
update(item_family_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
|
|
90
90
|
}
|
|
91
91
|
export interface DeleteResponse {
|
|
92
|
-
/**
|
|
93
|
-
* @description Deletes an item family, marking its `status` as `deleted`. This is not allowed if there are `active` items under the item family. Once deleted, the `id` and `name` of the item family can be reused to create a new item family.
|
|
94
|
-
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
92
|
item_family:ItemFamily;
|
|
98
93
|
}
|
|
99
94
|
|
|
@@ -150,11 +145,6 @@ declare module 'chargebee' {
|
|
|
150
145
|
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
151
146
|
}
|
|
152
147
|
export interface CreateResponse {
|
|
153
|
-
/**
|
|
154
|
-
* @description This endpoint creates an item family for your product line or service.
|
|
155
|
-
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
148
|
item_family:ItemFamily;
|
|
159
149
|
}
|
|
160
150
|
export interface CreateInputParam {
|
|
@@ -181,20 +171,10 @@ declare module 'chargebee' {
|
|
|
181
171
|
description?:string;
|
|
182
172
|
}
|
|
183
173
|
export interface RetrieveResponse {
|
|
184
|
-
/**
|
|
185
|
-
* @description This endpoint retrieves an item family based on the item family id.
|
|
186
|
-
|
|
187
|
-
*/
|
|
188
|
-
|
|
189
174
|
item_family:ItemFamily;
|
|
190
175
|
}
|
|
191
176
|
|
|
192
177
|
export interface UpdateResponse {
|
|
193
|
-
/**
|
|
194
|
-
* @description This endpoint updates the name and/or description of the item family.
|
|
195
|
-
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
178
|
item_family:ItemFamily;
|
|
199
179
|
}
|
|
200
180
|
export interface UpdateInputParam {
|