chargebee 2.23.1 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +2 -2
  3. package/lib/chargebee.js +1 -1
  4. package/lib/resources/api_endpoints.js +15 -0
  5. package/package.json +2 -1
  6. package/types/core.d.ts +80 -0
  7. package/types/index.d.ts +92 -0
  8. package/types/resources/Address.d.ts +58 -0
  9. package/types/resources/AdvanceInvoiceSchedule.d.ts +26 -0
  10. package/types/resources/AttachedItem.d.ts +84 -0
  11. package/types/resources/Card.d.ts +88 -0
  12. package/types/resources/Comment.d.ts +52 -0
  13. package/types/resources/Contact.d.ts +15 -0
  14. package/types/resources/ContractTerm.d.ts +18 -0
  15. package/types/resources/Coupon.d.ts +150 -0
  16. package/types/resources/CouponCode.d.ts +25 -0
  17. package/types/resources/CouponSet.d.ts +75 -0
  18. package/types/resources/CreditNote.d.ts +337 -0
  19. package/types/resources/CreditNoteEstimate.d.ts +96 -0
  20. package/types/resources/Customer.d.ts +440 -0
  21. package/types/resources/DifferentialPrice.d.ts +88 -0
  22. package/types/resources/Discount.d.ts +23 -0
  23. package/types/resources/Download.d.ts +9 -0
  24. package/types/resources/EntitlementOverride.d.ts +37 -0
  25. package/types/resources/Estimate.d.ts +214 -0
  26. package/types/resources/Event.d.ts +42 -0
  27. package/types/resources/Export.d.ts +182 -0
  28. package/types/resources/Feature.d.ts +90 -0
  29. package/types/resources/Gift.d.ts +97 -0
  30. package/types/resources/Hierarchy.d.ts +11 -0
  31. package/types/resources/HostedPage.d.ts +242 -0
  32. package/types/resources/ImpactedItem.d.ts +17 -0
  33. package/types/resources/ImpactedSubscription.d.ts +17 -0
  34. package/types/resources/InAppSubscription.d.ts +52 -0
  35. package/types/resources/Invoice.d.ts +590 -0
  36. package/types/resources/InvoiceEstimate.d.ts +96 -0
  37. package/types/resources/Item.d.ts +118 -0
  38. package/types/resources/ItemEntitlement.d.ts +55 -0
  39. package/types/resources/ItemFamily.d.ts +59 -0
  40. package/types/resources/ItemPrice.d.ts +195 -0
  41. package/types/resources/Media.d.ts +10 -0
  42. package/types/resources/NonSubscription.d.ts +23 -0
  43. package/types/resources/Order.d.ts +305 -0
  44. package/types/resources/PaymentIntent.d.ts +71 -0
  45. package/types/resources/PaymentReferenceNumber.d.ts +10 -0
  46. package/types/resources/PaymentSource.d.ts +264 -0
  47. package/types/resources/PaymentVoucher.d.ts +74 -0
  48. package/types/resources/PortalSession.d.ts +57 -0
  49. package/types/resources/PromotionalCredit.d.ts +86 -0
  50. package/types/resources/Purchase.d.ts +46 -0
  51. package/types/resources/Quote.d.ts +388 -0
  52. package/types/resources/QuoteLineGroup.d.ts +83 -0
  53. package/types/resources/QuotedCharge.d.ts +57 -0
  54. package/types/resources/QuotedSubscription.d.ts +82 -0
  55. package/types/resources/ResourceMigration.d.ts +27 -0
  56. package/types/resources/SiteMigrationDetail.d.ts +31 -0
  57. package/types/resources/Subscription.d.ts +619 -0
  58. package/types/resources/SubscriptionEntitlement.d.ts +41 -0
  59. package/types/resources/SubscriptionEstimate.d.ts +49 -0
  60. package/types/resources/TaxWithheld.d.ts +13 -0
  61. package/types/resources/ThirdPartyPaymentMethod.d.ts +10 -0
  62. package/types/resources/TimeMachine.d.ts +38 -0
  63. package/types/resources/Token.d.ts +50 -0
  64. package/types/resources/Transaction.d.ts +170 -0
  65. package/types/resources/UnbilledCharge.d.ts +91 -0
  66. package/types/resources/Usage.d.ts +76 -0
  67. package/types/resources/VirtualBankAccount.d.ts +75 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,44 @@
1
+ ### v2.25.0 (2023-07-19)
2
+ * * *
3
+ * Add typescript typings
4
+
5
+ ### v2.24.0 (2023-06-30)
6
+ * * *
7
+
8
+ #### New endpoints:
9
+ * ViewVoucher#ViewVoucherRequest has been added to the HostedPage resource.
10
+ * InvoiceListPaymentReferenceNumbers#InvoiceListPaymentReferenceNumbersRequest has been added to the Invoice resource.
11
+
12
+ #### New Resource:
13
+ * PaymentReferenceNumber has been added.
14
+
15
+ #### New attributes:
16
+ * local_currency_exchange_rate has been added to the CreditNote and Invoice resource.
17
+
18
+ #### New Enum values:
19
+ * view_voucher has been added to Type enum in HostedPage resource.
20
+ * paused has been added in StoreStatus enum in InAppSubscription resource.
21
+ * metrics_global and windcave has been added in Gateway enum.
22
+
23
+
24
+ #### New Input parameters:
25
+ * payment_initiator has been added to Customers#CollectPaymentRequest.
26
+ * payment_initiator has been added to Invoice#CreateRequest.
27
+ * payment_initiator has been added to Invoice#ChargeRequest.
28
+ * payment_initiator has been added to Invoice#ChargeAddonRequest.
29
+ * payment_initiator has been added to Invoice#CollectPaymentRequest.
30
+ * payment_initiator has been added to Subscription#CreateRequest.
31
+ * payment_initiator has been added to Invoice#CreateForChargeItemRequest.
32
+ * payment_initiator has been added to Subscription#CreateForCustomerRequest.
33
+ * payment_initiator has been added to Subscription#CreateWithItemsRequest.
34
+ * payment_initiator has been added to Subscription#UpdateForItemsRequest.
35
+ * payment_initiator has been added to Subscription#ReactivateRequest.
36
+ * payment_initiator has been added to Subscription#ResumeRequest.
37
+ * payment_reference_numbers[id] has been added to Invoice#ImportInvoiceRequest.
38
+ * payment_reference_numbers[type] has been added to Invoice#ImportInvoiceRequest.
39
+ * payment_reference_numbers[number] has been added to Invoice#ImportInvoiceRequest.
40
+
41
+
1
42
  ### v2.23.1 (2023-06-08)
2
43
  * * *
3
44
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Chargebee Node Client Library - API V2
2
2
 
3
- [![npm](https://img.shields.io/npm/v/chargebee.svg?maxAge=25920000)](https://www.npmjs.com/package/chargebee)
4
- [![npm](https://img.shields.io/npm/dt/chargebee.svg?maxAge=25920000)](https://www.npmjs.com/package/chargebee)
3
+ [![npm](https://img.shields.io/npm/v/chargebee.svg?maxAge=3)](https://www.npmjs.com/package/chargebee)
4
+ [![npm](https://img.shields.io/npm/dt/chargebee.svg?maxAge=3)](https://www.npmjs.com/package/chargebee)
5
5
 
6
6
  This is the [node.js](http://nodejs.org/) library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com).
7
7
 
package/lib/chargebee.js CHANGED
@@ -11,7 +11,7 @@ ChargeBee._env = {
11
11
  hostSuffix: '.chargebee.com',
12
12
  apiPath: '/api/v2',
13
13
  timeout: 80000,
14
- clientVersion: 'v2.23.1',
14
+ clientVersion: 'v2.25.0',
15
15
  port: 443,
16
16
  timemachineWaitInMillis: 3000,
17
17
  exportWaitInMillis: 3000
@@ -789,6 +789,13 @@ var _endpoints = {
789
789
  "/download_einvoice",
790
790
  true
791
791
  ],
792
+ [
793
+ "list_payment_reference_numbers",
794
+ "GET",
795
+ "/invoices",
796
+ "/payment_reference_numbers",
797
+ false
798
+ ],
792
799
  [
793
800
  "add_charge",
794
801
  "POST",
@@ -916,6 +923,7 @@ var _endpoints = {
916
923
  true
917
924
  ]
918
925
  ],
926
+ "payment_reference_number": [],
919
927
  "tax_withheld": [],
920
928
  "credit_note": [
921
929
  [
@@ -1417,6 +1425,13 @@ var _endpoints = {
1417
1425
  "/hosted_pages",
1418
1426
  "/events",
1419
1427
  false
1428
+ ],
1429
+ [
1430
+ "view_voucher",
1431
+ "POST",
1432
+ "/hosted_pages",
1433
+ "/view_voucher",
1434
+ false
1420
1435
  ]
1421
1436
  ],
1422
1437
  "estimate": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"chargebee",
3
- "version":"2.23.1",
3
+ "version":"2.25.0",
4
4
  "description":"A library for integrating with ChargeBee.",
5
5
  "keywords":[
6
6
  "payments",
@@ -11,6 +11,7 @@
11
11
  "homepage":"http://github.com/chargebee/chargebee-node",
12
12
  "author":"Ajit <ajit@chargebee.com> (https://www.chargebee.com)",
13
13
  "main":"lib/chargebee.js",
14
+ "types": "types/index.d.ts",
14
15
  "dependencies":{
15
16
  "q" : ">=1.0.1",
16
17
  "safer-buffer": "2.1.2"
@@ -0,0 +1,80 @@
1
+ declare module 'chargebee' {
2
+ export class ChargebeeRequest<T> {
3
+ setIdempotencyKey(idempotencyKey: string): this;
4
+ request(): Promise<T>;
5
+ headers(headers : {[key : string] : string}): this;
6
+ }
7
+ type AccountHolderType = 'individual' | 'company'
8
+ type AccountReceivablesHandling = 'schedule_payment_collection' | 'no_action' | 'write_off'
9
+ type AccountType = 'checking' | 'current' | 'savings' | 'business_checking'
10
+ type Action = 'upsert' | 'remove'
11
+ type ApiVersion = 'v1' | 'v2'
12
+ type ApplyOn = 'specific_item_price' | 'invoice_amount'
13
+ type AutoCollection = 'off' | 'on'
14
+ type AvalaraSaleType = 'consumed' | 'wholesale' | 'vendor_use' | 'retail'
15
+ type BillingAlignmentMode = 'immediate' | 'delayed'
16
+ type BillingDateMode = 'manually_set' | 'using_defaults'
17
+ type BillingDayOfWeekMode = 'manually_set' | 'using_defaults'
18
+ type ChangeOption = 'immediately' | 'specific_date'
19
+ type Channel = 'app_store' | 'web' | 'play_store'
20
+ type ChargeModel = 'full_charge' | 'prorate'
21
+ type ChargeOnEvent = 'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation' | 'on_demand'
22
+ type ChargeOnOption = 'on_event' | 'immediately'
23
+ type ChargesHandling = 'add_to_unbilled_charges' | 'invoice_immediately'
24
+ type ContractTermCancelOption = 'end_of_contract_term' | 'terminate_immediately'
25
+ type CreditOptionForCurrentTermCharges = 'none' | 'prorate' | 'full'
26
+ type CreditType = 'general' | 'loyalty_credits' | 'referral_rewards'
27
+ type CustomerType = 'industrial' | 'residential' | 'business' | 'senior_citizen'
28
+ type DedupeOption = 'update_existing' | 'skip'
29
+ type DispositionType = 'attachment' | 'inline'
30
+ type DunningType = 'offline' | 'auto_collect' | 'direct_debit'
31
+ type DurationType = 'limited_period' | 'one_time' | 'forever'
32
+ type EcheckType = 'web' | 'ppd' | 'ccd'
33
+ type EinvoicingMethod = 'automatic' | 'manual' | 'site_default'
34
+ type EndScheduleOn = 'after_number_of_intervals' | 'specific_date' | 'subscription_end'
35
+ type EntityCode = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'p' | 'q' | 'r' | 'med2' | 'med1'
36
+ type EntityType = 'item' | 'product' | 'coupon' | 'addon' | 'item_price' | 'business_entity' | 'subscription' | 'item_family' | 'credit_note' | 'quote' | 'variant' | 'invoice' | 'plan' | 'transaction' | 'customer' | 'order'
37
+ type EventName = 'cancellation_page_loaded'
38
+ type EventType = 'subscription_pause_scheduled' | 'order_delivered' | 'subscription_advance_invoice_schedule_added' | 'gift_expired' | 'tax_withheld_deleted' | 'coupon_codes_added' | 'unbilled_charges_deleted' | 'gift_cancelled' | 'coupon_updated' | 'order_cancelled' | 'coupon_deleted' | 'product_updated' | 'subscription_scheduled_changes_removed' | 'pending_invoice_created' | 'product_deleted' | 'entitlement_overrides_auto_removed' | 'unbilled_charges_created' | 'subscription_resumed' | 'subscription_cancelled' | 'item_entitlements_removed' | 'business_entity_created' | 'payment_source_deleted' | 'quote_deleted' | 'invoice_updated' | 'coupon_set_updated' | 'differential_price_updated' | 'subscription_advance_invoice_schedule_removed' | 'entitlement_overrides_removed' | 'subscription_activated_with_backdating' | 'card_deleted' | 'order_ready_to_ship' | 'subscription_trial_end_reminder' | 'subscription_shipping_address_updated' | 'variant_updated' | 'voucher_create_failed' | 'gift_claimed' | 'business_entity_updated' | 'subscription_scheduled_resumption_removed' | 'payment_initiated' | 'feature_archived' | 'subscription_reactivated_with_backdating' | 'customer_deleted' | 'token_expired' | 'card_added' | 'coupon_created' | 'refund_initiated' | 'invoice_generated_with_backdating' | 'add_usages_reminder' | 'item_price_deleted' | 'virtual_bank_account_deleted' | 'subscription_created' | 'voucher_created' | 'feature_activated' | 'subscription_entitlements_created' | 'payment_source_locally_deleted' | 'order_returned' | 'subscription_deleted' | 'invoice_generated' | 'voucher_expired' | 'authorization_succeeded' | 'payment_source_added' | 'gift_scheduled' | 'item_price_created' | 'subscription_changes_scheduled' | 'subscription_changed_with_backdating' | 'variant_created' | 'subscription_scheduled_cancellation_removed' | 'payment_refunded' | 'gift_unclaimed' | 'product_created' | 'differential_price_created' | 'virtual_bank_account_added' | 'payment_intent_created' | 'transaction_created' | 'credit_note_created_with_backdating' | 'contract_term_terminated' | 'item_family_updated' | 'order_created' | 'payment_succeeded' | 'plan_deleted' | 'subscription_canceled_with_backdating' | 'unbilled_charges_voided' | 'quote_created' | 'customer_moved_in' | 'coupon_set_deleted' | 'subscription_advance_invoice_schedule_updated' | 'attached_item_created' | 'customer_changed' | 'subscription_started' | 'item_deleted' | 'subscription_activated' | 'payment_source_expiring' | 'subscription_reactivated' | 'order_updated' | 'subscription_scheduled_pause_removed' | 'subscription_cancellation_reminder' | 'addon_deleted' | 'subscription_created_with_backdating' | 'order_deleted' | 'item_entitlements_updated' | 'token_consumed' | 'addon_updated' | 'hierarchy_deleted' | 'subscription_cancellation_scheduled' | 'gift_updated' | 'subscription_trial_extended' | 'subscription_renewed' | 'feature_updated' | 'addon_created' | 'feature_deleted' | 'item_family_created' | 'card_expiry_reminder' | 'token_created' | 'purchase_created' | 'plan_created' | 'entitlement_overrides_updated' | 'plan_updated' | 'promotional_credits_added' | 'item_family_deleted' | 'subscription_resumption_scheduled' | 'feature_reactivated' | 'coupon_codes_deleted' | 'card_expired' | 'credit_note_updated' | 'promotional_credits_deducted' | 'payment_source_expired' | 'customer_moved_out' | 'subscription_paused' | 'order_ready_to_process' | 'feature_created' | 'hierarchy_created' | 'attached_item_deleted' | 'transaction_deleted' | 'credit_note_created' | 'item_updated' | 'item_created' | 'coupon_set_created' | 'transaction_updated' | 'payment_intent_updated' | 'variant_deleted' | 'mrr_updated' | 'order_resent' | 'unbilled_charges_invoiced' | 'tax_withheld_recorded' | 'item_price_updated' | 'differential_price_deleted' | 'coupon_codes_updated' | 'virtual_bank_account_updated' | 'contract_term_created' | 'subscription_changed' | 'contract_term_cancelled' | 'contract_term_renewed' | 'invoice_deleted' | 'payment_failed' | 'credit_note_deleted' | 'tax_withheld_refunded' | 'contract_term_completed' | 'card_updated' | 'customer_created' | 'pending_invoice_updated' | 'quote_updated' | 'subscription_renewal_reminder' | 'attached_item_updated' | 'payment_source_updated' | 'business_entity_deleted' | 'authorization_voided'
39
+ type ExportType = 'data' | 'import_friendly_data'
40
+ type FreePeriodUnit = 'week' | 'month' | 'year' | 'day'
41
+ type FriendOfferType = 'coupon_code' | 'coupon' | 'none'
42
+ type Gateway = 'bluepay' | 'beanstream' | 'elavon' | 'orbital' | 'hdfc' | 'nmi' | 'moneris' | 'metrics_global' | 'pin' | 'stripe' | 'quickbooks' | 'razorpay' | 'eway_rapid' | 'balanced_payments' | 'ecentric' | 'wepay' | 'chargebee_payments' | 'bank_of_america' | 'braintree' | 'first_data_global' | 'paypal_express_checkout' | 'ingenico_direct' | 'moneris_us' | 'exact' | 'migs' | 'checkout_com' | 'not_applicable' | 'paypal_pro' | 'ogone' | 'eway' | 'gocardless' | 'global_payments' | 'paymill' | 'adyen' | 'paypal' | 'chargebee' | 'authorize_net' | 'tco' | 'bluesnap' | 'windcave' | 'paypal_payflow_pro' | 'amazon_payments' | 'mollie' | 'cybersource' | 'wirecard' | 'sage_pay' | 'vantiv' | 'worldpay'
43
+ type HierarchyOperationType = 'complete_hierarchy' | 'subordinates' | 'path_to_root'
44
+ type InvoiceDunningHandling = 'stop' | 'continue'
45
+ type ItemType = 'charge' | 'addon' | 'plan'
46
+ type Layout = 'in_app' | 'full_page'
47
+ type NotifyReferralSystem = 'all_invoices' | 'none' | 'first_paid_conversion'
48
+ type OfflinePaymentMethod = 'bank_transfer' | 'no_preference' | 'ach_credit' | 'boleto' | 'check' | 'sepa_credit' | 'cash'
49
+ type OnEvent = 'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation'
50
+ type Operation = 'create' | 'update' | 'delete'
51
+ type OperationType = 'add' | 'remove'
52
+ type PauseOption = 'end_of_term' | 'billing_cycles' | 'immediately' | 'specific_date'
53
+ type PaymentMethod = 'other' | 'netbanking_emandates' | 'ach_credit' | 'dotpay' | 'boleto' | 'direct_debit' | 'chargeback' | 'wechat_pay' | 'cash' | 'giropay' | 'bank_transfer' | 'alipay' | 'ideal' | 'google_pay' | 'custom' | 'unionpay' | 'check' | 'sofort' | 'amazon_payments' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'sepa_credit' | 'card'
54
+ type PaymentMethodType = 'giropay' | 'alipay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'unionpay' | 'direct_debit' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'wechat_pay' | 'card'
55
+ type PaymentVoucherType = 'boleto'
56
+ type PeriodUnit = 'week' | 'month' | 'year' | 'day'
57
+ type PriceType = 'tax_exclusive' | 'tax_inclusive'
58
+ type PricingModel = 'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep'
59
+ type ReferralSystem = 'referral_candy' | 'friendbuy' | 'referral_saasquatch'
60
+ type ReferrerRewardType = 'custom_promotional_credit' | 'referral_direct_reward' | 'custom_revenue_percent_based' | 'none'
61
+ type RefundableCreditsHandling = 'schedule_refund' | 'no_action'
62
+ type ReportBy = 'product' | 'invoice' | 'subscription' | 'customer'
63
+ type ResumeOption = 'immediately' | 'specific_date'
64
+ type Role = 'backup' | 'none' | 'primary'
65
+ type ScheduleType = 'immediate' | 'specific_dates' | 'fixed_intervals'
66
+ type Source = 'admin_console' | 'system' | 'scheduled_job' | 'js_api' | 'bulk_operation' | 'hosted_page' | 'migration' | 'api' | 'none' | 'portal' | 'external_service'
67
+ type TaxExemptReason = 'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt'
68
+ type TaxJurisType = 'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state'
69
+ type TaxOverrideReason = 'id_exempt' | 'customer_exempt' | 'export'
70
+ type Taxability = 'taxable' | 'exempt'
71
+ type TaxjarExemptionCategory = 'other' | 'wholesale' | 'government'
72
+ type TrialEndAction = 'activate_subscription' | 'plan_default' | 'cancel_subscription' | 'site_default'
73
+ type Type = 'giropay' | 'alipay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'unionpay' | 'direct_debit' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'wechat_pay' | 'card'
74
+ type UnbilledChargesHandling = 'invoice' | 'no_action'
75
+ type UnbilledChargesOption = 'invoice' | 'delete'
76
+ type UnpaidInvoicesHandling = 'schedule_payment_collection' | 'no_action'
77
+ type ValidationStatus = 'valid' | 'partially_valid' | 'invalid' | 'not_validated'
78
+ type VoucherType = 'boleto'
79
+
80
+ }
@@ -0,0 +1,92 @@
1
+ ///<reference path='./resources/Address.d.ts' />
2
+ ///<reference path='./resources/AttachedItem.d.ts' />
3
+ ///<reference path='./resources/Card.d.ts' />
4
+ ///<reference path='./resources/Comment.d.ts' />
5
+ ///<reference path='./resources/Coupon.d.ts' />
6
+ ///<reference path='./resources/CouponCode.d.ts' />
7
+ ///<reference path='./resources/CouponSet.d.ts' />
8
+ ///<reference path='./resources/CreditNote.d.ts' />
9
+ ///<reference path='./resources/Customer.d.ts' />
10
+ ///<reference path='./resources/DifferentialPrice.d.ts' />
11
+ ///<reference path='./resources/EntitlementOverride.d.ts' />
12
+ ///<reference path='./resources/Estimate.d.ts' />
13
+ ///<reference path='./resources/Event.d.ts' />
14
+ ///<reference path='./resources/Export.d.ts' />
15
+ ///<reference path='./resources/Feature.d.ts' />
16
+ ///<reference path='./resources/Gift.d.ts' />
17
+ ///<reference path='./resources/HostedPage.d.ts' />
18
+ ///<reference path='./resources/InAppSubscription.d.ts' />
19
+ ///<reference path='./resources/Invoice.d.ts' />
20
+ ///<reference path='./resources/Item.d.ts' />
21
+ ///<reference path='./resources/ItemEntitlement.d.ts' />
22
+ ///<reference path='./resources/ItemFamily.d.ts' />
23
+ ///<reference path='./resources/ItemPrice.d.ts' />
24
+ ///<reference path='./resources/NonSubscription.d.ts' />
25
+ ///<reference path='./resources/Order.d.ts' />
26
+ ///<reference path='./resources/PaymentIntent.d.ts' />
27
+ ///<reference path='./resources/PaymentSource.d.ts' />
28
+ ///<reference path='./resources/PaymentVoucher.d.ts' />
29
+ ///<reference path='./resources/PortalSession.d.ts' />
30
+ ///<reference path='./resources/PromotionalCredit.d.ts' />
31
+ ///<reference path='./resources/Purchase.d.ts' />
32
+ ///<reference path='./resources/Quote.d.ts' />
33
+ ///<reference path='./resources/ResourceMigration.d.ts' />
34
+ ///<reference path='./resources/SiteMigrationDetail.d.ts' />
35
+ ///<reference path='./resources/Subscription.d.ts' />
36
+ ///<reference path='./resources/SubscriptionEntitlement.d.ts' />
37
+ ///<reference path='./resources/TimeMachine.d.ts' />
38
+ ///<reference path='./resources/Token.d.ts' />
39
+ ///<reference path='./resources/Transaction.d.ts' />
40
+ ///<reference path='./resources/UnbilledCharge.d.ts' />
41
+ ///<reference path='./resources/Usage.d.ts' />
42
+ ///<reference path='./resources/VirtualBankAccount.d.ts' />
43
+
44
+ declare module 'chargebee' {
45
+ class Chargebee {
46
+ static configure({ site, api_key }: { site: string; api_key: string });
47
+ static address: Address.AddressResource;
48
+ static attached_item: AttachedItem.AttachedItemResource;
49
+ static card: Card.CardResource;
50
+ static comment: Comment.CommentResource;
51
+ static coupon: Coupon.CouponResource;
52
+ static coupon_code: CouponCode.CouponCodeResource;
53
+ static coupon_set: CouponSet.CouponSetResource;
54
+ static credit_note: CreditNote.CreditNoteResource;
55
+ static customer: Customer.CustomerResource;
56
+ static differential_price: DifferentialPrice.DifferentialPriceResource;
57
+ static entitlement_override: EntitlementOverride.EntitlementOverrideResource;
58
+ static estimate: Estimate.EstimateResource;
59
+ static event: Event.EventResource;
60
+ static export: Export.ExportResource;
61
+ static feature: Feature.FeatureResource;
62
+ static gift: Gift.GiftResource;
63
+ static hosted_page: HostedPage.HostedPageResource;
64
+ static in_app_subscription: InAppSubscription.InAppSubscriptionResource;
65
+ static invoice: Invoice.InvoiceResource;
66
+ static item: Item.ItemResource;
67
+ static item_entitlement: ItemEntitlement.ItemEntitlementResource;
68
+ static item_family: ItemFamily.ItemFamilyResource;
69
+ static item_price: ItemPrice.ItemPriceResource;
70
+ static non_subscription: NonSubscription.NonSubscriptionResource;
71
+ static order: Order.OrderResource;
72
+ static payment_intent: PaymentIntent.PaymentIntentResource;
73
+ static payment_source: PaymentSource.PaymentSourceResource;
74
+ static payment_voucher: PaymentVoucher.PaymentVoucherResource;
75
+ static portal_session: PortalSession.PortalSessionResource;
76
+ static promotional_credit: PromotionalCredit.PromotionalCreditResource;
77
+ static purchase: Purchase.PurchaseResource;
78
+ static quote: Quote.QuoteResource;
79
+ static resource_migration: ResourceMigration.ResourceMigrationResource;
80
+ static site_migration_detail: SiteMigrationDetail.SiteMigrationDetailResource;
81
+ static subscription: Subscription.SubscriptionResource;
82
+ static subscription_entitlement: SubscriptionEntitlement.SubscriptionEntitlementResource;
83
+ static time_machine: TimeMachine.TimeMachineResource;
84
+ static token: Token.TokenResource;
85
+ static transaction: Transaction.TransactionResource;
86
+ static unbilled_charge: UnbilledCharge.UnbilledChargeResource;
87
+ static usage: Usage.UsageResource;
88
+ static virtual_bank_account: VirtualBankAccount.VirtualBankAccountResource;
89
+
90
+ }
91
+ export default Chargebee;
92
+ }
@@ -0,0 +1,58 @@
1
+ declare module 'chargebee' {
2
+ export interface Address {
3
+
4
+ label:string;
5
+ first_name?:string;
6
+ last_name?:string;
7
+ email?:string;
8
+ company?:string;
9
+ phone?:string;
10
+ addr?:string;
11
+ extended_addr?:string;
12
+ extended_addr2?:string;
13
+ city?:string;
14
+ state_code?:string;
15
+ state?:string;
16
+ country?:string;
17
+ zip?:string;
18
+ validation_status?:ValidationStatus;
19
+ subscription_id:string;
20
+ }
21
+ export namespace Address {
22
+ export class AddressResource {
23
+ retrieve(input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
24
+ update(input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
25
+ }
26
+ export interface RetrieveResponse {
27
+ address:Address;
28
+ }
29
+ export interface RetrieveInputParam {
30
+
31
+ subscription_id:string;
32
+ label:string;
33
+ }
34
+ export interface UpdateResponse {
35
+ address:Address;
36
+ }
37
+ export interface UpdateInputParam {
38
+
39
+ subscription_id:string;
40
+ label:string;
41
+ first_name?:string;
42
+ last_name?:string;
43
+ email?:string;
44
+ company?:string;
45
+ phone?:string;
46
+ addr?:string;
47
+ extended_addr?:string;
48
+ extended_addr2?:string;
49
+ city?:string;
50
+ state_code?:string;
51
+ state?:string;
52
+ zip?:string;
53
+ country?:string;
54
+ validation_status?:ValidationStatus;
55
+ }
56
+
57
+ }
58
+ }
@@ -0,0 +1,26 @@
1
+ declare module 'chargebee' {
2
+ export interface AdvanceInvoiceSchedule {
3
+
4
+ id:string;
5
+ schedule_type?:'specific_dates' | 'fixed_intervals';
6
+ fixed_interval_schedule?:AdvanceInvoiceSchedule.FixedIntervalSchedule;
7
+ specific_dates_schedule?:AdvanceInvoiceSchedule.SpecificDatesSchedule;
8
+ }
9
+ export namespace AdvanceInvoiceSchedule {
10
+
11
+
12
+ export interface FixedIntervalSchedule {
13
+ end_schedule_on?:EndScheduleOn;
14
+ number_of_occurrences?:number;
15
+ days_before_renewal?:number;
16
+ end_date?:number;
17
+ created_at?:number;
18
+ terms_to_charge?:number;
19
+ }
20
+ export interface SpecificDatesSchedule {
21
+ terms_to_charge?:number;
22
+ date?:number;
23
+ created_at?:number;
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,84 @@
1
+ declare module 'chargebee' {
2
+ export interface AttachedItem {
3
+
4
+ id:string;
5
+ parent_item_id:string;
6
+ item_id:string;
7
+ type:'optional' | 'mandatory' | 'recommended';
8
+ status?:'archived' | 'deleted' | 'active';
9
+ quantity?:number;
10
+ quantity_in_decimal?:string;
11
+ billing_cycles?:number;
12
+ charge_on_event:ChargeOnEvent;
13
+ charge_once:boolean;
14
+ created_at:number;
15
+ resource_version?:number;
16
+ updated_at?:number;
17
+ channel?:Channel;
18
+ }
19
+ export namespace AttachedItem {
20
+ export class AttachedItemResource {
21
+ retrieve(attached_item_id:string, input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
22
+ update(attached_item_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
23
+ list(item_id:string, input?:ListInputParam):ChargebeeRequest<ListResponse>;
24
+ create(item_id:string, input:CreateInputParam):ChargebeeRequest<CreateResponse>;
25
+ delete(attached_item_id:string, input:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
26
+ }
27
+ export interface RetrieveResponse {
28
+ attached_item:AttachedItem;
29
+ }
30
+ export interface RetrieveInputParam {
31
+
32
+ parent_item_id:string;
33
+ }
34
+ export interface UpdateResponse {
35
+ attached_item:AttachedItem;
36
+ }
37
+ export interface UpdateInputParam {
38
+
39
+ parent_item_id:string;
40
+ type?:'optional' | 'mandatory' | 'recommended';
41
+ billing_cycles?:number;
42
+ quantity?:number;
43
+ quantity_in_decimal?:string;
44
+ charge_on_event?:ChargeOnEvent;
45
+ charge_once?:boolean;
46
+ }
47
+ export interface ListResponse {
48
+ list:{attached_item:AttachedItem}[];
49
+ next_offset?:string;
50
+ }
51
+ export interface ListInputParam {
52
+ [key: string]: string | number | object | boolean;
53
+ limit?:number;
54
+ offset?:string;
55
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
56
+ item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
57
+ type?:{in?:string,is?:'optional' | 'mandatory' | 'recommended',is_not?:'optional' | 'mandatory' | 'recommended',not_in?:string};
58
+ item_type?:{in?:string,is?:'charge' | 'addon' | 'plan',is_not?:'charge' | 'addon' | 'plan',not_in?:string};
59
+ charge_on_event?:{in?:string,is?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation' | 'on_demand',is_not?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation' | 'on_demand',not_in?:string};
60
+ updated_at?:{after?:string,before?:string,between?:string,on?:string};
61
+ }
62
+ export interface CreateResponse {
63
+ attached_item:AttachedItem;
64
+ }
65
+ export interface CreateInputParam {
66
+
67
+ item_id:string;
68
+ type?:'optional' | 'mandatory' | 'recommended';
69
+ billing_cycles?:number;
70
+ quantity?:number;
71
+ quantity_in_decimal?:string;
72
+ charge_on_event?:ChargeOnEvent;
73
+ charge_once?:boolean;
74
+ }
75
+ export interface DeleteResponse {
76
+ attached_item:AttachedItem;
77
+ }
78
+ export interface DeleteInputParam {
79
+
80
+ parent_item_id:string;
81
+ }
82
+
83
+ }
84
+ }
@@ -0,0 +1,88 @@
1
+ declare module 'chargebee' {
2
+ export interface Card {
3
+
4
+ payment_source_id:string;
5
+ status:'valid' | 'expiring' | 'expired';
6
+ gateway:Gateway;
7
+ gateway_account_id?:string;
8
+ ref_tx_id?:string;
9
+ first_name?:string;
10
+ last_name?:string;
11
+ iin:string;
12
+ last4:string;
13
+ card_type?:'discover' | 'bancontact' | 'other' | 'visa' | 'jcb' | 'diners_club' | 'mastercard' | 'not_applicable' | 'american_express';
14
+ funding_type:'not_known' | 'prepaid' | 'not_applicable' | 'credit' | 'debit';
15
+ expiry_month:number;
16
+ expiry_year:number;
17
+ issuing_country?:string;
18
+ billing_addr1?:string;
19
+ billing_addr2?:string;
20
+ billing_city?:string;
21
+ billing_state_code?:string;
22
+ billing_state?:string;
23
+ billing_country?:string;
24
+ billing_zip?:string;
25
+ created_at:number;
26
+ resource_version?:number;
27
+ updated_at?:number;
28
+ ip_address?:string;
29
+ powered_by?:'giropay' | 'bancontact' | 'ideal' | 'latam_local_card' | 'not_applicable' | 'sofort' | 'card';
30
+ customer_id:string;
31
+ masked_number?:string;
32
+ }
33
+ export namespace Card {
34
+ export class CardResource {
35
+ copy_card_for_customer(customer_id:string, input:CopyCardForCustomerInputParam):ChargebeeRequest<CopyCardForCustomerResponse>;
36
+ retrieve(customer_id:string):ChargebeeRequest<RetrieveResponse>;
37
+ switch_gateway_for_customer(customer_id:string, input:SwitchGatewayForCustomerInputParam):ChargebeeRequest<SwitchGatewayForCustomerResponse>;
38
+ delete_card_for_customer(customer_id:string):ChargebeeRequest<DeleteCardForCustomerResponse>;
39
+ update_card_for_customer(customer_id:string, input:UpdateCardForCustomerInputParam):ChargebeeRequest<UpdateCardForCustomerResponse>;
40
+ }
41
+ export interface CopyCardForCustomerResponse {
42
+ third_party_payment_method:ThirdPartyPaymentMethod;
43
+ }
44
+ export interface CopyCardForCustomerInputParam {
45
+
46
+ gateway_account_id:string;
47
+ }
48
+ export interface RetrieveResponse {
49
+ card:Card;
50
+ }
51
+
52
+ export interface SwitchGatewayForCustomerResponse {
53
+ customer:Customer;
54
+ card:Card;
55
+ }
56
+ export interface SwitchGatewayForCustomerInputParam {
57
+
58
+ gateway_account_id:string;
59
+ }
60
+ export interface DeleteCardForCustomerResponse {
61
+ customer:Customer;
62
+ }
63
+
64
+ export interface UpdateCardForCustomerResponse {
65
+ customer:Customer;
66
+ card:Card;
67
+ }
68
+ export interface UpdateCardForCustomerInputParam {
69
+
70
+ gateway_account_id?:string;
71
+ tmp_token?:string;
72
+ first_name?:string;
73
+ last_name?:string;
74
+ number:string;
75
+ expiry_month:number;
76
+ expiry_year:number;
77
+ cvv?:string;
78
+ billing_addr1?:string;
79
+ billing_addr2?:string;
80
+ billing_city?:string;
81
+ billing_state_code?:string;
82
+ billing_state?:string;
83
+ billing_zip?:string;
84
+ billing_country?:string;
85
+ }
86
+
87
+ }
88
+ }
@@ -0,0 +1,52 @@
1
+ declare module 'chargebee' {
2
+ export interface Comment {
3
+
4
+ id:string;
5
+ entity_type:EntityType;
6
+ added_by?:string;
7
+ notes:string;
8
+ created_at:number;
9
+ type:'system' | 'user';
10
+ entity_id:string;
11
+ }
12
+ export namespace Comment {
13
+ export class CommentResource {
14
+ delete(comment_id:string):ChargebeeRequest<DeleteResponse>;
15
+ retrieve(comment_id:string):ChargebeeRequest<RetrieveResponse>;
16
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
17
+ create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
18
+ }
19
+ export interface DeleteResponse {
20
+ comment:Comment;
21
+ }
22
+
23
+ export interface RetrieveResponse {
24
+ comment:Comment;
25
+ }
26
+
27
+ export interface ListResponse {
28
+ list:{comment:Comment}[];
29
+ next_offset?:string;
30
+ }
31
+ export interface ListInputParam {
32
+ [key: string]: string | number | object | boolean;
33
+ limit?:number;
34
+ offset?:string;
35
+ entity_type?:'item' | 'product' | 'coupon' | 'addon' | 'item_price' | 'business_entity' | 'subscription' | 'item_family' | 'credit_note' | 'quote' | 'variant' | 'invoice' | 'plan' | 'transaction' | 'customer' | 'order';
36
+ entity_id?:string;
37
+ created_at?:{after?:string,before?:string,between?:string,on?:string};
38
+ sort_by?:{asc?:'created_at',desc?:'created_at'};
39
+ }
40
+ export interface CreateResponse {
41
+ comment:Comment;
42
+ }
43
+ export interface CreateInputParam {
44
+
45
+ entity_type:EntityType;
46
+ entity_id:string;
47
+ notes:string;
48
+ added_by?:string;
49
+ }
50
+
51
+ }
52
+ }
@@ -0,0 +1,15 @@
1
+ declare module 'chargebee' {
2
+ export interface Contact {
3
+
4
+ id:string;
5
+ first_name?:string;
6
+ last_name?:string;
7
+ email:string;
8
+ phone?:string;
9
+ label?:string;
10
+ enabled:boolean;
11
+ send_account_email:boolean;
12
+ send_billing_email:boolean;
13
+ }
14
+
15
+ }
@@ -0,0 +1,18 @@
1
+ declare module 'chargebee' {
2
+ export interface ContractTerm {
3
+
4
+ id:string;
5
+ status:'active' | 'cancelled' | 'completed' | 'terminated';
6
+ contract_start:number;
7
+ contract_end:number;
8
+ billing_cycle:number;
9
+ action_at_term_end:'cancel' | 'renew_once' | 'renew' | 'evergreen';
10
+ total_contract_value:number;
11
+ total_contract_value_before_tax:number;
12
+ cancellation_cutoff_period?:number;
13
+ created_at:number;
14
+ subscription_id:string;
15
+ remaining_billing_cycles?:number;
16
+ }
17
+
18
+ }